Package org.apache.axis2.context

Examples of org.apache.axis2.context.ServiceGroupContext


        AxisOperation operation2 = new InOnlyAxisOperation(new QName("operation2"));
        as1.addOperation(operation1);
        as1.addOperation(operation2);

        ConfigurationContext cc = new ConfigurationContext(ac);
        ServiceGroupContext sgc = cc.createServiceGroupContext(as1.getAxisServiceGroup());
        ServiceContext serviceContext = sgc.getServiceContext(as1);
        OperationContext oc1 = serviceContext.createOperationContext(operation1);
        OperationContext oc2 = serviceContext.createOperationContext(operation2);
        cc.registerOperationContext("urn:org.apache.axis2.dispatchers.messageid:123", oc1);
        cc.registerOperationContext("urn:org.apache.axis2.dispatchers.messageid:456", oc2);
        messageContext = cc.createMessageContext();
View Full Code Here


        AxisConfiguration ac = new AxisConfiguration();
        ConfigurationContext cc = new ConfigurationContext(ac);
        AxisService as1 = new AxisService("Service1");
        AxisServiceGroup sg = new AxisServiceGroup(ac);
        sg.addService(as1);
        ServiceGroupContext sgc = cc.createServiceGroupContext(sg);

        ServiceContext sc1 = sgc.getServiceContext(as1);

        AxisService as2 = new AxisService("Service2");
        sg.addService(as2);
        ServiceContext sc2 = sgc.getServiceContext(as2);

        ac.addService(as1);
        ac.addService(as2);

        AxisOperation operation1 = new InOnlyAxisOperation(new QName("operation1"));
View Full Code Here

        AxisConfiguration axisCfg       = axisCfgCtx.getAxisConfiguration();

        AxisService anoymousService =
            AnonymousServiceFactory.getAnonymousService(synapseOutMessageContext.getConfiguration(),
            axisCfg, wsAddressingEnabled, wsRMEnabled, wsSecurityEnabled);
        ServiceGroupContext sgc = new ServiceGroupContext(
            axisCfgCtx, (AxisServiceGroup) anoymousService.getParent());
        ServiceContext serviceCtx = sgc.getServiceContext(anoymousService);

        boolean outOnlyMessage = "true".equals(
            synapseOutMessageContext.getProperty(SynapseConstants.OUT_ONLY));

        // get a reference to the DYNAMIC operation of the Anonymous Axis2 service
View Full Code Here

            .getServiceGroupContext());
        newMessageContext.setServiceGroupContextId(referenceMessage
            .getServiceGroupContextId());
      } else {
        AxisServiceGroup axisServiceGroup = new AxisServiceGroup (axisConfiguration);
        ServiceGroupContext serviceGroupContext = new ServiceGroupContext (configContext,axisServiceGroup);
       
        newMessageContext.setAxisServiceGroup(axisServiceGroup);
        newMessageContext.setServiceGroupContext (serviceGroupContext);
      }
View Full Code Here

    private static UpdateContextCommand toUpdateContextCommand(AbstractContext context) {
        UpdateContextCommand cmd = null;
        if (context instanceof ConfigurationContext) {
            cmd = new UpdateConfigurationContextCommand();
        } else if (context instanceof ServiceGroupContext) {
            ServiceGroupContext sgCtx = (ServiceGroupContext) context;
            cmd = new UpdateServiceGroupContextCommand();
            UpdateServiceGroupContextCommand updateSgCmd = (UpdateServiceGroupContextCommand) cmd;
            updateSgCmd.setServiceGroupName(sgCtx.getDescription().getServiceGroupName());
            updateSgCmd.setServiceGroupContextId(sgCtx.getId());
        } else if (context instanceof ServiceContext) {
            ServiceContext serviceCtx = (ServiceContext) context;
            cmd = new UpdateServiceContextCommand();
            UpdateServiceContextCommand updateServiceCmd = (UpdateServiceContextCommand) cmd;
            String sgName =
View Full Code Here

        return false;
    }

    public static ContextClusteringCommand getRemoveCommand(AbstractContext abstractContext) {
        if (abstractContext instanceof ServiceGroupContext) {
            ServiceGroupContext sgCtx = (ServiceGroupContext) abstractContext;
            DeleteServiceGroupContextCommand cmd = new DeleteServiceGroupContextCommand();
            cmd.setServiceGroupContextId(sgCtx.getId());

            return cmd;
        }
        return null;
    }
View Full Code Here

    public void setServiceGroupContextId(String serviceGroupContextId) {
        this.serviceGroupContextId = serviceGroupContextId;
    }

    public void execute(ConfigurationContext configContext) throws ClusteringFault {
        ServiceGroupContext sgCtx =
                configContext.getServiceGroupContext(serviceGroupContextId);

        // If the ServiceGroupContext is not found, create it
        if (sgCtx == null) {
            AxisServiceGroup axisServiceGroup =
                    configContext.getAxisConfiguration().getServiceGroup(serviceGroupName);
            if(axisServiceGroup == null){
                return;
            }
            sgCtx = new ServiceGroupContext(configContext, axisServiceGroup);
            sgCtx.setId(serviceGroupContextId);
            configContext.addServiceGroupContextIntoSoapSessionTable(sgCtx)// TODO: Check this
        }
        if (log.isDebugEnabled()) {
            log.debug("Gonna update SG prop in " + serviceGroupContextId + "===" + sgCtx);
        }
View Full Code Here

            List<ContextClusteringCommand> cmdList = new ArrayList<ContextClusteringCommand>();

            // Add the service group contexts, service contexts & their respective properties
            String[] sgCtxIDs = configCtx.getServiceGroupContextIDs();
            for (String sgCtxID : sgCtxIDs) {
                ServiceGroupContext sgCtx = configCtx.getServiceGroupContext(sgCtxID);
                ContextClusteringCommand updateServiceGroupCtxCmd =
                        ContextClusteringCommandFactory.getUpdateCommand(sgCtx,
                                                                         excludedPropPatterns,
                                                                         true);
                if (updateServiceGroupCtxCmd != null) {
                    cmdList.add(updateServiceGroupCtxCmd);
                }
                if (sgCtx.getServiceContexts() != null) {
                    for (Iterator iter2 = sgCtx.getServiceContexts(); iter2.hasNext();) {
                        ServiceContext serviceCtx = (ServiceContext) iter2.next();
                        ContextClusteringCommand updateServiceCtxCmd =
                                ContextClusteringCommandFactory.getUpdateCommand(serviceCtx,
                                                                                 excludedPropPatterns,
                                                                                 true);
View Full Code Here

    public void execute(ConfigurationContext configurationContext) throws ClusteringFault {
        if (log.isDebugEnabled()) {
            log.debug("Updating service context properties...");
        }
        ServiceGroupContext sgCtx =
                configurationContext.getServiceGroupContext(serviceGroupContextId);
        if (sgCtx != null) {
            try {
                AxisService axisService =
                        configurationContext.getAxisConfiguration().getService(serviceName);
                ServiceContext serviceContext = sgCtx.getServiceContext(axisService);
                propertyUpdater.updateProperties(serviceContext);
            } catch (AxisFault e) {
                throw new ClusteringFault(e);
            }
        } else {
            sgCtx = configurationContext.getServiceGroupContext(serviceGroupContextId);
            AxisService axisService;
            try {
                axisService = configurationContext.getAxisConfiguration().getService(serviceName);
            } catch (AxisFault axisFault) {
                throw new ClusteringFault(axisFault);
            }
            String scope = axisService.getScope();
            if (sgCtx == null) {
                AxisServiceGroup serviceGroup =
                        configurationContext.getAxisConfiguration().getServiceGroup(serviceGroupName);
                if(serviceGroup == null){
                    return;
                }
                sgCtx = new ServiceGroupContext(configurationContext, serviceGroup);
                sgCtx.setId(serviceGroupContextId);
                if (scope.equals(Constants.SCOPE_APPLICATION)) {
                    configurationContext.
                            addServiceGroupContextIntoApplicationScopeTable(sgCtx);
                } else if (scope.equals(Constants.SCOPE_SOAP_SESSION)) {
                    configurationContext.
                            addServiceGroupContextIntoSoapSessionTable(sgCtx);
                }
            }
            try {
                ServiceContext serviceContext = sgCtx.getServiceContext(axisService);
                propertyUpdater.updateProperties(serviceContext);
            } catch (AxisFault axisFault) {
                throw new ClusteringFault(axisFault);
            }
        }
View Full Code Here

            // register operation context and message context
//            axisOperation.registerOperationContext(msgContext, operationContext);
            axisOperation.registerMessageContext(msgContext, operationContext);

            serviceContext = (ServiceContext) operationContext.getParent();
            ServiceGroupContext serviceGroupContext =
                    (ServiceGroupContext) serviceContext.getParent();

            msgContext.setServiceContext(serviceContext);
            msgContext.setServiceGroupContext(serviceGroupContext);
            msgContext.setServiceGroupContextId(serviceGroupContext.getId());
        } else {    // 2. if null, create new opCtxt
            if (serviceContext == null) {
                // fill the service group context and service context info
                msgContext.getConfigurationContext().
                        fillServiceContextAndServiceGroupContext(msgContext);
View Full Code Here

TOP

Related Classes of org.apache.axis2.context.ServiceGroupContext

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.