org.apache.ode.bpel.engine
Class BpelServerImpl

java.lang.Object
  extended by org.apache.ode.bpel.engine.BpelServerImpl
All Implemented Interfaces:
BpelServer, Scheduler.JobProcessor

public class BpelServerImpl
extends java.lang.Object
implements BpelServer, Scheduler.JobProcessor

The BPEL server implementation.

This implementation is intended to be thread safe. The key concurrency mechanism is a "management" read/write lock that synchronizes all management operations (they require "write" access) and prevents concurrent management operations and processing (processing requires "read" access). Write access to the lock is scoped to the method, while read access is scoped to a transaction.

Author:
Maciej Szefler , Matthieu Riou

Nested Class Summary
static interface BpelServerImpl.ContextsAware
          A polled runnable instance that implements this interface will be set with the contexts before the run() method is called.
static class BpelServerImpl.PolledRunnableProcessor
          This wraps up the executor service for polled runnables.
 
Field Summary
protected  BpelDatabase _db
           
static java.lang.String DEFERRED_PROCESS_INSTANCE_CLEANUP_DISABLED_NAME
           
 
Constructor Summary
BpelServerImpl()
           
 
Method Summary
 void acquireTransactionLocks()
           
 void cleanupProcess(ProcessConf pconf)
           
protected  BpelEngineImpl createBpelEngineImpl(Contexts contexts)
           
protected  BpelProcess createBpelProcess(ProcessConf conf)
           
protected  boolean deleteProcessDAO(javax.xml.namespace.QName pid, boolean isInMemory)
           
 BpelDatabase getBpelDb()
           
 Contexts getContexts()
           
 DebuggerContext getDebugger(javax.xml.namespace.QName pid)
           
 BpelEngine getEngine()
           
 BpelEngine getEngineUnsecured()
          This is the unsecured version of above method getEngine.
 com.hazelcast.core.HazelcastInstance getHazelcastInstance()
           
 boolean hasActiveInstances(javax.xml.namespace.QName pid)
           
 void init()
           
 void onScheduledJob(Scheduler.JobInfo jobInfo)
           
 void register(ProcessConf conf)
           
 void registerBpelEventListener(BpelEventListener listener)
          Register a global listener to receive BpelEvents froom all processes.
 void registerExtensionBundle(ExtensionBundleRuntime bundle)
           
 void registerExtensionCorrelationFilter(ExtensionCorrelationFilter filter)
           
 void registerExternalVariableEngine(ExternalVariableModule eve)
           
 void registerMessageExchangeInterceptor(MessageExchangeInterceptor interceptor)
          Register a global message exchange interceptor.
 void setBindingContext(BindingContext bc)
           
 void setConfigProperties(java.util.Properties configProperties)
           
 void setCronScheduler(CronScheduler cronScheduler)
           
 void setDaoConnectionFactory(BpelDAOConnectionFactory daoCF)
          Set the DAO connection factory.
 void setDehydrationPolicy(DehydrationPolicy dehydrationPolicy)
           
 void setEndpointReferenceContext(EndpointReferenceContext eprContext)
           
 void setHazelcastInstance(com.hazelcast.core.HazelcastInstance instance)
           
 void setHydrationLazy(boolean hydrationLazy)
           
 void setHydrationLazyMinimumSize(int hydrationLazyMinimumSize)
           
 void setInMemDaoConnectionFactory(BpelDAOConnectionFactory daoCF)
           
 void setInstanceThrottledMaximumCount(int instanceThrottledMaximumCount)
           
 void setMessageExchangeContext(MessageExchangeContext mexContext)
           
 void setMigrationTransactionTimeout(int migrationTransactionTimeout)
           
 void setProcessThrottledMaximumCount(int hydrationThrottledMaximumCount)
           
 void setProcessThrottledMaximumSize(long hydrationThrottledMaximumSize)
           
 void setScheduler(Scheduler scheduler)
           
 void shutdown()
           
 void start()
           
 void stop()
           
 void unregister(javax.xml.namespace.QName pid)
           
 void unregisterBpelEventListener(BpelEventListener listener)
          Unregister a global listener from receive BpelEvents from all processes.
 void unregisterExtensionBundle(java.lang.String nsURI)
           
 void unregisterExtensionCorrelationFilter(java.lang.String nsURI)
           
 void unregisterMessageExchangeInterceptor(MessageExchangeInterceptor interceptor)
          Unregister a global message exchange interceptor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFERRED_PROCESS_INSTANCE_CLEANUP_DISABLED_NAME

public static final java.lang.String DEFERRED_PROCESS_INSTANCE_CLEANUP_DISABLED_NAME
See Also:
Constant Field Values

_db

protected BpelDatabase _db
Constructor Detail

BpelServerImpl

public BpelServerImpl()
Method Detail

setHazelcastInstance

public void setHazelcastInstance(com.hazelcast.core.HazelcastInstance instance)

getHazelcastInstance

public com.hazelcast.core.HazelcastInstance getHazelcastInstance()

getContexts

public Contexts getContexts()

start

public void start()
Specified by:
start in interface BpelServer

registerExternalVariableEngine

public void registerExternalVariableEngine(ExternalVariableModule eve)

registerBpelEventListener

public void registerBpelEventListener(BpelEventListener listener)
Register a global listener to receive BpelEvents froom all processes.

Parameters:
listener -

unregisterBpelEventListener

public void unregisterBpelEventListener(BpelEventListener listener)
Unregister a global listener from receive BpelEvents from all processes.

Parameters:
listener -

stop

public void stop()
Specified by:
stop in interface BpelServer

init

public void init()
          throws BpelEngineException
Specified by:
init in interface BpelServer
Throws:
BpelEngineException

createBpelEngineImpl

protected BpelEngineImpl createBpelEngineImpl(Contexts contexts)

shutdown

public void shutdown()
              throws BpelEngineException
Specified by:
shutdown in interface BpelServer
Throws:
BpelEngineException

getEngine

public BpelEngine getEngine()
Specified by:
getEngine in interface BpelServer

getEngineUnsecured

public BpelEngine getEngineUnsecured()
This is the unsecured version of above method getEngine. Please use with care. This is a hack to make BPS instance management work. TODO: Need to refactor this code in Apache ODE to make it more flexible to manage process engine.

Returns:

register

public void register(ProcessConf conf)
Specified by:
register in interface BpelServer

createBpelProcess

protected BpelProcess createBpelProcess(ProcessConf conf)

unregister

public void unregister(javax.xml.namespace.QName pid)
                throws BpelEngineException
Specified by:
unregister in interface BpelServer
Throws:
BpelEngineException

registerMessageExchangeInterceptor

public void registerMessageExchangeInterceptor(MessageExchangeInterceptor interceptor)
Register a global message exchange interceptor.

Parameters:
interceptor - message-exchange interceptor

unregisterMessageExchangeInterceptor

public void unregisterMessageExchangeInterceptor(MessageExchangeInterceptor interceptor)
Unregister a global message exchange interceptor.

Parameters:
interceptor - message-exchange interceptor

deleteProcessDAO

protected boolean deleteProcessDAO(javax.xml.namespace.QName pid,
                                   boolean isInMemory)

onScheduledJob

public void onScheduledJob(Scheduler.JobInfo jobInfo)
                    throws Scheduler.JobProcessorException
Specified by:
onScheduledJob in interface Scheduler.JobProcessor
Throws:
Scheduler.JobProcessorException

setDehydrationPolicy

public void setDehydrationPolicy(DehydrationPolicy dehydrationPolicy)

setConfigProperties

public void setConfigProperties(java.util.Properties configProperties)

setMessageExchangeContext

public void setMessageExchangeContext(MessageExchangeContext mexContext)
                               throws BpelEngineException
Specified by:
setMessageExchangeContext in interface BpelServer
Throws:
BpelEngineException

setScheduler

public void setScheduler(Scheduler scheduler)
                  throws BpelEngineException
Specified by:
setScheduler in interface BpelServer
Throws:
BpelEngineException

setCronScheduler

public void setCronScheduler(CronScheduler cronScheduler)
                      throws BpelEngineException
Throws:
BpelEngineException

setEndpointReferenceContext

public void setEndpointReferenceContext(EndpointReferenceContext eprContext)
                                 throws BpelEngineException
Specified by:
setEndpointReferenceContext in interface BpelServer
Throws:
BpelEngineException

setDaoConnectionFactory

public void setDaoConnectionFactory(BpelDAOConnectionFactory daoCF)
                             throws BpelEngineException
Set the DAO connection factory. The DAO is used by the BPEL engine to persist information about active processes.

Parameters:
daoCF - BpelDAOConnectionFactory implementation.
Throws:
BpelEngineException

setInMemDaoConnectionFactory

public void setInMemDaoConnectionFactory(BpelDAOConnectionFactory daoCF)

setBindingContext

public void setBindingContext(BindingContext bc)
Specified by:
setBindingContext in interface BpelServer

getDebugger

public DebuggerContext getDebugger(javax.xml.namespace.QName pid)
                            throws BpelEngineException
Specified by:
getDebugger in interface BpelServer
Throws:
BpelEngineException

hasActiveInstances

public boolean hasActiveInstances(javax.xml.namespace.QName pid)

setHydrationLazy

public void setHydrationLazy(boolean hydrationLazy)

setProcessThrottledMaximumSize

public void setProcessThrottledMaximumSize(long hydrationThrottledMaximumSize)

setProcessThrottledMaximumCount

public void setProcessThrottledMaximumCount(int hydrationThrottledMaximumCount)

setHydrationLazyMinimumSize

public void setHydrationLazyMinimumSize(int hydrationLazyMinimumSize)

setInstanceThrottledMaximumCount

public void setInstanceThrottledMaximumCount(int instanceThrottledMaximumCount)

getBpelDb

public BpelDatabase getBpelDb()

cleanupProcess

public void cleanupProcess(ProcessConf pconf)
                    throws BpelEngineException
Specified by:
cleanupProcess in interface BpelServer
Throws:
BpelEngineException

setMigrationTransactionTimeout

public void setMigrationTransactionTimeout(int migrationTransactionTimeout)

acquireTransactionLocks

public void acquireTransactionLocks()
Specified by:
acquireTransactionLocks in interface BpelServer

registerExtensionBundle

public void registerExtensionBundle(ExtensionBundleRuntime bundle)

unregisterExtensionBundle

public void unregisterExtensionBundle(java.lang.String nsURI)

registerExtensionCorrelationFilter

public void registerExtensionCorrelationFilter(ExtensionCorrelationFilter filter)

unregisterExtensionCorrelationFilter

public void unregisterExtensionCorrelationFilter(java.lang.String nsURI)


Copyright © 2015 WSO2. All Rights Reserved.