Search in sources :

Example 1 with BPELServerConfiguration

use of org.wso2.carbon.bpel.core.ode.integration.config.BPELServerConfiguration in project carbon-business-process by wso2.

the class AxisServiceUtils method addCustomHeadersToMessageContext.

public static void addCustomHeadersToMessageContext(MessageContext mctx) {
    List<Header> headers = null;
    BPELServerConfiguration bpelServerConfiguration = BPELServiceComponent.getBPELServer().getBpelServerConfiguration();
    if (!bpelServerConfiguration.isKeepAlive()) {
        headers = new ArrayList();
        headers.add(new Header(HTTP.CONN_DIRECTIVE, HTTP.CONN_CLOSE));
    }
    // Add more custom header values in the future
    if ((headers != null) && (headers.size() > 0)) {
        mctx.setProperty(HTTPConstants.HTTP_HEADERS, headers);
    }
}
Also used : BPELServerConfiguration(org.wso2.carbon.bpel.core.ode.integration.config.BPELServerConfiguration) Header(org.apache.commons.httpclient.Header) ArrayList(java.util.ArrayList)

Example 2 with BPELServerConfiguration

use of org.wso2.carbon.bpel.core.ode.integration.config.BPELServerConfiguration in project carbon-business-process by wso2.

the class BPELServerImpl method init.

/**
 * Initialize the ODE BPEL engine.
 *
 * @throws Exception if failed to start the BPEL engine.
 */
public void init() throws Exception {
    bpelServerConfiguration = new BPELServerConfiguration();
    odeConfigurationProperties = new ODEConfigurationProperties(bpelServerConfiguration);
    if (log.isDebugEnabled()) {
        log.debug("Initializing transaction manager");
    }
    initTransactionManager();
    if (log.isDebugEnabled()) {
        log.debug("Creating data source");
    }
    initDataSource();
    if (log.isDebugEnabled()) {
        log.debug("Starting DAO");
    }
    initDAO();
    BPELEndpointReferenceContextImpl eprContext = new BPELEndpointReferenceContextImpl();
    if (log.isDebugEnabled()) {
        log.debug("Initializing BPEL process store");
    }
    initProcessStore(eprContext);
    if (log.isDebugEnabled()) {
        log.debug("Initializing BPEL server");
    }
    initBPELServer(eprContext);
    if (log.isDebugEnabled()) {
        log.debug("Initializing multithreaded connection manager");
    }
    initHttpConnectionManager();
    /* Register event listeners configured in ode-axis2.properties file*/
    registerEventListeners();
    /* Register message exchange interceptors configured in ode-axis.properties file*/
    registerMexInterceptors();
    registerExtensionActivityBundles();
    registerExtensionCorrelationFilters();
    try {
        odeBpelServer.start();
    } catch (Exception e) {
        shutdown();
        String errMsg = "BPEL Server failed to start.";
        log.error(errMsg, e);
        throw new Exception(errMsg, e);
    }
    if (bpelServerConfiguration.getUseDistributedLock() && isAxis2ClusteringEnabled()) {
        BPELServerHolder.getInstance().addObserver(this);
        if (log.isDebugEnabled()) {
            log.debug("Clustering Enabled, Registering Observer for HazelCast service");
        }
    }
    registerMBeans();
}
Also used : BPELServerConfiguration(org.wso2.carbon.bpel.core.ode.integration.config.BPELServerConfiguration) InstanceAlreadyExistsException(javax.management.InstanceAlreadyExistsException) NotCompliantMBeanException(javax.management.NotCompliantMBeanException) MBeanRegistrationException(javax.management.MBeanRegistrationException) BpelEngineException(org.apache.ode.bpel.iapi.BpelEngineException)

Aggregations

BPELServerConfiguration (org.wso2.carbon.bpel.core.ode.integration.config.BPELServerConfiguration)2 ArrayList (java.util.ArrayList)1 InstanceAlreadyExistsException (javax.management.InstanceAlreadyExistsException)1 MBeanRegistrationException (javax.management.MBeanRegistrationException)1 NotCompliantMBeanException (javax.management.NotCompliantMBeanException)1 Header (org.apache.commons.httpclient.Header)1 BpelEngineException (org.apache.ode.bpel.iapi.BpelEngineException)1