Package org.apache.axis2.context

Examples of org.apache.axis2.context.ServiceGroupContext


        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.setUniqueId(UUIDGenerator.getUUID());
            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
        }
        log.debug("###### Gonna update SG prop in " + serviceGroupContextId + "===" + sgCtx);
        propertyUpdater.updateProperties(sgCtx);
    }
View Full Code Here

        this.serviceGroupContextId = serviceGroupContextId;
    }

    public void execute(ConfigurationContext configurationContext) throws ClusteringFault {
        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

        configContext.getAxisConfiguration().addModule(axisModule);
        // sysContext.getAxisConfiguration().engageModule(moduleDesc.getName());

        configContext.getAxisConfiguration().addService(service);

        return new ServiceGroupContext(configContext, service.getAxisServiceGroup())
                .getServiceContext(service);
    }
View Full Code Here

        mc = configContext.createMessageContext();
        mc.setTransportIn(transportIn);
        mc.setTransportOut(transport);

        ServiceGroupContext sgc = configContext.createServiceGroupContext(
                service.getAxisServiceGroup());
        ServiceContext sc = sgc.getServiceContext(service);

        OperationContext opContext = sc.createOperationContext(axisOp);

        mc.setOperationContext(opContext);
        mc.setTransportOut(transport);
View Full Code Here

            if (!configurationContext.getPropertyDifferences().isEmpty()) {
                contexts.add(configurationContext);
            }

            // Do we need to replicate state stored in ServiceGroupContext?
            ServiceGroupContext sgContext = msgContext.getServiceGroupContext();
            if (sgContext != null && !sgContext.getPropertyDifferences().isEmpty()) {
                contexts.add(sgContext);
            }

            // Do we need to replicate state stored in ServiceContext?
            ServiceContext serviceContext = msgContext.getServiceContext();
View Full Code Here

    private static ServiceContext fillServiceContextAndServiceGroupContext(AxisService axisService,
                                                                           ConfigurationContext configurationContext)
            throws AxisFault {
        String serviceGroupContextId = UUIDGenerator.getUUID();
        ServiceGroupContext serviceGroupContext =
                configurationContext.createServiceGroupContext(axisService.getAxisServiceGroup());

        serviceGroupContext.setId(serviceGroupContextId);
        configurationContext.addServiceGroupContextIntoSoapSessionTable(serviceGroupContext);
        return serviceGroupContext.getServiceContext(axisService);
    }
View Full Code Here

                log.debug(
                        "OperationContextSaveTest:testSaveAndRestore():  ServiceContext equivalency [" +
                                comparesOk + "]");
                assertTrue(comparesOk);

                ServiceGroupContext restored_sgCtx = restored_srvCtx.getServiceGroupContext();
                comparesOk = restored_sgCtx.isEquivalent(serviceGroupContext);
                log.debug(
                        "OperationContextSaveTest:testSaveAndRestore():  ServiceGroupContext equivalency [" +
                                comparesOk + "]");
                assertTrue(comparesOk);
View Full Code Here

        keySC = sc.getClass().getName();
        metaSC = new MetaDataEntry(keySC, sc.getName(), "[" + sc.hashCode() + "]");
        objInfo.put(keySC, metaSC);

        // service group context
        ServiceGroupContext sgc = msgCtx.getServiceGroupContext();
        keySGC = sgc.getClass().getName();
        metaSGC = new MetaDataEntry(keySGC, sgc.getId(), "[" + sgc.hashCode() + "]");
        objInfo.put(keySGC, metaSGC);

        // configuration context
        ConfigurationContext cc = msgCtx.getConfigurationContext();
        keyCC = cc.getClass().getName();
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.