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.


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(ProcessConf pconf)
           
protected  BpelEngineImpl createBpelEngineImpl(Contexts contexts)
           
protected  BpelProcess createBpelProcess(ProcessConf conf)
           
protected  boolean deleteProcessDAO(javax.xml.namespace.QName pid, boolean isInMemory)
           
 Contexts getContexts()
           
 DebuggerContext getDebugger(javax.xml.namespace.QName pid)
           
 BpelEngine getEngine()
          Get the BpelEngine interface for handling transaction operations.
 boolean hasActiveInstances(javax.xml.namespace.QName pid)
           
 void init()
          Initialize the BPEL engine.
 void onScheduledJob(Scheduler.JobInfo jobInfo)
          Implements execution of the job.
 void register(ProcessConf conf)
          Register a process with the server.
 void registerBpelEventListener(BpelEventListener listener)
          Register a global listener to receive BpelEvents froom all processes.
 void registerExternalVariableEngine(ExternalVariableModule eve)
           
 void registerMessageExchangeInterceptor(MessageExchangeInterceptor interceptor)
          Register a global message exchange interceptor.
 void setBindingContext(BindingContext bc)
          Configure the with a binding context.
 void setConfigProperties(java.util.Properties configProperties)
           
 void setDaoConnectionFactory(BpelDAOConnectionFactory daoCF)
          Set the DAO connection factory.
 void setDehydrationPolicy(DehydrationPolicy dehydrationPolicy)
           
 void setEndpointReferenceContext(EndpointReferenceContext eprContext)
          Configure the with an endpoint-reference (EPR) context.
 void setHydrationLazy(boolean hydrationLazy)
           
 void setHydrationLazyMinimumSize(int hydrationLazyMinimumSize)
           
 void setInMemDaoConnectionFactory(BpelDAOConnectionFactory daoCF)
           
 void setInstanceThrottledMaximumCount(int instanceThrottledMaximumCount)
           
 void setMessageExchangeContext(MessageExchangeContext mexContext)
          Configure the with a message-exchange context.
 void setProcessThrottledMaximumCount(int hydrationThrottledMaximumCount)
           
 void setProcessThrottledMaximumSize(long hydrationThrottledMaximumSize)
           
 void setScheduler(Scheduler scheduler)
          Configure the with a scheduler.
 void shutdown()
          Called to shutdown the BPEL egnine.
 void start()
          Start the BPEL engine.
 void stop()
          Stop the BPEL engine: results in the cessation of process execution.
 void unregister(javax.xml.namespace.QName pid)
          Unregister a process from the server.
 void unregisterBpelEventListener(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()
Description copied from interface: BpelServer
Start the BPEL engine. The BPEL engine will not execute process instances until it is started.

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()
Description copied from interface: BpelServer
Stop the BPEL engine: results in the cessation of process execution.

Specified by:
stop in interface BpelServer

init

public void init()
          throws BpelEngineException
Description copied from interface: BpelServer
Initialize the BPEL engine. The various contexts needed by the engine must be configured before this method is called.

Specified by:
init in interface BpelServer
Throws:
BpelEngineException

createBpelEngineImpl

protected BpelEngineImpl createBpelEngineImpl(Contexts contexts)

shutdown

public void shutdown()
              throws BpelEngineException
Description copied from interface: BpelServer
Called to shutdown the BPEL egnine.

Specified by:
shutdown in interface BpelServer
Throws:
BpelEngineException

getEngine

public BpelEngine getEngine()
Description copied from interface: BpelServer
Get the BpelEngine interface for handling transaction operations.

Specified by:
getEngine in interface BpelServer
Returns:
transactional BpelEngine interfacce

register

public void register(ProcessConf conf)
Description copied from interface: BpelServer
Register a process with the server.

Specified by:
register in interface BpelServer

createBpelProcess

protected BpelProcess createBpelProcess(ProcessConf conf)

unregister

public void unregister(javax.xml.namespace.QName pid)
                throws BpelEngineException
Description copied from interface: BpelServer
Unregister a process from the server.

Specified by:
unregister in interface BpelServer
Parameters:
pid - process to unregister
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
Description copied from interface: Scheduler.JobProcessor
Implements execution of the job.

Specified by:
onScheduledJob in interface Scheduler.JobProcessor
Parameters:
jobInfo - the job information
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
Description copied from interface: BpelServer
Configure the with a message-exchange context. BPEL engine uses this context to initiate communication with external services.

Specified by:
setMessageExchangeContext in interface BpelServer
Parameters:
mexContext - MessageExchangeContext implementation
Throws:
BpelEngineException
See Also:
MessageExchangeContext

setScheduler

public void setScheduler(Scheduler scheduler)
                  throws BpelEngineException
Description copied from interface: BpelServer
Configure the with a scheduler.

Specified by:
setScheduler in interface BpelServer
Throws:
BpelEngineException

setEndpointReferenceContext

public void setEndpointReferenceContext(EndpointReferenceContext eprContext)
                                 throws BpelEngineException
Description copied from interface: BpelServer
Configure the with an endpoint-reference (EPR) context. BPEL engine uses this context to EPRs.

Specified by:
setEndpointReferenceContext in interface BpelServer
Parameters:
eprContext - EndpointReferenceContext implementation
Throws:
BpelEngineException
See Also:
EndpointReferenceContext

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)
Description copied from interface: BpelServer
Configure the with a binding context. The BPEL engine uses this context to register the services that it exposes and obtain communication links to partner services.

Specified by:
setBindingContext in interface BpelServer
Parameters:
bc - BindingContext implementation
See Also:
BindingContext

getDebugger

public DebuggerContext getDebugger(javax.xml.namespace.QName pid)
                            throws BpelEngineException
Specified by:
getDebugger in interface BpelServer
Parameters:
pid - The process definition QName
Returns:
The debugger support.
Throws:
BpelEngineException - if we could not find the process

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(ProcessConf pconf)
                    throws BpelEngineException
Specified by:
cleanupProcess in interface BpelServer
Throws:
BpelEngineException