|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ofbiz.service.ServiceDispatcher
public class ServiceDispatcher
Global Service Dispatcher
| Field Summary | |
|---|---|
protected java.util.Map<java.lang.String,java.util.List<GenericServiceCallback>> |
callbacks
|
protected GenericDelegator |
delegator
|
protected static java.util.Map<java.lang.String,ServiceDispatcher> |
dispatchers
|
protected static boolean |
enableJM
|
protected static boolean |
enableJMS
|
protected static boolean |
enableSvcs
|
protected GenericEngineFactory |
factory
|
protected JmsListenerFactory |
jlf
|
protected JobManager |
jm
|
protected java.util.Map<java.lang.String,DispatchContext> |
localContext
|
static int |
LOCK_RETRIES
|
static int |
lruLogSize
|
static java.lang.String |
module
|
protected static java.util.Map<RunningService,ServiceDispatcher> |
runLog
|
protected Security |
security
|
| Constructor Summary | |
|---|---|
protected |
ServiceDispatcher(GenericDelegator delegator)
|
protected |
ServiceDispatcher(GenericDelegator delegator,
boolean enableJM,
boolean enableJMS,
boolean enableSvcs)
|
| Method Summary | |
|---|---|
boolean |
containsContext(java.lang.String name)
Test if this dispatcher instance contains the local context. |
void |
deregister(LocalDispatcher local)
De-Registers the loader with this ServiceDispatcher |
static void |
enableJM(boolean enable)
Enabled/Disables the Job Manager/Scheduler globally (this will not effect any dispatchers already running) |
static void |
enableJMS(boolean enable)
Enabled/Disables the JMS listeners globally (this will not effect any dispatchers already running) |
static void |
enableSvcs(boolean enable)
Enabled/Disables the startup services globally (this will not effect any dispatchers already running) |
java.util.List<GenericServiceCallback> |
getCallbacks(java.lang.String serviceName)
|
GenericDelegator |
getDelegator()
Gets the GenericDelegator associated with this dispatcher |
GenericEngine |
getGenericEngine(java.lang.String engineName)
Gets the GenericEngine instance that corresponds to the given name |
static ServiceDispatcher |
getInstance(java.lang.String name,
DispatchContext context,
GenericDelegator delegator)
Returns an instance of the ServiceDispatcher associated with this delegator and registers the loader. |
static ServiceDispatcher |
getInstance(java.lang.String name,
GenericDelegator delegator)
Returns a pre-registered instance of the ServiceDispatcher associated with this delegator. |
JmsListenerFactory |
getJMSListenerFactory()
Gets the JmsListenerFactory which holds the message listeners. |
JobManager |
getJobManager()
Gets the JobManager associated with this dispatcher |
DispatchContext |
getLocalContext(java.lang.String name)
Gets the local context from a name |
LocalDispatcher |
getLocalDispatcher(java.lang.String name)
Gets the local dispatcher from a name |
Security |
getSecurity()
Gets the Security object associated with this dispatcher |
static java.util.Map<RunningService,ServiceDispatcher> |
getServiceLogMap()
|
void |
register(java.lang.String name,
DispatchContext context)
Registers the loader with this ServiceDispatcher |
void |
registerCallback(java.lang.String serviceName,
GenericServiceCallback cb)
|
void |
runAsync(java.lang.String localName,
ModelService service,
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 localName,
ModelService service,
java.util.Map<java.lang.String,? extends java.lang.Object> params,
GenericRequester requester,
boolean persist)
Run the service asynchronously, passing an instance of GenericRequester that will receive the result. |
java.util.Map<java.lang.String,java.lang.Object> |
runSync(java.lang.String localName,
ModelService service,
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 localName,
ModelService modelService,
java.util.Map<java.lang.String,? extends java.lang.Object> params,
boolean validateOut)
Run the service synchronously and return the result. |
void |
runSyncIgnore(java.lang.String localName,
ModelService service,
java.util.Map<java.lang.String,? extends java.lang.Object> context)
Run the service synchronously and IGNORE the result. |
protected void |
shutdown()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String module
public static final int lruLogSize
public static final int LOCK_RETRIES
protected static final java.util.Map<RunningService,ServiceDispatcher> runLog
protected static java.util.Map<java.lang.String,ServiceDispatcher> dispatchers
protected static boolean enableJM
protected static boolean enableJMS
protected static boolean enableSvcs
protected GenericDelegator delegator
protected GenericEngineFactory factory
protected Security security
protected java.util.Map<java.lang.String,DispatchContext> localContext
protected java.util.Map<java.lang.String,java.util.List<GenericServiceCallback>> callbacks
protected JobManager jm
protected JmsListenerFactory jlf
| Constructor Detail |
|---|
protected ServiceDispatcher(GenericDelegator delegator,
boolean enableJM,
boolean enableJMS,
boolean enableSvcs)
protected ServiceDispatcher(GenericDelegator delegator)
| Method Detail |
|---|
public static ServiceDispatcher getInstance(java.lang.String name,
GenericDelegator delegator)
delegator - the local delegator
public static ServiceDispatcher getInstance(java.lang.String name,
DispatchContext context,
GenericDelegator delegator)
name - the local dispatchercontext - the context of the local dispatcherdelegator - the local delegator
public void register(java.lang.String name,
DispatchContext context)
name - the local dispatchercontext - the context of the local dispatcherpublic void deregister(LocalDispatcher local)
local - the LocalDispatcher to de-register
public void registerCallback(java.lang.String serviceName,
GenericServiceCallback cb)
public java.util.List<GenericServiceCallback> getCallbacks(java.lang.String serviceName)
public java.util.Map<java.lang.String,java.lang.Object> runSync(java.lang.String localName,
ModelService service,
java.util.Map<java.lang.String,? extends java.lang.Object> context)
throws ServiceAuthException,
ServiceValidationException,
GenericServiceException
localName - Name of the context to use.service - Service model object.context - Map of name, value pairs composing the context.
ServiceAuthException
ServiceValidationException
GenericServiceException
public void runSyncIgnore(java.lang.String localName,
ModelService service,
java.util.Map<java.lang.String,? extends java.lang.Object> context)
throws ServiceAuthException,
ServiceValidationException,
GenericServiceException
localName - Name of the context to use.service - Service model object.context - Map of name, value pairs composing the context.
ServiceAuthException
ServiceValidationException
GenericServiceException
public java.util.Map<java.lang.String,java.lang.Object> runSync(java.lang.String localName,
ModelService modelService,
java.util.Map<java.lang.String,? extends java.lang.Object> params,
boolean validateOut)
throws ServiceAuthException,
ServiceValidationException,
GenericServiceException
localName - Name of the context to use.modelService - Service model object.context - Map of name, value pairs composing the context.validateOut - Validate OUT parameters
ServiceAuthException
ServiceValidationException
GenericServiceException
public void runAsync(java.lang.String localName,
ModelService service,
java.util.Map<java.lang.String,? extends java.lang.Object> params,
GenericRequester requester,
boolean persist)
throws ServiceAuthException,
ServiceValidationException,
GenericServiceException
localName - Name of the context to use.service - Service model object.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.
ServiceAuthException
ServiceValidationException
GenericServiceException
public void runAsync(java.lang.String localName,
ModelService service,
java.util.Map<java.lang.String,? extends java.lang.Object> context,
boolean persist)
throws ServiceAuthException,
ServiceValidationException,
GenericServiceException
localName - Name of the context to use.service - Service model object.context - Map of name, value pairs composing the context.persist - True for store/run; False for run.
ServiceAuthException
ServiceValidationException
GenericServiceException
public GenericEngine getGenericEngine(java.lang.String engineName)
throws GenericServiceException
engineName - Name of the engine
GenericServiceExceptionpublic JobManager getJobManager()
public JmsListenerFactory getJMSListenerFactory()
public GenericDelegator getDelegator()
public Security getSecurity()
public DispatchContext getLocalContext(java.lang.String name)
name - of the context to find.public LocalDispatcher getLocalDispatcher(java.lang.String name)
name - of the LocalDispatcher to find.
public boolean containsContext(java.lang.String name)
name - of the local context
protected void shutdown()
throws GenericServiceException
GenericServiceExceptionpublic static void enableJM(boolean enable)
enable - public static void enableJMS(boolean enable)
enable - public static void enableSvcs(boolean enable)
enable - public static java.util.Map<RunningService,ServiceDispatcher> getServiceLogMap()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||