Package org.apache.axis2.context

Examples of org.apache.axis2.context.ConfigurationContext


    }

    //----------------------- 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

            MessageContext outMsgCtx = oc.getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
      if (outMsgCtx == null) {
        throw new AxisFault(Messages.getMessage("outmsgctxnull"));
      }

            ConfigurationContext cfgCtx = sc.getConfigurationContext();

            // set ClientOptions to the current outgoing message
            outMsgCtx.setOptions(options);

      // do Target Resolution
      TargetResolver tr = cfgCtx.getAxisConfiguration().getTargetResolverChain();
            if (tr != null) {
                tr.resolveTarget(outMsgCtx);
            }

            // if the transport to use for sending is not specified, try to find it from the URL
      TransportOutDescription transportOut = options.getTransportOut();
      if (transportOut == null) {
        EndpointReference toEPR =
                    (options.getTo() != null) ? options.getTo() : outMsgCtx.getTo();
        transportOut =
                    ClientUtils.inferOutTransport(cfgCtx.getAxisConfiguration(), toEPR, outMsgCtx);
      }
      outMsgCtx.setTransportOut(transportOut);

      if (options.getTransportIn() == null && outMsgCtx.getTransportIn() == null) {
        outMsgCtx.setTransportIn(ClientUtils.inferInTransport(
                        cfgCtx.getAxisConfiguration(), options, outMsgCtx));
      } else if (outMsgCtx.getTransportIn() == null) {
        outMsgCtx.setTransportIn(options.getTransportIn());
      }

            // add reference parameters to To EPR
View Full Code Here

                            "request will not be cached");
                return true;
            }
        }

        ConfigurationContext cfgCtx =
            ((Axis2MessageContext) synCtx).getAxis2MessageContext().getConfigurationContext();
        if (cfgCtx == null) {
            handleException("Unable to perform caching, "
                + " ConfigurationContext cannot be found", synCtx);
            return false; // never executes.. but keeps IDE happy
        }

        if (synLog.isTraceOrDebugEnabled()) {
            synLog.traceOrDebug("Looking up cache at scope : " + scope + " with ID : "
                    + cacheKey);
        }

        // look up cache
        Object prop = cfgCtx.getPropertyNonReplicable(CachingConstants.CACHE_MANAGER);
        CacheManager cacheManager;
        if (prop != null && prop instanceof CacheManager) {
            cacheManager = (CacheManager) prop;
        } else {
            synchronized (cfgCtx) {
                // check again after taking the lock to make sure no one else did it before us
                prop = cfgCtx.getPropertyNonReplicable(CachingConstants.CACHE_MANAGER);
                if (prop != null && prop instanceof CacheManager) {
                    cacheManager = (CacheManager) prop;

                } else {
                    synLog.traceOrDebug("Creating/recreating the cache object");
                    cacheManager = new CacheManager();
                    cfgCtx.setProperty(CachingConstants.CACHE_MANAGER, cacheManager);
                }
            }
        }

        boolean result = true;
View Full Code Here

     */
    public MessageContext build() throws Exception {
        SynapseConfiguration testConfig = new SynapseConfiguration();
        // TODO: check whether we need a SynapseEnvironment in all cases
        SynapseEnvironment synEnv
            = new Axis2SynapseEnvironment(new ConfigurationContext(new AxisConfiguration()),
                                          testConfig);
        MessageContext synCtx;
        if (requireAxis2MessageContext) {
            synCtx = new Axis2MessageContext(new org.apache.axis2.context.MessageContext(),
                                             testConfig, synEnv);
View Full Code Here

        this.format = format;
    }

    protected HttpClient getHttpClient(MessageContext msgContext) {
        HttpClient httpClient;
        final ConfigurationContext configContext = msgContext.getConfigurationContext();
        synchronized (lock) {
            httpClient = (HttpClient) configContext.getProperty(HTTPConstants.CACHED_HTTP_CLIENT);
            if (httpClient == null) {
                log.trace("Making new ConnectionManager");
                HttpConnectionManager connManager = new MultiThreadedHttpConnectionManager();

                // In case we need to set any params, do it here, but for now use defaults.
//                HttpConnectionManagerParams params = new HttpConnectionManagerParams();
//                params.setMaxConnectionsPerHost(HostConfiguration.ANY_HOST_CONFIGURATION, 200);
//                etc...
//                connManager.setParams(params);

                httpClient = new HttpClient(connManager);
                HttpClientParams clientParams = new HttpClientParams();
                // Set the default timeout in case we have a connection pool starvation to 30sec
                clientParams.setConnectionManagerTimeout(30000);
                httpClient.setParams(clientParams);
                configContext.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient);
            }

            // Get the timeout values set in the runtime
            initializeTimeouts(msgContext, httpClient);
        }
View Full Code Here

    try {
      Thread.currentThread().setContextClassLoader(getClass().getClassLoader());

      configurator = new OSGiConfigurator(config);

      ConfigurationContext configContext =
        ConfigurationContextFactory.createConfigurationContext(configurator);

      configContext.setProperty(Constants.CONTAINER_MANAGED,
                                Constants.VALUE_TRUE);
      return configContext;
    } catch (Exception e) {
      Activator.log.warn("Failed to init axis context", e);
      throw new ServletException(e);
View Full Code Here

TOP

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

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.