Package org.apache.axis2.clustering.context.commands

Examples of org.apache.axis2.clustering.context.commands.UpdateContextCommand


    public static ContextClusteringCommand getUpdateCommand(AbstractContext context,
                                                            String[] propertyNames)
            throws ClusteringFault {

        UpdateContextCommand cmd = toUpdateContextCommand(context);
        if (cmd != null) {
            fillProperties(cmd, context, propertyNames);
            if (cmd.isPropertiesEmpty()) {
                cmd = null;
            }
        }

        synchronized (context) {
View Full Code Here


        }
        return cmd;
    }

    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();
View Full Code Here

     */
    public static ContextClusteringCommand getUpdateCommand(AbstractContext context,
                                                            Map excludedPropertyPatterns,
                                                            boolean includeAllProperties) {

        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 =
                    serviceCtx.getServiceGroupContext().getDescription().getServiceGroupName();
            updateServiceCmd.setServiceGroupName(sgName);
            updateServiceCmd.setServiceGroupContextId(serviceCtx.getServiceGroupContext().getId());
            updateServiceCmd.setServiceName(serviceCtx.getAxisService().getName());
        }
        if (cmd != null) {
            cmd.setUniqueId(UUIDGenerator.getUUID());
            fillProperties(cmd,
                           context,
                           excludedPropertyPatterns,
                           includeAllProperties);
            if (cmd.isPropertiesEmpty()) {
                cmd = null;
            } else {
                AckManager.addInitialAcknowledgement(cmd);
            }
        }
View Full Code Here

     */
    public static ContextClusteringCommand getUpdateCommand(AbstractContext context,
                                                            Map excludedPropertyPatterns,
                                                            boolean includeAllProperties) {

        UpdateContextCommand cmd = toUpdateContextCommand(context);
        if (cmd != null) {
            fillProperties(cmd,
                           context,
                           excludedPropertyPatterns,
                           includeAllProperties);
            if (cmd.isPropertiesEmpty()) {
                cmd = null;
            }
        }
        return cmd;
    }
View Full Code Here

    public static ContextClusteringCommand getUpdateCommand(AbstractContext context,
                                                            String[] propertyNames)
            throws ClusteringFault {

        UpdateContextCommand cmd = toUpdateContextCommand(context);
        if (cmd != null) {
            fillProperties(cmd, context, propertyNames);
            if (cmd.isPropertiesEmpty()) {
                cmd = null;
            }
        }
        return cmd;
    }
View Full Code Here

        }
        return cmd;
    }

    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();
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

TOP

Related Classes of org.apache.axis2.clustering.context.commands.UpdateContextCommand

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.