org.ofbiz.service
Class GenericAbstractDispatcher

java.lang.Object
  extended by org.ofbiz.service.GenericAbstractDispatcher
All Implemented Interfaces:
LocalDispatcher
Direct Known Subclasses:
GenericDispatcher

public abstract class GenericAbstractDispatcher
extends java.lang.Object
implements LocalDispatcher

Generic Services Local Dispatcher


Field Summary
protected  DispatchContext ctx
           
protected  ServiceDispatcher dispatcher
           
static java.lang.String module
           
protected  java.lang.String name
           
 
Constructor Summary
GenericAbstractDispatcher()
           
 
Method Summary
 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 the ServiceXaWrapper
 void 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 the ServiceXaWrapper
 void deregister()
          De-Registers this LocalDispatcher with the ServiceDispatcher
 GenericDelegator getDelegator()
          Gets the GenericEntityDelegator associated with this dispatcher
 DispatchContext getDispatchContext()
          Returns the DispatchContext created by this dispatcher
 JmsListenerFactory getJMSListeneFactory()
          Gets the JmsListenerFactory which holds the message listeners.
 JobManager getJobManager()
          Gets the JobManager associated with this dispatcher
 java.lang.String getName()
          Returns the Name of this local dispatcher
 Security getSecurity()
          Gets the Security object associated with this dispatcher
 void 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 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.
 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 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 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.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
Constructor Detail

GenericAbstractDispatcher

public GenericAbstractDispatcher()
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 interface LocalDispatcher
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 expire
maxRetry - 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 interface LocalDispatcher
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 interface LocalDispatcher
Parameters:
jobName - Name of the job
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 expire
maxRetry - 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 interface LocalDispatcher
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 the ServiceXaWrapper

Specified by:
addRollbackService in interface LocalDispatcher
Throws:
GenericServiceException
See Also:
org.ofbiz.service.LocalDispatcher#setRollbackService(java.lang.String, java.util.Map, boolean)

addRollbackService

public void addRollbackService(java.lang.String serviceName,
                               boolean persist,
                               java.lang.Object... context)
                        throws GenericServiceException
Specified by:
addRollbackService in interface LocalDispatcher
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 the ServiceXaWrapper

Specified by:
addCommitService in interface LocalDispatcher
Throws:
GenericServiceException
See Also:
org.ofbiz.service.LocalDispatcher#setCommitService(java.lang.String, java.util.Map, boolean)

addCommitService

public void addCommitService(java.lang.String serviceName,
                             boolean persist,
                             java.lang.Object... context)
                      throws GenericServiceException
Specified by:
addCommitService in interface LocalDispatcher
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 interface LocalDispatcher
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 interface LocalDispatcher
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 interface LocalDispatcher
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 interface LocalDispatcher
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 interface LocalDispatcher
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 interface LocalDispatcher
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 interface LocalDispatcher
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 interface LocalDispatcher
Throws:
GenericServiceException

getJobManager

public JobManager getJobManager()
Description copied from interface: LocalDispatcher
Gets the JobManager associated with this dispatcher

Specified by:
getJobManager in interface LocalDispatcher
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 interface LocalDispatcher
Returns:
JmsListenerFactory
See Also:
LocalDispatcher.getJMSListeneFactory()

getDelegator

public GenericDelegator getDelegator()
Description copied from interface: LocalDispatcher
Gets the GenericEntityDelegator associated with this dispatcher

Specified by:
getDelegator in interface LocalDispatcher
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 interface LocalDispatcher
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 interface LocalDispatcher
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 interface LocalDispatcher
Returns:
DispatchContext created by this dispatcher
See Also:
LocalDispatcher.getDispatchContext()

deregister

public void deregister()
Description copied from interface: LocalDispatcher
De-Registers this LocalDispatcher with the ServiceDispatcher

Specified by:
deregister in interface LocalDispatcher
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 interface LocalDispatcher
Parameters:
serviceName - Name of the service to link callback to.
cb - The callback implementation.
See Also:
LocalDispatcher.registerCallback(String, GenericServiceCallback)