org.apache.ode.bpel.engine
Class BpelServerImpl

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

public class BpelServerImpl
extends java.lang.Object
implements org.apache.ode.bpel.iapi.BpelServer, org.apache.ode.bpel.iapi.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.


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 cleanupProcess(org.apache.ode.bpel.iapi.ProcessConf pconf)
           
protected  BpelEngineImpl createBpelEngineImpl(Contexts contexts)
           
protected  BpelProcess createBpelProcess(org.apache.ode.bpel.iapi.ProcessConf conf)
           
protected  boolean deleteProcessDAO(javax.xml.namespace.QName pid, boolean isInMemory)
           
 Contexts getContexts()
           
 org.apache.ode.bpel.iapi.DebuggerContext getDebugger(javax.xml.namespace.QName pid)
           
 org.apache.ode.bpel.iapi.BpelEngine getEngine()
           
 boolean hasActiveInstances(javax.xml.namespace.QName pid)
           
 void init()
           
 void onScheduledJob(org.apache.ode.bpel.iapi.Scheduler.JobInfo jobInfo)
           
 void register(org.apache.ode.bpel.iapi.ProcessConf conf)
           
 void registerBpelEventListener(org.apache.ode.bpel.iapi.BpelEventListener listener)
          Register a global listener to receive BpelEvents froom all processes.
 void registerExternalVariableEngine(org.apache.ode.bpel.evar.ExternalVariableModule eve)
           
 void registerMessageExchangeInterceptor(MessageExchangeInterceptor interceptor)
          Register a global message exchange interceptor.
 void setBindingContext(org.apache.ode.bpel.iapi.BindingContext bc)
           
 void setConfigProperties(java.util.Properties configProperties)
           
 void setCronScheduler(CronScheduler cronScheduler)
           
 void setDaoConnectionFactory(org.apache.ode.bpel.dao.BpelDAOConnectionFactory daoCF)
          Set the DAO connection factory.
 void setDehydrationPolicy(DehydrationPolicy dehydrationPolicy)
           
 void setEndpointReferenceContext(org.apache.ode.bpel.iapi.EndpointReferenceContext eprContext)
           
 void setHydrationLazy(boolean hydrationLazy)
           
 void setHydrationLazyMinimumSize(int hydrationLazyMinimumSize)
           
 void setInMemDaoConnectionFactory(org.apache.ode.bpel.dao.BpelDAOConnectionFactory daoCF)
           
 void setInstanceThrottledMaximumCount(int instanceThrottledMaximumCount)
           
 void setMessageExchangeContext(org.apache.ode.bpel.iapi.MessageExchangeContext mexContext)
           
 void setMigrationTransactionTimeout(int migrationTransactionTimeout)
           
 void setProcessThrottledMaximumCount(int hydrationThrottledMaximumCount)
           
 void setProcessThrottledMaximumSize(long hydrationThrottledMaximumSize)
           
 void setScheduler(org.apache.ode.bpel.iapi.Scheduler scheduler)
           
 void shutdown()
           
 void start()
           
 void stop()
           
 void unregister(javax.xml.namespace.QName pid)
           
 void unregisterBpelEventListener(org.apache.ode.bpel.iapi.BpelEventListener listener)
          Unregister a global listener from receive BpelEvents from all processes.
 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

getContexts

public Contexts getContexts()

start

public void start()
Specified by:
start in interface org.apache.ode.bpel.iapi.BpelServer

registerExternalVariableEngine

public void registerExternalVariableEngine(org.apache.ode.bpel.evar.ExternalVariableModule eve)

registerBpelEventListener

public void registerBpelEventListener(org.apache.ode.bpel.iapi.BpelEventListener listener)
Register a global listener to receive BpelEvents froom all processes.

Parameters:
listener -

unregisterBpelEventListener

public void unregisterBpelEventListener(org.apache.ode.bpel.iapi.BpelEventListener listener)
Unregister a global listener from receive BpelEvents from all processes.

Parameters:
listener -

stop

public void stop()
Specified by:
stop in interface org.apache.ode.bpel.iapi.BpelServer

init

public void init()
          throws org.apache.ode.bpel.iapi.BpelEngineException
Specified by:
init in interface org.apache.ode.bpel.iapi.BpelServer
Throws:
org.apache.ode.bpel.iapi.BpelEngineException

createBpelEngineImpl

protected BpelEngineImpl createBpelEngineImpl(Contexts contexts)

shutdown

public void shutdown()
              throws org.apache.ode.bpel.iapi.BpelEngineException
Specified by:
shutdown in interface org.apache.ode.bpel.iapi.BpelServer
Throws:
org.apache.ode.bpel.iapi.BpelEngineException

getEngine

public org.apache.ode.bpel.iapi.BpelEngine getEngine()
Specified by:
getEngine in interface org.apache.ode.bpel.iapi.BpelServer

register

public void register(org.apache.ode.bpel.iapi.ProcessConf conf)
Specified by:
register in interface org.apache.ode.bpel.iapi.BpelServer

createBpelProcess

protected BpelProcess createBpelProcess(org.apache.ode.bpel.iapi.ProcessConf conf)

unregister

public void unregister(javax.xml.namespace.QName pid)
                throws org.apache.ode.bpel.iapi.BpelEngineException
Specified by:
unregister in interface org.apache.ode.bpel.iapi.BpelServer
Throws:
org.apache.ode.bpel.iapi.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(org.apache.ode.bpel.iapi.Scheduler.JobInfo jobInfo)
                    throws org.apache.ode.bpel.iapi.Scheduler.JobProcessorException
Specified by:
onScheduledJob in interface org.apache.ode.bpel.iapi.Scheduler.JobProcessor
Throws:
org.apache.ode.bpel.iapi.Scheduler.JobProcessorException

setDehydrationPolicy

public void setDehydrationPolicy(DehydrationPolicy dehydrationPolicy)

setConfigProperties

public void setConfigProperties(java.util.Properties configProperties)

setMessageExchangeContext

public void setMessageExchangeContext(org.apache.ode.bpel.iapi.MessageExchangeContext mexContext)
                               throws org.apache.ode.bpel.iapi.BpelEngineException
Specified by:
setMessageExchangeContext in interface org.apache.ode.bpel.iapi.BpelServer
Throws:
org.apache.ode.bpel.iapi.BpelEngineException

setScheduler

public void setScheduler(org.apache.ode.bpel.iapi.Scheduler scheduler)
                  throws org.apache.ode.bpel.iapi.BpelEngineException
Specified by:
setScheduler in interface org.apache.ode.bpel.iapi.BpelServer
Throws:
org.apache.ode.bpel.iapi.BpelEngineException

setCronScheduler

public void setCronScheduler(CronScheduler cronScheduler)
                      throws org.apache.ode.bpel.iapi.BpelEngineException
Throws:
org.apache.ode.bpel.iapi.BpelEngineException

setEndpointReferenceContext

public void setEndpointReferenceContext(org.apache.ode.bpel.iapi.EndpointReferenceContext eprContext)
                                 throws org.apache.ode.bpel.iapi.BpelEngineException
Specified by:
setEndpointReferenceContext in interface org.apache.ode.bpel.iapi.BpelServer
Throws:
org.apache.ode.bpel.iapi.BpelEngineException

setDaoConnectionFactory

public void setDaoConnectionFactory(org.apache.ode.bpel.dao.BpelDAOConnectionFactory daoCF)
                             throws org.apache.ode.bpel.iapi.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:
org.apache.ode.bpel.iapi.BpelEngineException

setInMemDaoConnectionFactory

public void setInMemDaoConnectionFactory(org.apache.ode.bpel.dao.BpelDAOConnectionFactory daoCF)

setBindingContext

public void setBindingContext(org.apache.ode.bpel.iapi.BindingContext bc)
Specified by:
setBindingContext in interface org.apache.ode.bpel.iapi.BpelServer

getDebugger

public org.apache.ode.bpel.iapi.DebuggerContext getDebugger(javax.xml.namespace.QName pid)
                                                     throws org.apache.ode.bpel.iapi.BpelEngineException
Specified by:
getDebugger in interface org.apache.ode.bpel.iapi.BpelServer
Throws:
org.apache.ode.bpel.iapi.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)

cleanupProcess

public void cleanupProcess(org.apache.ode.bpel.iapi.ProcessConf pconf)
                    throws org.apache.ode.bpel.iapi.BpelEngineException
Specified by:
cleanupProcess in interface org.apache.ode.bpel.iapi.BpelServer
Throws:
org.apache.ode.bpel.iapi.BpelEngineException

setMigrationTransactionTimeout

public void setMigrationTransactionTimeout(int migrationTransactionTimeout)