Package org.apache.axis2.description

Examples of org.apache.axis2.description.ParameterImpl


        return (ServerConfigurationInformation) serverCfgParam.getValue();
    }

    protected ServerContextInformation getServerContextInformation()
            throws DeploymentException {
        Parameter serverCtxParam =
                cfgCtx.getAxisConfiguration().getParameter(
                        SynapseConstants.SYNAPSE_SERVER_CTX_INFO);
        if (serverCtxParam == null) {
            throw new DeploymentException("ServerContextInformation not found. " +
                    "Are you sure that you are running Synapse?");
        }
        return (ServerContextInformation) serverCtxParam.getValue();
    }
View Full Code Here


        LocalTransportReceiver.CONFIG_CONTEXT = new ConfigurationContext(config);

        service = new AxisService("testService");
        service.addParameter(
                new ParameterImpl(AbstractMessageReceiver.SERVICE_CLASS,
                        Test.class.getName()));
        AxisOperation axisOperation = new InOutAxisOperation(new QName(methodName));
        axisOperation.setMessageExchangePattern(WSDLConstants.MEP_URI_IN_OUT);
        axisOperation.setMessageReceiver(new RPCInOutMessageReceiver());
        service.addOperation(axisOperation);
        Parameter parameter = new ParameterImpl();
        parameter.setName(RPCInOutMessageReceiver.RPCMETHOD_PROPERTY);
        parameter.setValue(method);
        axisOperation.addParameter(parameter);
        service.setClassLoader(Thread.currentThread().getContextClassLoader());
        LocalTransportReceiver.CONFIG_CONTEXT.getAxisConfiguration()
                .addService(service);
    }
View Full Code Here

        String value3 = "value";

        configurationContext.setProperty(key1, value1);
        assertEquals(value1, msgctx.getProperty(key1));

        axisConfiguration.addParameter(new ParameterImpl(key2, value2));
        assertEquals(value2, msgctx.getParameter(key2).getValue());

        opContext.setProperty(key1, value3);
        assertEquals(value3, msgctx.getProperty(key1));
        opContext.getEngineContext();
View Full Code Here

        String key2 = "key2";

        configurationContext.setProperty(key1, value1);
        assertEquals(value1, msgctx.getProperty(key1));

        axisConfiguration.addParameter(new ParameterImpl(key2, value2));
        assertEquals(value2, msgctx.getParameter(key2).getValue());
    }
View Full Code Here

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

        }
    }

     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

        }
    }

     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

        }
    }

     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

        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

     * @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

TOP

Related Classes of org.apache.axis2.description.ParameterImpl

Copyright © 2018 www.massapicom. 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.