org.ofbiz.service
Class GenericDispatcher

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

public class GenericDispatcher
extends GenericAbstractDispatcher

Generic Services Local Dispatcher


Field Summary
protected static java.util.Map<java.lang.String,LocalDispatcher> dispatcherCache
           
protected static boolean ecasDisabled
           
static java.lang.String module
           
 
Fields inherited from class org.ofbiz.service.GenericAbstractDispatcher
ctx, dispatcher, name
 
Constructor Summary
protected GenericDispatcher()
           
protected GenericDispatcher(java.lang.String name, GenericDelegator delegator, java.util.Collection<java.net.URL> readerURLs, java.lang.ClassLoader loader, ServiceDispatcher serviceDispatcher)
           
 
Method Summary
 void disableEcas()
          Disables running of Service Engine Condition Actions (SECAs).
 void enableEcas()
          Reenables running of Service Engine Condition Actions (SECAs).
static java.util.Set<java.lang.String> getAllDispatcherNames()
           
static LocalDispatcher getLocalDispatcher(java.lang.String dispatcherName, GenericDelegator delegator)
           
static LocalDispatcher getLocalDispatcher(java.lang.String dispatcherName, GenericDelegator delegator, java.util.Collection<java.net.URL> readerURLs, java.lang.ClassLoader loader)
           
static LocalDispatcher getLocalDispatcher(java.lang.String dispatcherName, GenericDelegator delegator, java.util.Collection<java.net.URL> readerURLs, java.lang.ClassLoader loader, ServiceDispatcher serviceDispatcher)
           
protected  void init(java.lang.String name, GenericDelegator delegator, DispatchContext ctx)
           
 boolean isEcasDisabled()
          Returns whether Service Engine Condition Actions (SECAs) are disabled or not.
static LocalDispatcher newInstance(java.lang.String name, GenericDelegator delegator, boolean enableJM, boolean enableJMS, boolean enableSvcs)
          special method to obtain a new 'unique' reference with a variation on parameters
static LocalDispatcher newInstance(java.lang.String name, GenericDelegator delegator, java.util.Collection<java.net.URL> readerURLs, boolean enableJM, boolean enableJMS, boolean enableSvcs)
           
 void runAsync(java.lang.String serviceName, boolean persist, java.lang.Object... context)
           
 void runAsync(java.lang.String serviceName, GenericRequester requester, boolean persist, int transactionTimeout, boolean requireNewTransaction, java.lang.Object... context)
           
 void runAsync(java.lang.String serviceName, GenericRequester requester, boolean persist, java.lang.Object... context)
           
 void runAsync(java.lang.String serviceName, GenericRequester requester, java.lang.Object... context)
           
 void runAsync(java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> context)
          Run the service asynchronously and IGNORE the result.
 void runAsync(java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> context, boolean persist)
          Run the service asynchronously and IGNORE the result.
 void runAsync(java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> context, GenericRequester requester)
          Run the service asynchronously, passing an instance of GenericRequester that will receive the result.
 void runAsync(java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> context, GenericRequester requester, boolean persist)
          Run the service asynchronously, passing an instance of GenericRequester that will receive the result.
 void runAsync(java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> context, GenericRequester requester, boolean persist, int transactionTimeout, boolean requireNewTransaction)
          Run the service asynchronously, passing an instance of GenericRequester that will receive the result.
 GenericResultWaiter runAsyncWait(java.lang.String serviceName, boolean persist, java.lang.Object... context)
           
 GenericResultWaiter runAsyncWait(java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> context)
          Run the service asynchronously.
 GenericResultWaiter runAsyncWait(java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> context, boolean persist)
          Run the service asynchronously.
 java.util.Map<java.lang.String,java.lang.Object> runSync(java.lang.String serviceName, int transactionTimeout, boolean requireNewTransaction, java.lang.Object... context)
           
 java.util.Map<java.lang.String,java.lang.Object> runSync(java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> context)
          Run the service synchronously and return the result.
 java.util.Map<java.lang.String,java.lang.Object> runSync(java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> context, int transactionTimeout, boolean requireNewTransaction)
          Run the service synchronously with a specified timeout and return the result.
 void runSyncIgnore(java.lang.String serviceName, int transactionTimeout, boolean requireNewTransaction, java.lang.Object... context)
           
 void runSyncIgnore(java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> context)
          Run the service synchronously and IGNORE the result.
 void runSyncIgnore(java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> context, int transactionTimeout, boolean requireNewTransaction)
          Run the service synchronously with a specified timeout and IGNORE the result.
 
Methods inherited from class org.ofbiz.service.GenericAbstractDispatcher
addCommitService, addCommitService, addRollbackService, addRollbackService, deregister, getDelegator, getDispatchContext, getJMSListeneFactory, getJobManager, getName, getSecurity, registerCallback, schedule, schedule, schedule, schedule, schedule, schedule, schedule, schedule, schedule, schedule, schedule, schedule
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

module

public static final java.lang.String module

ecasDisabled

protected static boolean ecasDisabled

dispatcherCache

protected static java.util.Map<java.lang.String,LocalDispatcher> dispatcherCache
Constructor Detail

GenericDispatcher

protected GenericDispatcher()

GenericDispatcher

protected GenericDispatcher(java.lang.String name,
                            GenericDelegator delegator,
                            java.util.Collection<java.net.URL> readerURLs,
                            java.lang.ClassLoader loader,
                            ServiceDispatcher serviceDispatcher)
Method Detail

getLocalDispatcher

public static LocalDispatcher getLocalDispatcher(java.lang.String dispatcherName,
                                                 GenericDelegator delegator)

getLocalDispatcher

public static LocalDispatcher getLocalDispatcher(java.lang.String dispatcherName,
                                                 GenericDelegator delegator,
                                                 java.util.Collection<java.net.URL> readerURLs,
                                                 java.lang.ClassLoader loader)

getLocalDispatcher

public static LocalDispatcher getLocalDispatcher(java.lang.String dispatcherName,
                                                 GenericDelegator delegator,
                                                 java.util.Collection<java.net.URL> readerURLs,
                                                 java.lang.ClassLoader loader,
                                                 ServiceDispatcher serviceDispatcher)

newInstance

public static LocalDispatcher newInstance(java.lang.String name,
                                          GenericDelegator delegator,
                                          boolean enableJM,
                                          boolean enableJMS,
                                          boolean enableSvcs)
                                   throws GenericServiceException
special method to obtain a new 'unique' reference with a variation on parameters

Throws:
GenericServiceException

newInstance

public static LocalDispatcher newInstance(java.lang.String name,
                                          GenericDelegator delegator,
                                          java.util.Collection<java.net.URL> readerURLs,
                                          boolean enableJM,
                                          boolean enableJMS,
                                          boolean enableSvcs)
                                   throws GenericServiceException
Throws:
GenericServiceException

getAllDispatcherNames

public static java.util.Set<java.lang.String> getAllDispatcherNames()

init

protected void init(java.lang.String name,
                    GenericDelegator delegator,
                    DispatchContext ctx)

disableEcas

public void disableEcas()
Description copied from interface: LocalDispatcher
Disables running of Service Engine Condition Actions (SECAs). Intended to be turned off temporarily.


enableEcas

public void enableEcas()
Description copied from interface: LocalDispatcher
Reenables running of Service Engine Condition Actions (SECAs).


isEcasDisabled

public boolean isEcasDisabled()
Description copied from interface: LocalDispatcher
Returns whether Service Engine Condition Actions (SECAs) are disabled or not.

Returns:

runSync

public java.util.Map<java.lang.String,java.lang.Object> runSync(java.lang.String serviceName,
                                                                java.util.Map<java.lang.String,? extends java.lang.Object> context)
                                                         throws ServiceValidationException,
                                                                GenericServiceException
Description copied from interface: LocalDispatcher
Run the service synchronously and return the result.

Parameters:
serviceName - Name of the service to run.
context - Map of name, value pairs composing the context.
Returns:
Map of name, value pairs composing the result.
Throws:
ServiceValidationException
ServiceAuthException
GenericServiceException
See Also:
LocalDispatcher.runSync(java.lang.String, java.util.Map)

runSync

public java.util.Map<java.lang.String,java.lang.Object> runSync(java.lang.String serviceName,
                                                                java.util.Map<java.lang.String,? extends java.lang.Object> context,
                                                                int transactionTimeout,
                                                                boolean requireNewTransaction)
                                                         throws ServiceAuthException,
                                                                ServiceValidationException,
                                                                GenericServiceException
Description copied from interface: LocalDispatcher
Run the service synchronously with a specified timeout and return the result.

Parameters:
serviceName - Name of the service to run.
context - Map of name, value pairs composing the context.
transactionTimeout - the overriding timeout for the transaction (if we started it).
requireNewTransaction - if true we will suspend and create a new transaction so we are sure to start.
Returns:
Map of name, value pairs composing the result.
Throws:
ServiceAuthException
ServiceValidationException
GenericServiceException
See Also:
LocalDispatcher.runSync(java.lang.String, java.util.Map, int, boolean)

runSync

public java.util.Map<java.lang.String,java.lang.Object> runSync(java.lang.String serviceName,
                                                                int transactionTimeout,
                                                                boolean requireNewTransaction,
                                                                java.lang.Object... context)
                                                         throws ServiceAuthException,
                                                                ServiceValidationException,
                                                                GenericServiceException
Throws:
ServiceAuthException
ServiceValidationException
GenericServiceException

runSyncIgnore

public void runSyncIgnore(java.lang.String serviceName,
                          java.util.Map<java.lang.String,? extends java.lang.Object> context)
                   throws GenericServiceException
Description copied from interface: LocalDispatcher
Run the service synchronously and IGNORE the result.

Parameters:
serviceName - Name of the service to run.
context - Map of name, value pairs composing the context.
Throws:
ServiceAuthException
ServiceValidationException
GenericServiceException
See Also:
LocalDispatcher.runSyncIgnore(java.lang.String, java.util.Map)

runSyncIgnore

public void runSyncIgnore(java.lang.String serviceName,
                          java.util.Map<java.lang.String,? extends java.lang.Object> context,
                          int transactionTimeout,
                          boolean requireNewTransaction)
                   throws ServiceAuthException,
                          ServiceValidationException,
                          GenericServiceException
Description copied from interface: LocalDispatcher
Run the service synchronously with a specified timeout and IGNORE the result.

Parameters:
serviceName - Name of the service to run.
context - Map of name, value pairs composing the context.
transactionTimeout - the overriding timeout for the transaction (if we started it).
requireNewTransaction - if true we will suspend and create a new transaction so we are sure to start.
Throws:
ServiceAuthException
ServiceValidationException
GenericServiceException
See Also:
LocalDispatcher.runSyncIgnore(java.lang.String, java.util.Map)

runSyncIgnore

public void runSyncIgnore(java.lang.String serviceName,
                          int transactionTimeout,
                          boolean requireNewTransaction,
                          java.lang.Object... context)
                   throws ServiceAuthException,
                          ServiceValidationException,
                          GenericServiceException
Throws:
ServiceAuthException
ServiceValidationException
GenericServiceException

runAsync

public void runAsync(java.lang.String serviceName,
                     java.util.Map<java.lang.String,? extends java.lang.Object> context,
                     GenericRequester requester,
                     boolean persist,
                     int transactionTimeout,
                     boolean requireNewTransaction)
              throws ServiceAuthException,
                     ServiceValidationException,
                     GenericServiceException
Description copied from interface: LocalDispatcher
Run the service asynchronously, passing an instance of GenericRequester that will receive the result.

Parameters:
serviceName - Name of the service to run.
context - Map of name, value pairs composing the context.
requester - Object implementing GenericRequester interface which will receive the result.
persist - True for store/run; False for run.
transactionTimeout - the overriding timeout for the transaction (if we started it).
requireNewTransaction - if true we will suspend and create a new transaction so we are sure to start.
Throws:
ServiceAuthException
ServiceValidationException
GenericServiceException
See Also:
LocalDispatcher.runAsync(java.lang.String, java.util.Map, org.ofbiz.service.GenericRequester, boolean, int, boolean)

runAsync

public void runAsync(java.lang.String serviceName,
                     GenericRequester requester,
                     boolean persist,
                     int transactionTimeout,
                     boolean requireNewTransaction,
                     java.lang.Object... context)
              throws ServiceAuthException,
                     ServiceValidationException,
                     GenericServiceException
Throws:
ServiceAuthException
ServiceValidationException
GenericServiceException

runAsync

public void runAsync(java.lang.String serviceName,
                     java.util.Map<java.lang.String,? extends java.lang.Object> context,
                     GenericRequester requester,
                     boolean persist)
              throws ServiceAuthException,
                     ServiceValidationException,
                     GenericServiceException
Description copied from interface: LocalDispatcher
Run the service asynchronously, passing an instance of GenericRequester that will receive the result.

Parameters:
serviceName - Name of the service to run.
context - Map of name, value pairs composing the context.
requester - Object implementing GenericRequester interface which will receive the result.
persist - True for store/run; False for run.
Throws:
ServiceAuthException
ServiceValidationException
GenericServiceException
See Also:
LocalDispatcher.runAsync(java.lang.String, java.util.Map, org.ofbiz.service.GenericRequester, boolean)

runAsync

public void runAsync(java.lang.String serviceName,
                     GenericRequester requester,
                     boolean persist,
                     java.lang.Object... context)
              throws ServiceAuthException,
                     ServiceValidationException,
                     GenericServiceException
Throws:
ServiceAuthException
ServiceValidationException
GenericServiceException

runAsync

public void runAsync(java.lang.String serviceName,
                     java.util.Map<java.lang.String,? extends java.lang.Object> context,
                     GenericRequester requester)
              throws ServiceAuthException,
                     ServiceValidationException,
                     GenericServiceException
Description copied from interface: LocalDispatcher
Run the service asynchronously, passing an instance of GenericRequester that will receive the result. This method WILL persist the job.

Parameters:
serviceName - Name of the service to run.
context - Map of name, value pairs composing the context.
requester - Object implementing GenericRequester interface which will receive the result.
Throws:
ServiceAuthException
ServiceValidationException
GenericServiceException
See Also:
LocalDispatcher.runAsync(java.lang.String, java.util.Map, org.ofbiz.service.GenericRequester)

runAsync

public void runAsync(java.lang.String serviceName,
                     GenericRequester requester,
                     java.lang.Object... context)
              throws ServiceAuthException,
                     ServiceValidationException,
                     GenericServiceException
Throws:
ServiceAuthException
ServiceValidationException
GenericServiceException

runAsync

public void runAsync(java.lang.String serviceName,
                     java.util.Map<java.lang.String,? extends java.lang.Object> context,
                     boolean persist)
              throws ServiceAuthException,
                     ServiceValidationException,
                     GenericServiceException
Description copied from interface: LocalDispatcher
Run the service asynchronously and IGNORE the result.

Parameters:
serviceName - Name of the service to run.
context - Map of name, value pairs composing the context.
persist - True for store/run; False for run.
Throws:
ServiceAuthException
ServiceValidationException
GenericServiceException
See Also:
LocalDispatcher.runAsync(java.lang.String, java.util.Map, boolean)

runAsync

public void runAsync(java.lang.String serviceName,
                     boolean persist,
                     java.lang.Object... context)
              throws ServiceAuthException,
                     ServiceValidationException,
                     GenericServiceException
Throws:
ServiceAuthException
ServiceValidationException
GenericServiceException

runAsync

public void runAsync(java.lang.String serviceName,
                     java.util.Map<java.lang.String,? extends java.lang.Object> context)
              throws ServiceAuthException,
                     ServiceValidationException,
                     GenericServiceException
Description copied from interface: LocalDispatcher
Run the service asynchronously and IGNORE the result. This method WILL persist the job.

Parameters:
serviceName - Name of the service to run.
context - Map of name, value pairs composing the context.
Throws:
ServiceAuthException
ServiceValidationException
GenericServiceException
See Also:
LocalDispatcher.runAsync(java.lang.String, java.util.Map)

runAsyncWait

public GenericResultWaiter runAsyncWait(java.lang.String serviceName,
                                        java.util.Map<java.lang.String,? extends java.lang.Object> context,
                                        boolean persist)
                                 throws ServiceAuthException,
                                        ServiceValidationException,
                                        GenericServiceException
Description copied from interface: LocalDispatcher
Run the service asynchronously.

Parameters:
serviceName - Name of the service to run.
context - Map of name, value pairs composing the context.
persist - True for store/run; False for run.
Returns:
A new GenericRequester object.
Throws:
ServiceAuthException
ServiceValidationException
GenericServiceException
See Also:
LocalDispatcher.runAsyncWait(java.lang.String, java.util.Map, boolean)

runAsyncWait

public GenericResultWaiter runAsyncWait(java.lang.String serviceName,
                                        boolean persist,
                                        java.lang.Object... context)
                                 throws ServiceAuthException,
                                        ServiceValidationException,
                                        GenericServiceException
Throws:
ServiceAuthException
ServiceValidationException
GenericServiceException

runAsyncWait

public GenericResultWaiter runAsyncWait(java.lang.String serviceName,
                                        java.util.Map<java.lang.String,? extends java.lang.Object> context)
                                 throws ServiceAuthException,
                                        ServiceValidationException,
                                        GenericServiceException
Description copied from interface: LocalDispatcher
Run the service asynchronously. This method WILL persist the job.

Parameters:
serviceName - Name of the service to run.
context - Map of name, value pairs composing the context.
Returns:
A new GenericRequester object.
Throws:
ServiceAuthException
ServiceValidationException
GenericServiceException
See Also:
LocalDispatcher.runAsyncWait(java.lang.String, java.util.Map)