Examples of ParameterImpl


Examples of org.apache.axis2.description.ParameterImpl

public class ParameterAddTest extends TestCase {

    private AxisConfiguration reg = new AxisConfiguration();
    public void testAddParameterServiceLockedAtAxisConfig(){
        try {
            Parameter para = new ParameterImpl();
            para.setValue(null);
            para.setName("PARA_NAME");
            para.setLocked(true);
            reg.addParameter(para);

            AxisService service = new AxisService("Service1");
            reg.addService(service);
            service.addParameter(para);
View Full Code Here

Examples of org.apache.axis2.description.ParameterImpl

        }
    }

     public void testAddParameterModuleLockedAtAxisConfig(){
        try {
            Parameter para = new ParameterImpl();
            para.setValue(null);
            para.setName("PARA_NAME");
            para.setLocked(true);
            reg.addParameter(para);
            ModuleDescription module = new ModuleDescription(new QName("Service1"));
            module.setParent(reg);
            module.addParameter(para);
            fail("This should fails with Parmter is locked can not overide");
View Full Code Here

Examples of org.apache.axis2.description.ParameterImpl

        }
    }

     public void testAddParameterOperationlockedByAxisConfig(){
        try {
            Parameter para = new ParameterImpl();
            para.setValue(null);
            para.setName("PARA_NAME");
            para.setLocked(true);
            reg.addParameter(para);

            AxisService service = new AxisService("Service1");
            reg.addService(service);
View Full Code Here

Examples of org.apache.axis2.description.ParameterImpl

        }
    }

     public void testAddParameterOperationLockebyService(){
        try {
            Parameter para = new ParameterImpl();
            para.setValue(null);
            para.setName("PARA_NAME");
            para.setLocked(true);

            AxisService service = new AxisService("Service1");
            reg.addService(service);
            service.addParameter(para);
View Full Code Here

Examples of org.apache.axis2.description.ParameterImpl

        while (parameters.hasNext()) {

            // this is to check whether some one has locked the parmter at the top level
            OMElement parameterElement = (OMElement) parameters.next();
            Parameter parameter = new ParameterImpl();

            // setting parameterElement
            parameter.setParameterElement(parameterElement);

            // setting parameter Name
            OMAttribute paramName = parameterElement.getAttribute(new QName(ATTRIBUTE_NAME));

            if (paramName == null) {
                throw new DeploymentException(
                        Messages.getMessage(DeploymentErrorMsgs.BAD_PARAMETER_ARGUMENT));
            }

            parameter.setName(paramName.getAttributeValue());

            // setting parameter Value (the chiled elemnt of the parameter)
            OMElement paramValue = parameterElement.getFirstElement();

            if (paramValue != null) {
                parameter.setValue(parameterElement);
                parameter.setParameterType(Parameter.OM_PARAMETER);
            } else {
                String paratextValue = parameterElement.getText();

                parameter.setValue(paratextValue);
                parameter.setParameterType(Parameter.TEXT_PARAMETER);
            }

            // setting locking attribute
            OMAttribute paramLocked = parameterElement.getAttribute(new QName(ATTRIBUTE_LOCKED));
            Parameter parentParam = null;

            if (parent != null) {
                parentParam = parent.getParameter(parameter.getName());
            }

            if (paramLocked != null) {
                String lockedValue = paramLocked.getAttributeValue();

                if (BOOLEAN_TRUE.equals(lockedValue)) {

                    // if the parameter is locked at some level parameter value replace by that
                    if ((parent != null) && parent.isParameterLocked(parameter.getName())) {
                        throw new DeploymentException(
                                Messages.getMessage(
                                        DeploymentErrorMsgs.CONFIG_NOT_FOUND, parameter.getName()));
                    } else {
                        parameter.setLocked(true);
                    }
                } else {
                    parameter.setLocked(false);
                }
            }

            if (Constants.WSA_ACTION.equals(paramName.getAttributeValue())) {
                wsamapping.add(parameter);

                // no need to add this parameter , since this is just for mapping
                continue;
            }

            try {
                if (parent != null) {
                    if ((parentParam == null) || !parent.isParameterLocked(parameter.getName())) {
                        parameterInclude.addParameter(parameter);
                    }
                } else {
                    parameterInclude.addParameter(parameter);
                }
View Full Code Here

Examples of org.apache.axis2.description.ParameterImpl

     * @param axisConfig
     * @return return created AxisSrevice
     */
    public static AxisService createService(String implClass,
                                            AxisConfiguration axisConfig) throws AxisFault {
        Parameter parameter = new ParameterImpl(Constants.SERVICE_CLASS, implClass);
        AxisService axisService = new AxisService();
        axisService.setUseDefaultChains(false);
        axisService.addParameter(parameter);

        int index = implClass.lastIndexOf(".");
View Full Code Here

Examples of org.apache.axis2.description.ParameterImpl

                                                  MessageReceiver messageReceiver, String className, QName opName)
            throws AxisFault {
        AxisService service = new AxisService(serviceName.getLocalPart());

        service.setClassLoader(Thread.currentThread().getContextClassLoader());
        service.addParameter(new ParameterImpl(AbstractMessageReceiver.SERVICE_CLASS, className));

        // todo I assumed in-out mep , this has to be imroved : Deepal
        AxisOperation axisOp = new InOutAxisOperation(opName);

        axisOp.setMessageReceiver(messageReceiver);
View Full Code Here

Examples of org.apache.axis2.description.ParameterImpl

                                                           QName opName)
            throws AxisFault {
        AxisService service = new AxisService(serviceName.getLocalPart());

        service.setClassLoader(Thread.currentThread().getContextClassLoader());
        service.addParameter(new ParameterImpl(AbstractMessageReceiver.SERVICE_CLASS, className));

        // todo I assumed in-out mep , this has to be imroved : Deepal
        AxisOperation axisOp = new OutInAxisOperation(opName);

        axisOp.setMessageReceiver(messageReceiver);
View Full Code Here

Examples of org.apache.axis2.description.ParameterImpl

                for (int i = 0; i < service_para.size(); i++) {
                    Parameter parameter = (Parameter) service_para.get(i);
                    String para = req.getParameter(serviceName + "_" + parameter.getName());

                    service.addParameter(new ParameterImpl(parameter.getName(), para));
                }

                HashMap operation = service.getOperations();
                Collection op_col = operation.values();

                for (Iterator iterator = op_col.iterator(); iterator.hasNext();) {
                    AxisOperation axisOperation = (AxisOperation) iterator.next();
                    String op_name = axisOperation.getName().getLocalPart();
                    ArrayList operation_para = axisOperation.getParameters();

                    for (int i = 0; i < operation_para.size(); i++) {
                        Parameter parameter = (Parameter) operation_para.get(i);
                        String para = req.getParameter(op_name + "_" + parameter.getName());

                        axisOperation.addParameter(new ParameterImpl(parameter.getName(), para));
                    }
                }
            }

            res.setContentType("text/css");
View Full Code Here

Examples of org.apache.axis2.description.ParameterImpl

        super(testName);
    }

    protected void setUp() throws Exception {
        UtilServer.start();
        Parameter parameter = new ParameterImpl(
                Constants.Configuration.ENABLE_REST, "true");
        UtilServer.getConfigurationContext()
                .getAxisConfiguration().addParameter(parameter);
        service =
                Utils.createSimpleService(serviceName,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.