Package org.apache.synapse.core

Examples of org.apache.synapse.core.SynapseEnvironment


                SynapseConstants.SYNAPSE_ENV);
        if (parameter.getValue() instanceof SynapseConfiguration &&
                synEnvParameter.getValue() instanceof SynapseEnvironment) {

            SynapseConfiguration synCfg = (SynapseConfiguration) parameter.getValue();
            SynapseEnvironment synapseEnvironment = (SynapseEnvironment) synEnvParameter.getValue();

            if (log.isDebugEnabled()) {
                log.debug("Loading real endpoint with key : " + key);
            }
View Full Code Here


                SynapseConstants.SYNAPSE_ENV);
        if (parameter.getValue() instanceof SynapseConfiguration &&
                synEnvParameter.getValue() instanceof SynapseEnvironment) {

            SynapseConfiguration synCfg = (SynapseConfiguration) parameter.getValue();
            SynapseEnvironment synapseEnvironment = (SynapseEnvironment) synEnvParameter.getValue();

            boolean reLoad = (realEndpoint == null);
            if (!reLoad) {

                Entry entry = synCfg.getEntryDefinition(key);
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();
                }
            }
        }
        return null;
    }
View Full Code Here

        Task task = (Task) jdm.get(TaskDescription.INSTANCE);
        if (task == null) {
            initRequired = true;
        }

        SynapseEnvironment se = (SynapseEnvironment) jdm.get("SynapseEnvironment");

        if (initRequired) {
            try {
                task = (Task) getClass().getClassLoader().loadClass(jobClassName).newInstance();
            } catch (Exception e) {
                handleException("Cannot instantiate task : " + jobClassName, e);
            }

            Set properties = (Set) jdm.get(PROPERTIES);
            for (Object property : properties) {
                OMElement prop = (OMElement) property;
                log.debug("Found Property : " + prop.toString());
                PropertyHelper.setStaticProperty(prop, task);
            }

            // 1. Initialize
            if (task instanceof ManagedLifecycle && se != null) {
                ((ManagedLifecycle) task).init(se);
            }
        }

        // 2. Execute
        if (se != null && task != null && se.isInitialized()) {
            task.execute();
        }

        if (initRequired) {
            // 3. Destroy
View Full Code Here

        assertAlreadyExists(key, ENTRY);
       
        if (entry.getType() == Entry.URL_SRC && entry.getValue() == null) {
            try {
                SynapseEnvironment synEnv = SynapseConfigUtils.getSynapseEnvironment(
                        axisConfiguration);
                entry.setValue(SynapseConfigUtils.getOMElementFromURL(entry.getSrc()
                        .toString(), synEnv != null ? synEnv.getServerContextInformation()
                        .getServerConfigurationInformation().getSynapseHome() : ""));
                localRegistry.put(key, entry);
                for (SynapseObserver o : observers) {
                    o.entryAdded(entry);
                }
View Full Code Here

    }

    public synchronized void updateEntry(String key, Entry entry) {
        if (entry.getType() == Entry.URL_SRC && entry.getValue() == null) {
            try {
                SynapseEnvironment synEnv = SynapseConfigUtils.getSynapseEnvironment(
                        axisConfiguration);
                entry.setValue(SynapseConfigUtils.getOMElementFromURL(entry.getSrc()
                        .toString(), synEnv != null ? synEnv.getServerContextInformation()
                        .getServerConfigurationInformation().getSynapseHome() : ""));
                localRegistry.put(key, entry);
                for (SynapseObserver o : observers) {
                    o.entryAdded(entry);
                }
View Full Code Here

     */
    public void receive(MessageContext mc) throws AxisFault {
        // Create synapse message context from the axis2 message context
        SynapseConfiguration synCfg = (SynapseConfiguration) mc.getConfigurationContext()
                .getAxisConfiguration().getParameter(SynapseConstants.SYNAPSE_CONFIG).getValue();
        SynapseEnvironment synEnv = (SynapseEnvironment) mc.getConfigurationContext()
                .getAxisConfiguration().getParameter(SynapseConstants.SYNAPSE_ENV).getValue();
        org.apache.synapse.MessageContext smc = new Axis2MessageContext(mc, synCfg, synEnv);
        // initialize the response message builder using the message context
        ResponseMessageBuilder messageBuilder = new ResponseMessageBuilder(mc);
        try {
View Full Code Here

                output = ResultBuilderFactory.Output.SOAP_ENVELOPE;
            } else {
                output = ResultBuilderFactory.Output.ELEMENT;
            }
           
            SynapseEnvironment synEnv = synCtx.getEnvironment();
            ResultBuilder resultBuilder =
                    resultBuilderFactory.createResultBuilder(synEnv, output);
            SourceBuilder sourceBuilder = sourceBuilderFactory.createSourceBuilder(synEnv);
           
            if (synLog.isTraceOrDebugEnabled()) {
View Full Code Here

     * @param localName    binding localname string in xpath expression
     * @return jaxen Function object for corresponding extension
     */
    public static Function getFunctionContext(MessageContext ctxt, String namespaceURI, String prefix,
                                              String localName) {
        SynapseEnvironment environment = ctxt.getEnvironment();
        if (environment != null) {
            Map<QName, SynapseXpathFunctionContextProvider> extensions =
                    environment.getXpathFunctionExtensions();
            SynapseXpathFunctionContextProvider functionContextProvider =
                    getMatchingExtensionProvider(extensions, namespaceURI, prefix, localName);
            if (functionContextProvider != null) {
                return initAndReturnXpathFunction(functionContextProvider, ctxt);
            }
View Full Code Here

     * @param localName    binding localname string in xpath expression
     * @return Object variable resolved by corresponding extension
     */
    public static Object resolveVariableContext(MessageContext ctxt, String namespaceURI,
                                                String prefix, String localName) {
        SynapseEnvironment environment = ctxt.getEnvironment();
        if (environment != null) {
            Map<QName, SynapseXpathVariableResolver> extensions =
                    environment.getXpathVariableExtensions();
            SynapseXpathVariableResolver variableResolver =
                    getMatchingExtensionProvider(extensions, namespaceURI, prefix, localName);
            if (variableResolver != null) {
                return resolveXpathVariable(variableResolver, ctxt);
            }
View Full Code Here

TOP

Related Classes of org.apache.synapse.core.SynapseEnvironment

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.