Package org.apache.axis2.deployment

Examples of org.apache.axis2.deployment.DeploymentEngine


                // NhttpConstants.SC_ACCEPTED set to Boolean.TRUE to indicate this is a
                // placeholder message for the transport to send a HTTP 202 to the
                // client. Should / would be ignored by any transport other than
                // nhttp. For example, JMS would not send a reply message for one-way
                // operations.
                MessageContext outMsgCtx =
                        (MessageContext) context.getAttribute(OUTGOING_MESSAGE_CONTEXT);
                MessageReceiver mr = outMsgCtx.getAxisOperation().getMessageReceiver();

                // the following check is to support the dual channel invocation. Hence the
                // response will be sent as a new request to the client over a different channel
                // client sends back a 202 Accepted response to synapse and we need to neglect that
                // 202 Accepted message
                if (!outMsgCtx.isPropertyTrue(NhttpConstants.IGNORE_SC_ACCEPTED)) {

                    try {
                        MessageContext responseMsgCtx = outMsgCtx.getOperationContext().
                                getMessageContext(WSDL2Constants.MESSAGE_LABEL_IN);
                        if (responseMsgCtx == null ||
                                outMsgCtx.getOptions().isUseSeparateListener()) {
                            // Since we need to notify the SynapseCallback receiver to remove the
                            // call backs registered  we set a custom property
                            if (outMsgCtx.getOperationContext().isComplete()) {
                                setHeaders(context, response, outMsgCtx, responseMsgCtx);
                                outMsgCtx.setProperty(NhttpConstants.HTTP_202_RECEIVED, "true");
                                mr.receive(outMsgCtx);
                            }
                            return;
                        }
                        setHeaders(context, response, outMsgCtx, responseMsgCtx);
                        responseMsgCtx.setServerSide(true);
                        responseMsgCtx.setDoingREST(outMsgCtx.isDoingREST());
                        responseMsgCtx.setProperty(MessageContext.TRANSPORT_IN,
                                outMsgCtx.getProperty(MessageContext.TRANSPORT_IN));
                        responseMsgCtx.setTransportIn(outMsgCtx.getTransportIn());
                        responseMsgCtx.setTransportOut(outMsgCtx.getTransportOut());

                        responseMsgCtx.setAxisMessage(outMsgCtx.getAxisOperation().
                                getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE));
                        responseMsgCtx.setOperationContext(outMsgCtx.getOperationContext());
                        responseMsgCtx.setConfigurationContext(outMsgCtx.getConfigurationContext());
                        responseMsgCtx.setTo(null);

                        if (!outMsgCtx.isDoingREST() && !outMsgCtx.isSOAP11()) {
                            responseMsgCtx.setEnvelope(OMAbstractFactory.getSOAP12Factory().getDefaultEnvelope());
                        } else {
                            responseMsgCtx.setEnvelope(OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope());
                        }
                        responseMsgCtx.setProperty(AddressingConstants.
                                DISABLE_ADDRESSING_FOR_OUT_MESSAGES, Boolean.TRUE);
                        responseMsgCtx.setProperty(NhttpConstants.SC_ACCEPTED, Boolean.TRUE);
                        mr.receive(responseMsgCtx);

                    } catch (org.apache.axis2.AxisFault af) {
                        log.debug("Unable to report back " +
                                "202 Accepted state to the message receiver");
View Full Code Here


     */
    private void processResponse(final NHttpClientConnection conn, HttpContext context,
        HttpResponse response) {

        ContentInputBuffer inputBuffer = null;
        MessageContext outMsgContext = (MessageContext) context.getAttribute(OUTGOING_MESSAGE_CONTEXT);
        String endptPrefix = (String) context.getAttribute(NhttpConstants.ENDPOINT_PREFIX);
        String requestMethod = (String) context.getAttribute(NhttpConstants.HTTP_REQ_METHOD);
        int statusCode = response.getStatusLine().getStatusCode();

        boolean expectEntityBody = false;
View Full Code Here

        }
        return null;
    }

    private void setServerContextAttribute(String key, Object value, NHttpClientConnection conn) {
        MessageContext msgCtx = getMessageContext(conn);
        if (msgCtx != null) {
            Object outTransport = msgCtx.getProperty(Constants.OUT_TRANSPORT_INFO);
            if (outTransport != null && outTransport instanceof ServerWorker) {
                HttpContext context = ((ServerWorker) outTransport).getConn().getContext();
                context.setAttribute(key, value);
            }
        }
View Full Code Here

            deploymentFileData.setClassLoader(isDirectory, getClass().getClassLoader(),
                    (File) cfgCtx.getAxisConfiguration().getParameterValue(
                            Constants.Configuration.ARTIFACTS_TEMP_DIR),
                    cfgCtx.getAxisConfiguration().isChildFirstClassLoading());

            DeploymentClassLoader urlCl
                = (DeploymentClassLoader)deploymentFileData.getClassLoader();
            Thread.currentThread().setContextClassLoader(urlCl);

            // StartupFactory registration
            for (StartupFactory factory : getProviders(StartupFactory.class, urlCl)) {
View Full Code Here

        try {
            URL url = resourceLoader.getResource("org/apache/tuscany/binding/axis2/engine/config/axis2.xml");

            InputStream serviceInputStream = url.openStream();
            AxisConfigBuilder axisConfigBuilder = new AxisConfigBuilder(serviceInputStream, new DeploymentEngine(), axisConfiguration);
            axisConfigBuilder.populateConfig();
            serviceInputStream.close();
            return ConfigurationContextFactory.createConfigurationContext(this);
        } catch (IOException e) {
View Full Code Here

                    entry.getValue().getSynapseEnvironment());
        }
    }

    private void registerDeployer(AxisConfiguration axisConfig, SynapseEnvironment synEnv) {
        DeploymentEngine deploymentEngine = (DeploymentEngine) axisConfig.getConfigurator();

        SynapseArtifactDeploymentStore deploymentStore = synEnv.getSynapseConfiguration().
                getArtifactDeploymentStore();

        String synapseConfigPath = ServiceBusUtils.getSynapseConfigAbsPath(synEnv.
                                getServerContextInformation());
        String taskDirDirPath = synapseConfigPath
                + File.separator + MultiXMLConfigurationBuilder.TASKS_DIR;

        for (Startup stp : synEnv.getSynapseConfiguration().getStartups()) {
            if (stp.getFileName() != null) {
                deploymentStore.addRestoredArtifact(
                        taskDirDirPath + File.separator + stp.getFileName());
            }
        }
        deploymentEngine.addDeployer(new StartupTaskDeployer(),
                taskDirDirPath, ServiceBusConstants.ARTIFACT_EXTENSION);
    }
View Full Code Here

     * @param axisConfig AxisConfiguration to which this deployer belongs
     * @param synapseEnvironment SynapseEnvironment to which this deployer belongs
     */
    private void unregistryDeployer(AxisConfiguration axisConfig,
                                    SynapseEnvironment synapseEnvironment) {
        DeploymentEngine deploymentEngine = (DeploymentEngine) axisConfig.getConfigurator();
        String synapseConfigPath = ServiceBusUtils.getSynapseConfigAbsPath(
                synapseEnvironment.getServerContextInformation());
        String proxyDirPath = synapseConfigPath
                + File.separator + MultiXMLConfigurationBuilder.TASKS_DIR;
        deploymentEngine.removeDeployer(
                proxyDirPath, ServiceBusConstants.ARTIFACT_EXTENSION);
    }
View Full Code Here

    }

    public void createdConfigurationContext(ConfigurationContext configurationContext) {
        Integer tenantId = MultitenantUtils.getTenantId(configurationContext);
        AxisConfiguration axisConfig = configurationContext.getAxisConfiguration();
        DeploymentEngine deploymentEngine = (DeploymentEngine) axisConfig.getConfigurator();

        HumanTaskStore taskStoreForTenant =
                htServer.getHumanTaskStoreManager().createHumanTaskStoreForTenant(tenantId, axisConfig);

        deploymentEngine.addDeployer(new AxisHumanTaskDeployer(taskStoreForTenant), "humantask", "htar");
    }
View Full Code Here

        if(log.isDebugEnabled()) {
            log.debug("Initializing new BPEL deployer for tenant "
                                + MultitenantUtils.getTenantId(configurationContext));
        }
        AxisConfiguration axisConfigOfCurrentTenant = configurationContext.getAxisConfiguration();
        DeploymentEngine axisDeploymentEngine =
                (DeploymentEngine)axisConfigOfCurrentTenant.getConfigurator();
        axisDeploymentEngine.addDeployer(new BPELDeployer(), BPELConstants.BPEL_REPO_DIRECTORY,
                                         BPELConstants.BPEL_PACKAGE_EXTENSION);
    }
View Full Code Here

     * @param synapseEnvironment SynapseEnvironment to which this deployer belongs
     */
    private void registerDeployer(AxisConfiguration axisConfig, SynapseEnvironment synapseEnvironment) {

        SynapseConfiguration synCfg = synapseEnvironment.getSynapseConfiguration();
        DeploymentEngine deploymentEngine = (DeploymentEngine) axisConfig.getConfigurator();
        SynapseArtifactDeploymentStore deploymentStore = synCfg.getArtifactDeploymentStore();

        String synapseConfigPath = ServiceBusUtils.getSynapseConfigAbsPath(
                synapseEnvironment.getServerContextInformation());
        String messageProcessorDirPath = synapseConfigPath
                + File.separator + MultiXMLConfigurationBuilder.MESSAGE_PROCESSOR_DIR;

        for (MessageProcessor processor : synCfg.getMessageProcessors().values()) {
            if (processor.getFileName() != null) {
                deploymentStore.addRestoredArtifact(
                        messageProcessorDirPath + File.separator + processor.getFileName());
            }
        }
        deploymentEngine.addDeployer(new MessageProcessorDeployer(),
                messageProcessorDirPath, ServiceBusConstants.ARTIFACT_EXTENSION);
    }
View Full Code Here

TOP

Related Classes of org.apache.axis2.deployment.DeploymentEngine

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.