Package org.apache.axis2.clustering.context

Examples of org.apache.axis2.clustering.context.ContextManager


     * @throws AxisFault
     */
    public void initCluster() throws AxisFault {
        ClusterManager clusterManager = axisConfiguration.getClusterManager();
        if (clusterManager != null) {
            ContextManager contextManager = clusterManager.getContextManager();
            if (contextManager != null) {
                contextManager.setConfigurationContext(this);
            }
            ConfigurationManager configManager = clusterManager.getConfigurationManager();
            if (configManager != null) {
                configManager.setConfigurationContext(this);
            }
View Full Code Here


        serviceGroup.addService(service);
        return service;
    }

    protected ContextManager getContextManager() throws AxisFault {
        ContextManager contextManager = new DefaultContextManager();
        contextManager.setContextManagerListener(new DefaultContextManagerListener());
        return contextManager;
    }
View Full Code Here

                clazz = Class.forName(className);
            } catch (ClassNotFoundException e) {
                throw new DeploymentException(Messages.getMessage("clusterImplNotFound",
                                                                  className));
            }
            ContextManager contextManager = (ContextManager) clazz.newInstance();
            clusterManager.setContextManager(contextManager);

            // Load & set the ContextManagerListener
            OMElement listenerEle =
                    contextManagerEle.getFirstChildWithName(new QName(TAG_LISTENER));
            if (listenerEle != null) {
                classNameAttr = listenerEle.getAttribute(new QName(TAG_CLASS_NAME));
                if (classNameAttr == null) {
                    throw new DeploymentException(Messages.getMessage("classAttributeNotFound",
                                                                      TAG_LISTENER));
                }
                className = classNameAttr.getAttributeValue();
                try {
                    clazz = Class.forName(className);
                } catch (ClassNotFoundException e) {
                    throw new DeploymentException(Messages.getMessage("clusterImplNotFound",
                                                                      className));
                }
                ContextManagerListener listener = (ContextManagerListener) clazz.newInstance();
                contextManager.setContextManagerListener(listener);
            } else {
                throw new DeploymentException(Messages.getMessage("contextManagerListenerIsNull"));
            }

            //loading the parameters.
            processParameters(contextManagerEle.getChildrenWithName(new QName(TAG_PARAMETER)),
                              contextManager,
                              null);

            // Load the replication patterns to be excluded. We load the following structure.
            /*<replication>
                <defaults>
                    <exclude name="foo.bar.*"/>
                </defaults>
                <context class="org.apache.axis2.context.ConfigurationContext">
                    <exclude name="my.sandesha.*"/>
                </context>
                <context class="org.apache.axis2.context.ServiceGroupContext">
                    <exclude name="my.sandesha.*"/>
                </context>
                <context class="org.apache.axis2.context.ServiceContext">
                    <exclude name="my.sandesha.*"/>
                </context>
            </replication>*/
            OMElement replicationEle =
                    contextManagerEle.getFirstChildWithName(new QName(TAG_REPLICATION));
            if (replicationEle != null) {
                // Process defaults
                OMElement defaultsEle =
                        replicationEle.getFirstChildWithName(new QName(TAG_DEFAULTS));
                if (defaultsEle != null) {
                    List defaults = new ArrayList();
                    for (Iterator iter = defaultsEle.getChildrenWithName(new QName(TAG_EXCLUDE));
                         iter.hasNext();) {
                        OMElement excludeEle = (OMElement) iter.next();
                        OMAttribute nameAtt = excludeEle.getAttribute(new QName(ATTRIBUTE_NAME));
                        defaults.add(nameAtt.getAttributeValue());
                    }
                    contextManager.setReplicationExcludePatterns(TAG_DEFAULTS, defaults);
                }

                // Process specifics
                for (Iterator iter = replicationEle.getChildrenWithName(new QName(TAG_CONTEXT));
                     iter.hasNext();) {
                    OMElement contextEle = (OMElement) iter.next();
                    String ctxClassName =
                            contextEle.getAttribute(new QName(ATTRIBUTE_CLASS)).getAttributeValue();
                    List excludes = new ArrayList();
                    for (Iterator iter2 = contextEle.getChildrenWithName(new QName(TAG_EXCLUDE));
                         iter2.hasNext();) {
                        OMElement excludeEle = (OMElement) iter2.next();
                        OMAttribute nameAtt = excludeEle.getAttribute(new QName(ATTRIBUTE_NAME));
                        excludes.add(nameAtt.getAttributeValue());
                    }
                    contextManager.setReplicationExcludePatterns(ctxClassName, excludes);
                }
            }
        }
    }
View Full Code Here

    }

    public void initCluster() throws AxisFault {
        ClusterManager clusterManager = axisConfiguration.getClusterManager();
        if (clusterManager != null) {
            ContextManager contextManager = clusterManager.getContextManager();
            if (contextManager != null) {
                contextManager.setConfigurationContext(this);
            }
            ConfigurationManager configManager = clusterManager.getConfigurationManager();
            if (configManager != null) {
                configManager.setConfigurationContext(this);
            }
View Full Code Here

    public void execute(ConfigurationContext configCtx) throws ClusteringFault {
        ClusterManager clusterManager = configCtx.getAxisConfiguration().getClusterManager();
        if(clusterManager == null){
            return;
        }
        ContextManager contextManager = clusterManager.getContextManager();
        if (contextManager != null) {
            Map excludedPropPatterns = contextManager.getReplicationExcludePatterns();
            List cmdList = new ArrayList();

            // Add the service group contexts, service contexts & their respective properties
            String[] sgCtxIDs = configCtx.getServiceGroupContextIDs();
            for (int i  = 0; i < sgCtxIDs.length; i ++) {
View Full Code Here

    public void execute(ConfigurationContext configCtx) throws ClusteringFault {
        ClusterManager clusterManager = configCtx.getAxisConfiguration().getClusterManager();
        if(clusterManager == null){
            return;
        }
        ContextManager contextManager = clusterManager.getContextManager();
        if (contextManager != null) {
            Map excludedPropPatterns = contextManager.getReplicationExcludePatterns();
            List<ContextClusteringCommand> cmdList = new ArrayList<ContextClusteringCommand>();

            // Add the service group contexts, service contexts & their respective properties
            String[] sgCtxIDs = configCtx.getServiceGroupContextIDs();
            for (String sgCtxID : sgCtxIDs) {
View Full Code Here

     * @throws AxisFault
     */
    public void initCluster() throws AxisFault {
        ClusterManager clusterManager = axisConfiguration.getClusterManager();
        if (clusterManager != null) {
            ContextManager contextManager = clusterManager.getContextManager();
            if (contextManager != null) {
                contextManager.setConfigurationContext(this);
            }
            ConfigurationManager configManager = clusterManager.getConfigurationManager();
            if (configManager != null) {
                configManager.setConfigurationContext(this);
            }
View Full Code Here

        serviceGroup.addService(service);
        return service;
    }

    protected ContextManager getContextManager() throws AxisFault {
        ContextManager contextManager = new DefaultContextManager();
        contextManager.setContextManagerListener(new DefaultContextManagerListener());
        return contextManager;
    }
View Full Code Here

                clazz = Class.forName(className);
            } catch (ClassNotFoundException e) {
                throw new DeploymentException(Messages.getMessage("clusterImplNotFound",
                                                                  className));
            }
            ContextManager contextManager = (ContextManager) clazz.newInstance();
            clusterManager.setContextManager(contextManager);

            // Load & set the ContextManagerListener
            OMElement listenerEle =
                    contextManagerEle.getFirstChildWithName(new QName(TAG_LISTENER));
            if (listenerEle != null) {
                classNameAttr = listenerEle.getAttribute(new QName(TAG_CLASS_NAME));
                if (classNameAttr == null) {
                    throw new DeploymentException(Messages.getMessage("classAttributeNotFound",
                                                                      TAG_LISTENER));
                }
                className = classNameAttr.getAttributeValue();
                try {
                    clazz = Class.forName(className);
                } catch (ClassNotFoundException e) {
                    throw new DeploymentException(Messages.getMessage("clusterImplNotFound",
                                                                      className));
                }
                ContextManagerListener listener = (ContextManagerListener) clazz.newInstance();
                contextManager.setContextManagerListener(listener);
            } else {
                throw new DeploymentException(Messages.getMessage("contextManagerListenerIsNull"));
            }

            //loading the parameters.
            processParameters(contextManagerEle.getChildrenWithName(new QName(TAG_PARAMETER)),
                              contextManager,
                              null);

            // Load the replication patterns to be excluded. We load the following structure.
            /*<replication>
                <defaults>
                    <exclude name="foo.bar.*"/>
                </defaults>
                <context class="org.apache.axis2.context.ConfigurationContext">
                    <exclude name="my.sandesha.*"/>
                </context>
                <context class="org.apache.axis2.context.ServiceGroupContext">
                    <exclude name="my.sandesha.*"/>
                </context>
                <context class="org.apache.axis2.context.ServiceContext">
                    <exclude name="my.sandesha.*"/>
                </context>
            </replication>*/
            OMElement replicationEle =
                    contextManagerEle.getFirstChildWithName(new QName(TAG_REPLICATION));
            if (replicationEle != null) {
                // Process defaults
                OMElement defaultsEle =
                        replicationEle.getFirstChildWithName(new QName(TAG_DEFAULTS));
                if (defaultsEle != null) {
                    List defaults = new ArrayList();
                    for (Iterator iter = defaultsEle.getChildrenWithName(new QName(TAG_EXCLUDE));
                         iter.hasNext();) {
                        OMElement excludeEle = (OMElement) iter.next();
                        OMAttribute nameAtt = excludeEle.getAttribute(new QName(ATTRIBUTE_NAME));
                        defaults.add(nameAtt.getAttributeValue());
                    }
                    contextManager.setReplicationExcludePatterns(TAG_DEFAULTS, defaults);
                }

                // Process specifics
                for (Iterator iter = replicationEle.getChildrenWithName(new QName(TAG_CONTEXT));
                     iter.hasNext();) {
                    OMElement contextEle = (OMElement) iter.next();
                    String ctxClassName =
                            contextEle.getAttribute(new QName(ATTRIBUTE_CLASS)).getAttributeValue();
                    List excludes = new ArrayList();
                    for (Iterator iter2 = contextEle.getChildrenWithName(new QName(TAG_EXCLUDE));
                         iter2.hasNext();) {
                        OMElement excludeEle = (OMElement) iter2.next();
                        OMAttribute nameAtt = excludeEle.getAttribute(new QName(ATTRIBUTE_NAME));
                        excludes.add(nameAtt.getAttributeValue());
                    }
                    contextManager.setReplicationExcludePatterns(ctxClassName, excludes);
                }
            }
        }
    }
View Full Code Here

     * @throws AxisFault
     */
    public void initCluster() throws AxisFault {
        ClusterManager clusterManager = axisConfiguration.getClusterManager();
        if (clusterManager != null) {
            ContextManager contextManager = clusterManager.getContextManager();
            if (contextManager != null) {
                contextManager.setConfigurationContext(this);
            }
            ConfigurationManager configManager = clusterManager.getConfigurationManager();
            if (configManager != null) {
                configManager.setConfigurationContext(this);
            }
View Full Code Here

TOP

Related Classes of org.apache.axis2.clustering.context.ContextManager

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.