Package org.apache.ofbiz.service
Class GenericAbstractDispatcher
- java.lang.Object
-
- org.apache.ofbiz.service.GenericAbstractDispatcher
-
- All Implemented Interfaces:
LocalDispatcher
public abstract class GenericAbstractDispatcher extends java.lang.Object implements LocalDispatcher
Generic Services Local Dispatcher
-
-
Field Summary
Fields Modifier and Type Field Description protected DispatchContext
ctx
protected ServiceDispatcher
dispatcher
static java.lang.String
module
protected java.lang.String
name
-
Constructor Summary
Constructors Constructor Description GenericAbstractDispatcher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCommitService(java.lang.String serviceName, boolean persist, java.lang.Object... context)
void
addCommitService(java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> context, boolean persist)
Adds a commit service to the current TX using ServiceSynchronizationvoid
addRollbackService(java.lang.String serviceName, boolean persist, java.lang.Object... context)
void
addRollbackService(java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> context, boolean persist)
Adds a rollback service to the current TX using ServiceSynchronizationvoid
deregister()
De-Registers this LocalDispatcherDelegator
getDelegator()
Gets the GenericEntityDelegator associated with this dispatcherDispatchContext
getDispatchContext()
Returns the DispatchContext created by this dispatcherJmsListenerFactory
getJMSListeneFactory()
Gets the JmsListenerFactory which holds the message listeners.JobManager
getJobManager()
Gets the JobManager associated with this dispatcherjava.lang.String
getName()
Returns the Name of this local dispatcherSecurity
getSecurity()
Gets the Security object associated with this dispatchervoid
registerCallback(java.lang.String serviceName, GenericServiceCallback cb)
Register a callback listener on a specific service.void
schedule(java.lang.String serviceName, long startTime, int frequency, int interval, int count, long endTime, java.lang.Object... context)
void
schedule(java.lang.String serviceName, long startTime, int frequency, int interval, int count, java.lang.Object... context)
void
schedule(java.lang.String serviceName, long startTime, int frequency, int interval, long endTime, java.lang.Object... context)
void
schedule(java.lang.String serviceName, long startTime, java.lang.Object... context)
void
schedule(java.lang.String poolName, java.lang.String serviceName, long startTime, int frequency, int interval, int count, long endTime, int maxRetry, java.lang.Object... context)
void
schedule(java.lang.String jobName, java.lang.String poolName, java.lang.String serviceName, long startTime, int frequency, int interval, int count, long endTime, int maxRetry, java.lang.Object... context)
void
schedule(java.lang.String jobName, java.lang.String poolName, java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> context, long startTime, int frequency, int interval, int count, long endTime, int maxRetry)
Schedule a service to run asynchronously at a specific start time.void
schedule(java.lang.String poolName, java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> context, long startTime, int frequency, int interval, int count, long endTime, int maxRetry)
Schedule a service to run asynchronously at a specific start time.void
schedule(java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> context, long startTime)
Schedule a service to run asynchronously at a specific start time.void
schedule(java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> context, long startTime, int frequency, int interval, int count)
Schedule a service to run asynchronously at a specific start time.void
schedule(java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> context, long startTime, int frequency, int interval, int count, long endTime)
Schedule a service to run asynchronously at a specific start time.void
schedule(java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> context, long startTime, int frequency, int interval, long endTime)
Schedule a service to run asynchronously at a specific start time.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.ofbiz.service.LocalDispatcher
disableEcas, enableEcas, isEcasDisabled, runAsync, runAsync, runAsync, runAsync, runAsync, runAsync, runAsync, runAsync, runAsync, runAsyncWait, runAsyncWait, runAsyncWait, runSync, runSync, runSync, runSyncIgnore, runSyncIgnore, runSyncIgnore
-
-
-
-
Field Detail
-
module
public static final java.lang.String module
-
ctx
protected DispatchContext ctx
-
dispatcher
protected ServiceDispatcher dispatcher
-
name
protected java.lang.String name
-
-
Method Detail
-
schedule
public void schedule(java.lang.String poolName, java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> context, long startTime, int frequency, int interval, int count, long endTime, int maxRetry) throws GenericServiceException
Description copied from interface:LocalDispatcher
Schedule a service to run asynchronously at a specific start time.- Specified by:
schedule
in interfaceLocalDispatcher
- Parameters:
poolName
- Name of the service pool to send to.serviceName
- Name of the service to invoke.context
- The name/value pairs composing the context.startTime
- The time to run this service.frequency
- The frequency of the recurrence (RecurrenceRule.DAILY, etc).interval
- The interval of the frequency recurrence.count
- The number of times to repeat.endTime
- The time in milliseconds the service should expiremaxRetry
- The number of times we should retry on failure- Throws:
ServiceAuthException
ServiceValidationException
GenericServiceException
- See Also:
LocalDispatcher.schedule(java.lang.String, java.lang.String, java.util.Map, long, int, int, int, long, int)
-
schedule
public void schedule(java.lang.String poolName, java.lang.String serviceName, long startTime, int frequency, int interval, int count, long endTime, int maxRetry, java.lang.Object... context) throws GenericServiceException
- Specified by:
schedule
in interfaceLocalDispatcher
- Throws:
GenericServiceException
-
schedule
public void schedule(java.lang.String jobName, java.lang.String poolName, java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> context, long startTime, int frequency, int interval, int count, long endTime, int maxRetry) throws GenericServiceException
Description copied from interface:LocalDispatcher
Schedule a service to run asynchronously at a specific start time.- Specified by:
schedule
in interfaceLocalDispatcher
- Parameters:
jobName
- Name of the jobpoolName
- Name of the service pool to send to.serviceName
- Name of the service to invoke.context
- The name/value pairs composing the context.startTime
- The time to run this service.frequency
- The frequency of the recurrence (RecurrenceRule.DAILY, etc).interval
- The interval of the frequency recurrence.count
- The number of times to repeat.endTime
- The time in milliseconds the service should expiremaxRetry
- The number of times we should retry on failure- Throws:
ServiceAuthException
ServiceValidationException
GenericServiceException
- See Also:
LocalDispatcher.schedule(java.lang.String, java.lang.String, java.lang.String, java.util.Map, long, int, int, int, long, int)
-
schedule
public void schedule(java.lang.String jobName, java.lang.String poolName, java.lang.String serviceName, long startTime, int frequency, int interval, int count, long endTime, int maxRetry, java.lang.Object... context) throws GenericServiceException
- Specified by:
schedule
in interfaceLocalDispatcher
- Throws:
GenericServiceException
-
addRollbackService
public void addRollbackService(java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> context, boolean persist) throws GenericServiceException
Description copied from interface:LocalDispatcher
Adds a rollback service to the current TX using ServiceSynchronization- Specified by:
addRollbackService
in interfaceLocalDispatcher
- Throws:
GenericServiceException
-
addRollbackService
public void addRollbackService(java.lang.String serviceName, boolean persist, java.lang.Object... context) throws GenericServiceException
- Specified by:
addRollbackService
in interfaceLocalDispatcher
- Throws:
GenericServiceException
-
addCommitService
public void addCommitService(java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> context, boolean persist) throws GenericServiceException
Description copied from interface:LocalDispatcher
Adds a commit service to the current TX using ServiceSynchronization- Specified by:
addCommitService
in interfaceLocalDispatcher
- Throws:
GenericServiceException
-
addCommitService
public void addCommitService(java.lang.String serviceName, boolean persist, java.lang.Object... context) throws GenericServiceException
- Specified by:
addCommitService
in interfaceLocalDispatcher
- Throws:
GenericServiceException
-
schedule
public void schedule(java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> context, long startTime, int frequency, int interval, int count, long endTime) throws GenericServiceException
Description copied from interface:LocalDispatcher
Schedule a service to run asynchronously at a specific start time.- Specified by:
schedule
in interfaceLocalDispatcher
- Parameters:
serviceName
- Name of the service to invoke.context
- The name/value pairs composing the context.startTime
- The time to run this service.frequency
- The frequency of the recurrence (RecurrenceRule.DAILY, etc).interval
- The interval of the frequency recurrence.count
- The number of times to repeat.endTime
- The time in milliseconds the service should expire- Throws:
GenericServiceException
- See Also:
LocalDispatcher.schedule(java.lang.String, java.util.Map, long, int, int, int, long)
-
schedule
public void schedule(java.lang.String serviceName, long startTime, int frequency, int interval, int count, long endTime, java.lang.Object... context) throws GenericServiceException
- Specified by:
schedule
in interfaceLocalDispatcher
- Throws:
GenericServiceException
-
schedule
public void schedule(java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> context, long startTime, int frequency, int interval, int count) throws GenericServiceException
Description copied from interface:LocalDispatcher
Schedule a service to run asynchronously at a specific start time.- Specified by:
schedule
in interfaceLocalDispatcher
- Parameters:
serviceName
- Name of the service to invoke.context
- The name/value pairs composing the context.startTime
- The time to run this service.frequency
- The frequency of the recurrence (RecurrenceRule.DAILY, etc).interval
- The interval of the frequency recurrence.count
- The number of times to repeat.- Throws:
GenericServiceException
- See Also:
LocalDispatcher.schedule(java.lang.String, java.util.Map, long, int, int, int)
-
schedule
public void schedule(java.lang.String serviceName, long startTime, int frequency, int interval, int count, java.lang.Object... context) throws GenericServiceException
- Specified by:
schedule
in interfaceLocalDispatcher
- Throws:
GenericServiceException
-
schedule
public void schedule(java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> context, long startTime, int frequency, int interval, long endTime) throws GenericServiceException
Description copied from interface:LocalDispatcher
Schedule a service to run asynchronously at a specific start time.- Specified by:
schedule
in interfaceLocalDispatcher
- Parameters:
serviceName
- Name of the service to invoke.context
- The name/value pairs composing the context.startTime
- The time to run this service.frequency
- The frequency of the recurrence (RecurrenceRule.DAILY, etc).interval
- The interval of the frequency recurrence.endTime
- The time in milliseconds the service should expire- Throws:
GenericServiceException
- See Also:
LocalDispatcher.schedule(java.lang.String, java.util.Map, long, int, int, long)
-
schedule
public void schedule(java.lang.String serviceName, long startTime, int frequency, int interval, long endTime, java.lang.Object... context) throws GenericServiceException
- Specified by:
schedule
in interfaceLocalDispatcher
- Throws:
GenericServiceException
-
schedule
public void schedule(java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> context, long startTime) throws GenericServiceException
Description copied from interface:LocalDispatcher
Schedule a service to run asynchronously at a specific start time.- Specified by:
schedule
in interfaceLocalDispatcher
- Parameters:
serviceName
- Name of the service to invoke.context
- The name/value pairs composing the context.startTime
- The time to run this service.- Throws:
GenericServiceException
- See Also:
LocalDispatcher.schedule(java.lang.String, java.util.Map, long)
-
schedule
public void schedule(java.lang.String serviceName, long startTime, java.lang.Object... context) throws GenericServiceException
- Specified by:
schedule
in interfaceLocalDispatcher
- Throws:
GenericServiceException
-
getJobManager
public JobManager getJobManager()
Description copied from interface:LocalDispatcher
Gets the JobManager associated with this dispatcher- Specified by:
getJobManager
in interfaceLocalDispatcher
- Returns:
- JobManager that is associated with this dispatcher
- See Also:
LocalDispatcher.getJobManager()
-
getJMSListeneFactory
public JmsListenerFactory getJMSListeneFactory()
Description copied from interface:LocalDispatcher
Gets the JmsListenerFactory which holds the message listeners.- Specified by:
getJMSListeneFactory
in interfaceLocalDispatcher
- Returns:
- JmsListenerFactory
- See Also:
LocalDispatcher.getJMSListeneFactory()
-
getDelegator
public Delegator getDelegator()
Description copied from interface:LocalDispatcher
Gets the GenericEntityDelegator associated with this dispatcher- Specified by:
getDelegator
in interfaceLocalDispatcher
- Returns:
- GenericEntityDelegator associated with this dispatcher
- See Also:
LocalDispatcher.getDelegator()
-
getSecurity
public Security getSecurity()
Description copied from interface:LocalDispatcher
Gets the Security object associated with this dispatcher- Specified by:
getSecurity
in interfaceLocalDispatcher
- Returns:
- Security object associated with this dispatcher
- See Also:
LocalDispatcher.getSecurity()
-
getName
public java.lang.String getName()
Description copied from interface:LocalDispatcher
Returns the Name of this local dispatcher- Specified by:
getName
in interfaceLocalDispatcher
- Returns:
- String representing the name of this local dispatcher
- See Also:
LocalDispatcher.getName()
-
getDispatchContext
public DispatchContext getDispatchContext()
Description copied from interface:LocalDispatcher
Returns the DispatchContext created by this dispatcher- Specified by:
getDispatchContext
in interfaceLocalDispatcher
- Returns:
- DispatchContext created by this dispatcher
- See Also:
LocalDispatcher.getDispatchContext()
-
deregister
public void deregister()
Description copied from interface:LocalDispatcher
De-Registers this LocalDispatcher- Specified by:
deregister
in interfaceLocalDispatcher
- See Also:
LocalDispatcher.deregister()
-
registerCallback
public void registerCallback(java.lang.String serviceName, GenericServiceCallback cb)
Description copied from interface:LocalDispatcher
Register a callback listener on a specific service.- Specified by:
registerCallback
in interfaceLocalDispatcher
- Parameters:
serviceName
- Name of the service to link callback to.cb
- The callback implementation.- See Also:
LocalDispatcher.registerCallback(String, GenericServiceCallback)
-
-