Package org.apache.axis2.cluster

Examples of org.apache.axis2.cluster.ClusterManager


                    serviceGroupContext = ContextFactory.createServiceGroupContext(
                            messageContext.getConfigurationContext(), axisServiceGroup);
                    applicationSessionServiceGroupContextTable
                            .put(serviceGroupName, serviceGroupContext);

                    ClusterManager clusterManager = this.getAxisConfiguration().getClusterManager();
                    if (clusterManager != null) {
                        ContextManager contextManager = clusterManager.getContextManager();
                        if (contextManager != null) {
                            contextManager.addContext(serviceGroupContext);
                        }
                    }
                }
                messageContext.setServiceGroupContext(serviceGroupContext);
                messageContext.setServiceContext(ContextFactory.createServiceContext(
                        serviceGroupContext, axisService));
            } else if (Constants.SCOPE_SOAP_SESSION.equals(scope)) {
                String serviceGroupContextId = messageContext.getServiceGroupContextId();
                if (serviceGroupContextId != null) {
                    serviceGroupContext = getServiceGroupContextFromSoapSessionTable(
                            serviceGroupContextId, messageContext);
                    if (serviceGroupContext == null) {
                        throw new AxisFault("Unable to find corresponding context" +
                                            " for the serviceGroupId: " + serviceGroupContextId);
                    }
                } else {
                    AxisServiceGroup axisServiceGroup = (AxisServiceGroup) axisService.getParent();
                    serviceGroupContext =
                            ContextFactory.createServiceGroupContext(this, axisServiceGroup);
                    serviceContext =
                            ContextFactory.createServiceContext(serviceGroupContext, axisService);
                    // set the serviceGroupContextID
                    serviceGroupContextId = UUIDGenerator.getUUID();
                    serviceGroupContext.setId(serviceGroupContextId);

                    ClusterManager clusterManager = this.getAxisConfiguration().getClusterManager();
                    if (clusterManager != null) {
                        ContextManager contextManager = clusterManager.getContextManager();
                        if (contextManager != null) {
                            contextManager.addContext(serviceGroupContext);
                        }
                    }
View Full Code Here


        if (configContext == null) {
            throw new AxisFault(Messages.getMessage("cannotFlushRootNull"));
        }

        AxisConfiguration axisConfiguration = configContext.getAxisConfiguration();
        ClusterManager clusterManager = axisConfiguration.getClusterManager();

        //Calling the ClusterManager probably to replicate the updated state of the context.
        if (clusterManager != null) {
          ContextManager contextManager = clusterManager.getContextManager();
          if (contextManager!=null && contextManager.isContextClusterable (this))
            contextManager.updateState(this);
        }

        //Other logic needed for flushing the contexts
View Full Code Here

        if (classNameAttr==null) {
            throw new DeploymentException(Messages.getMessage("classAttributeNotFound", TAG_CLUSTER));
        }
       
        String className = classNameAttr.getAttributeValue();
        ClusterManager clusterManager;
        try {
            Class clazz = Class.forName(className);
            clusterManager = (ClusterManager) clazz.newInstance();
           
            //loading the parameters.
            Iterator params = clusterElement.getChildrenWithName(new QName(TAG_PARAMETER));
            processParameters(params, clusterManager,null );
           
            //loading the ConfigurationManager
            OMElement configurationManagerElement = clusterElement.getFirstChildWithName(
                  new QName (TAG_CONFIGURATION_MANAGER));
            if (configurationManagerElement != null) {
                classNameAttr = configurationManagerElement.getAttribute(new QName(TAG_CLASS_NAME));
                if (classNameAttr==null) {
                    throw new DeploymentException(Messages.getMessage("classAttributeNotFound", TAG_CONFIGURATION_MANAGER));
                }
               
                className = classNameAttr.getAttributeValue();
        clazz = Class.forName(className);
       
        ConfigurationManager configurationManager = (ConfigurationManager) clazz
            .newInstance();
        clusterManager.setConfigurationManager(configurationManager);

        OMElement listenersElement = configurationManagerElement
            .getFirstChildWithName(new QName(TAG_LISTENERS));
        if (listenersElement != null) {
          Iterator listenerElemIter = listenersElement.getChildrenWithName(new QName(
              TAG_LISTENER));
          while (listenerElemIter.hasNext()) {
            OMElement listenerElement = (OMElement) listenerElemIter.next();
                classNameAttr = listenerElement.getAttribute(new QName(TAG_CLASS_NAME));
                if (classNameAttr==null) {
                    throw new DeploymentException(Messages.getMessage("classAttributeNotFound", TAG_LISTENER));
                }
               
                className = classNameAttr.getAttributeValue();
            clazz = Class.forName(className);
            ConfigurationManagerListener listener = (ConfigurationManagerListener) clazz
                .newInstance();
            listener.setConfigurationContext(configCtx);
            configurationManager.addConfigurationManagerListener(listener);
          }
        }

        //updating the ConfigurationManager with the new ConfigurationContext
        configurationManager.setConfigurationContext(configCtx);
      }

     
            // loading the ContextManager
            OMElement contextManagerElement = clusterElement.getFirstChildWithName(
                  new QName (TAG_CONTEXT_MANAGER));
            if (contextManagerElement != null) {
                classNameAttr = contextManagerElement.getAttribute(new QName(TAG_CLASS_NAME));
                if (classNameAttr==null) {
                    throw new DeploymentException(Messages.getMessage("classAttributeNotFound", TAG_CONTEXT_MANAGER));
                }
               
                className = classNameAttr.getAttributeValue();

        clazz = Class.forName(className);
        ContextManager contextManager = (ContextManager) clazz.newInstance();
        clusterManager.setContextManager(contextManager);

        OMElement listenersElement = contextManagerElement.getFirstChildWithName(new QName(
            TAG_LISTENERS));
        if (listenersElement != null) {
          Iterator listenerElemIter = listenersElement.getChildrenWithName(new QName(
View Full Code Here

    public void init(SynapseEnvironment synapseEnvironment) {
        ConfigurationContext cc =
                ((Axis2SynapseEnvironment) synapseEnvironment).getAxis2ConfigurationContext();
        if (!initialized) {
            // The check for clustering environment
            ClusteringAgent clusteringAgent = cc.getAxisConfiguration().getClusteringAgent();
            if (clusteringAgent != null && clusteringAgent.getStateManager() != null) {
                isClusteringEnabled = Boolean.TRUE;
            } else {
                isClusteringEnabled = Boolean.FALSE;
            }
View Full Code Here

        return lbMembershipHandler;
    }

    public void send(MessageContext synCtx) {
        SessionInformation sessionInformation = null;
        Member currentMember = null;
        ConfigurationContext configCtx =
                ((Axis2MessageContext) synCtx).getAxis2MessageContext().getConfigurationContext();
        if (lbMembershipHandler.getConfigurationContext() == null) {
            lbMembershipHandler.setConfigurationContext(configCtx);
        }
View Full Code Here

    }

    //----------------------- default method implementations and common code -----------------------

    public void init(SynapseEnvironment synapseEnvironment) {
        ConfigurationContext cc =
                ((Axis2SynapseEnvironment) synapseEnvironment).getAxis2ConfigurationContext();
        if (!initialized) {
            // The check for clustering environment
            ClusteringAgent clusteringAgent = cc.getAxisConfiguration().getClusteringAgent();
            if (clusteringAgent != null && clusteringAgent.getStateManager() != null) {
                isClusteringEnabled = Boolean.TRUE;
            } else {
                isClusteringEnabled = Boolean.FALSE;
            }
View Full Code Here

     */
    private AlgorithmContext algorithmContext;

    @Override
    public void init(SynapseEnvironment synapseEnvironment) {
        ConfigurationContext cc =
                ((Axis2SynapseEnvironment) synapseEnvironment).getAxis2ConfigurationContext();
        if (!initialized) {
            super.init(synapseEnvironment);
            if (algorithmContext == null) {
                algorithmContext = new AlgorithmContext(isClusteringEnabled, cc, getName());
View Full Code Here

    }

    public void send(MessageContext synCtx) {
        SessionInformation sessionInformation = null;
        Member currentMember = null;
        ConfigurationContext configCtx =
                ((Axis2MessageContext) synCtx).getAxis2MessageContext().getConfigurationContext();
        if (lbMembershipHandler.getConfigurationContext() == null) {
            lbMembershipHandler.setConfigurationContext(configCtx);
        }
View Full Code Here

     */
    public static StatisticsCollector getStatisticsCollector(ServerContextInformation contextInfo) {
        if (contextInfo != null && contextInfo.getServerState() == ServerState.INITIALIZED) {
            Object o = contextInfo.getServerContext();
            if (o instanceof ConfigurationContext) {
                ConfigurationContext context = (ConfigurationContext) o;
                SynapseEnvironment environment =
                        (SynapseEnvironment) context.getAxisConfiguration().getParameterValue(
                                SynapseConstants.SYNAPSE_ENV);
                if (environment != null) {
                    return environment.getStatisticsCollector();
                }
            }
View Full Code Here

                    (preserveAddressingProperty != null &&
                            Boolean.parseBoolean(preserveAddressingProperty)));
        }


        ConfigurationContext axisCfgCtx = axisOutMsgCtx.getConfigurationContext();
        AxisConfiguration axisCfg       = axisCfgCtx.getAxisConfiguration();

        AxisService anoymousService =
            AnonymousServiceFactory.getAnonymousService(synapseOutMessageContext.getConfiguration(),
            axisCfg, wsAddressingEnabled, wsRMEnabled, wsSecurityEnabled);
        // mark the anon services created to be used in the client side of synapse as hidden
View Full Code Here

TOP

Related Classes of org.apache.axis2.cluster.ClusterManager

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.