Package org.apache.ofbiz.service
Class GenericAbstractDispatcher
java.lang.Object
org.apache.ofbiz.service.GenericAbstractDispatcher
- All Implemented Interfaces:
LocalDispatcher
Generic Services Local Dispatcher
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCommitService
(String serviceName, boolean persist, Object... context) void
addCommitService
(String serviceName, Map<String, ? extends Object> context, boolean persist) Adds a commit service to the current TX using ServiceSynchronizationvoid
addRollbackService
(String serviceName, boolean persist, Object... context) void
addRollbackService
(String serviceName, Map<String, ? extends Object> context, boolean persist) Adds a rollback service to the current TX using ServiceSynchronizationvoid
De-Registers this LocalDispatchergetCtx()
Gets ctx.Gets the GenericEntityDelegator associated with this dispatcherReturns the DispatchContext created by this dispatcherGets dispatcher.Gets the JmsListenerFactory which holds the message listeners.Gets the JobManager associated with this dispatchergetName()
Returns the Name of this local dispatcherGets the Security object associated with this dispatchervoid
registerCallback
(String serviceName, GenericServiceCallback cb) Register a callback listener on a specific service.void
schedule
(String serviceName, long startTime, int frequency, int interval, int count, long endTime, Object... context) void
schedule
(String serviceName, long startTime, int frequency, int interval, int count, Object... context) void
schedule
(String serviceName, long startTime, int frequency, int interval, long endTime, Object... context) void
void
schedule
(String poolName, String serviceName, long startTime, int frequency, int interval, int count, long endTime, int maxRetry, Object... context) void
schedule
(String jobName, String poolName, String serviceName, long startTime, int frequency, int interval, int count, long endTime, int maxRetry, Object... context) void
schedule
(String jobName, String poolName, String serviceName, Map<String, ? extends 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
(String poolName, String serviceName, Map<String, ? extends 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 a service to run asynchronously at a specific start time.void
schedule
(String serviceName, Map<String, ? extends Object> context, long startTime, int frequency, int interval, int count) Schedule a service to run asynchronously at a specific start time.void
schedule
(String serviceName, Map<String, ? extends 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
(String serviceName, Map<String, ? extends Object> context, long startTime, int frequency, int interval, long endTime) Schedule a service to run asynchronously at a specific start time.void
setCtx
(DispatchContext ctx) Sets ctx.void
setDispatcher
(ServiceDispatcher dispatcher) Sets dispatcher.void
Sets name.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
-
Constructor Details
-
GenericAbstractDispatcher
public GenericAbstractDispatcher()
-
-
Method Details
-
getCtx
Gets ctx.- Returns:
- the ctx
-
setCtx
Sets ctx.- Parameters:
ctx
- the ctx
-
getDispatcher
Gets dispatcher.- Returns:
- the dispatcher
-
setDispatcher
Sets dispatcher.- Parameters:
dispatcher
- the dispatcher
-
setName
Sets name.- Parameters:
name
- the name
-
schedule
public void schedule(String poolName, String serviceName, Map<String, ? extends Object> context, long startTime, int frequency, int interval, int count, long endTime, int maxRetry) throws GenericServiceExceptionDescription 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
-
schedule
public void schedule(String poolName, String serviceName, long startTime, int frequency, int interval, int count, long endTime, int maxRetry, Object... context) throws GenericServiceException - Specified by:
schedule
in interfaceLocalDispatcher
- Throws:
GenericServiceException
-
schedule
public void schedule(String jobName, String poolName, String serviceName, Map<String, ? extends Object> context, long startTime, int frequency, int interval, int count, long endTime, int maxRetry) throws GenericServiceExceptionDescription 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
-
schedule
public void schedule(String jobName, String poolName, String serviceName, long startTime, int frequency, int interval, int count, long endTime, int maxRetry, Object... context) throws GenericServiceException - Specified by:
schedule
in interfaceLocalDispatcher
- Throws:
GenericServiceException
-
addRollbackService
public void addRollbackService(String serviceName, Map<String, ? extends Object> context, boolean persist) throws GenericServiceExceptionDescription 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(String serviceName, boolean persist, Object... context) throws GenericServiceException - Specified by:
addRollbackService
in interfaceLocalDispatcher
- Throws:
GenericServiceException
-
addCommitService
public void addCommitService(String serviceName, Map<String, ? extends Object> context, boolean persist) throws GenericServiceExceptionDescription 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(String serviceName, boolean persist, Object... context) throws GenericServiceException - Specified by:
addCommitService
in interfaceLocalDispatcher
- Throws:
GenericServiceException
-
schedule
public void schedule(String serviceName, Map<String, ? extends Object> context, long startTime, int frequency, int interval, int count, long endTime) throws GenericServiceExceptionDescription 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
-
schedule
public void schedule(String serviceName, long startTime, int frequency, int interval, int count, long endTime, Object... context) throws GenericServiceException - Specified by:
schedule
in interfaceLocalDispatcher
- Throws:
GenericServiceException
-
schedule
public void schedule(String serviceName, Map<String, ? extends Object> context, long startTime, int frequency, int interval, int count) throws GenericServiceExceptionDescription 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
-
schedule
public void schedule(String serviceName, long startTime, int frequency, int interval, int count, Object... context) throws GenericServiceException - Specified by:
schedule
in interfaceLocalDispatcher
- Throws:
GenericServiceException
-
schedule
public void schedule(String serviceName, Map<String, ? extends Object> context, long startTime, int frequency, int interval, long endTime) throws GenericServiceExceptionDescription 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
-
schedule
public void schedule(String serviceName, long startTime, int frequency, int interval, long endTime, Object... context) throws GenericServiceException - Specified by:
schedule
in interfaceLocalDispatcher
- Throws:
GenericServiceException
-
schedule
public void schedule(String serviceName, Map<String, ? extends Object> context, long startTime) throws GenericServiceExceptionDescription 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
-
schedule
public void schedule(String serviceName, long startTime, Object... context) throws GenericServiceException - Specified by:
schedule
in interfaceLocalDispatcher
- Throws:
GenericServiceException
-
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
-
getJMSListeneFactory
Description copied from interface:LocalDispatcher
Gets the JmsListenerFactory which holds the message listeners.- Specified by:
getJMSListeneFactory
in interfaceLocalDispatcher
- Returns:
- JmsListenerFactory
-
getDelegator
Description copied from interface:LocalDispatcher
Gets the GenericEntityDelegator associated with this dispatcher- Specified by:
getDelegator
in interfaceLocalDispatcher
- Returns:
- GenericEntityDelegator associated with this dispatcher
-
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
-
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
-
getDispatchContext
Description copied from interface:LocalDispatcher
Returns the DispatchContext created by this dispatcher- Specified by:
getDispatchContext
in interfaceLocalDispatcher
- Returns:
- DispatchContext created by this dispatcher
-
deregister
public void deregister()Description copied from interface:LocalDispatcher
De-Registers this LocalDispatcher- Specified by:
deregister
in interfaceLocalDispatcher
-
registerCallback
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.
-