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);
}
}
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();
}
Aggregations