Package org.apache.ofbiz.service.rmi
Class RemoteDispatcherImpl
java.lang.Object
java.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
org.apache.ofbiz.service.rmi.RemoteDispatcherImpl
- All Implemented Interfaces:
Serializable
,Remote
,RemoteDispatcher
Generic Services Remote Dispatcher Implementation
- See Also:
-
Field Summary
Fields inherited from class java.rmi.server.RemoteObject
ref
-
Constructor Summary
ConstructorDescriptionRemoteDispatcherImpl
(LocalDispatcher dispatcher, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkExportFlag
(String serviceName) Check export flag.void
Deregister.void
Run the service asynchronously and IGNORE the result.void
Run the service asynchronously and IGNORE the result.void
Run the service asynchronously, passing an instance of GenericRequester that will receive the result.void
runAsync
(String serviceName, Map<String, ? extends Object> context, GenericRequester requester, boolean persist) Run the service asynchronously, passing an instance of GenericRequester that will receive the result.void
runAsync
(String serviceName, Map<String, ? extends Object> context, GenericRequester requester, boolean persist, int transactionTimeout, boolean requireNewTransaction) Run the service asynchronously, passing an instance of GenericRequester that will receive the result.runAsyncWait
(String serviceName, Map<String, ? extends Object> context) Run the service asynchronously.runAsyncWait
(String serviceName, Map<String, ? extends Object> context, boolean persist) Run the service asynchronously.Run the service synchronously and return the result.runSync
(String serviceName, Map<String, ? extends Object> context, int transactionTimeout, boolean requireNewTransaction) Run the service synchronously with a specified timeout and return the result.void
runSyncIgnore
(String serviceName, Map<String, ? extends Object> context) Run the service synchronously and IGNORE the result.void
runSyncIgnore
(String serviceName, Map<String, ? extends Object> context, int transactionTimeout, boolean requireNewTransaction) Run the service synchronously with a specified timeout and IGNORE the result.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.Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, exportObject, exportObject, unexportObject
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
-
Constructor Details
-
RemoteDispatcherImpl
public RemoteDispatcherImpl(LocalDispatcher dispatcher, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) throws RemoteException - Throws:
RemoteException
-
-
Method Details
-
runSync
public Map<String,Object> runSync(String serviceName, Map<String, ? extends Object> context) throws GenericServiceException, RemoteExceptionDescription copied from interface:RemoteDispatcher
Run the service synchronously and return the result.- Specified by:
runSync
in interfaceRemoteDispatcher
- 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:
GenericServiceException
RemoteException
-
runSync
public Map<String,Object> runSync(String serviceName, Map<String, ? extends Object> context, int transactionTimeout, boolean requireNewTransaction) throws GenericServiceException, RemoteExceptionDescription copied from interface:RemoteDispatcher
Run the service synchronously with a specified timeout and return the result.- Specified by:
runSync
in interfaceRemoteDispatcher
- 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:
GenericServiceException
RemoteException
-
runSyncIgnore
public void runSyncIgnore(String serviceName, Map<String, ? extends Object> context) throws GenericServiceException, RemoteExceptionDescription copied from interface:RemoteDispatcher
Run the service synchronously and IGNORE the result.- Specified by:
runSyncIgnore
in interfaceRemoteDispatcher
- Parameters:
serviceName
- Name of the service to run.context
- Map of name, value pairs composing the context.- Throws:
GenericServiceException
RemoteException
-
runSyncIgnore
public void runSyncIgnore(String serviceName, Map<String, ? extends Object> context, int transactionTimeout, boolean requireNewTransaction) throws GenericServiceException, RemoteExceptionDescription copied from interface:RemoteDispatcher
Run the service synchronously with a specified timeout and IGNORE the result.- Specified by:
runSyncIgnore
in interfaceRemoteDispatcher
- 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:
GenericServiceException
RemoteException
-
runAsync
public void runAsync(String serviceName, Map<String, ? extends Object> context, GenericRequester requester, boolean persist, int transactionTimeout, boolean requireNewTransaction) throws GenericServiceException, RemoteExceptionDescription copied from interface:RemoteDispatcher
Run the service asynchronously, passing an instance of GenericRequester that will receive the result.- Specified by:
runAsync
in interfaceRemoteDispatcher
- 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:
GenericServiceException
RemoteException
-
runAsync
public void runAsync(String serviceName, Map<String, ? extends Object> context, GenericRequester requester, boolean persist) throws GenericServiceException, RemoteExceptionDescription copied from interface:RemoteDispatcher
Run the service asynchronously, passing an instance of GenericRequester that will receive the result.- Specified by:
runAsync
in interfaceRemoteDispatcher
- 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:
GenericServiceException
RemoteException
-
runAsync
public void runAsync(String serviceName, Map<String, ? extends Object> context, GenericRequester requester) throws GenericServiceException, RemoteExceptionDescription copied from interface:RemoteDispatcher
Run the service asynchronously, passing an instance of GenericRequester that will receive the result. This method WILL persist the job.- Specified by:
runAsync
in interfaceRemoteDispatcher
- 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:
GenericServiceException
RemoteException
-
runAsync
public void runAsync(String serviceName, Map<String, ? extends Object> context, boolean persist) throws GenericServiceException, RemoteExceptionDescription copied from interface:RemoteDispatcher
Run the service asynchronously and IGNORE the result.- Specified by:
runAsync
in interfaceRemoteDispatcher
- 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:
GenericServiceException
RemoteException
-
runAsync
public void runAsync(String serviceName, Map<String, ? extends Object> context) throws GenericServiceException, RemoteExceptionDescription copied from interface:RemoteDispatcher
Run the service asynchronously and IGNORE the result. This method WILL persist the job.- Specified by:
runAsync
in interfaceRemoteDispatcher
- Parameters:
serviceName
- Name of the service to run.context
- Map of name, value pairs composing the context.- Throws:
GenericServiceException
RemoteException
-
runAsyncWait
public GenericResultWaiter runAsyncWait(String serviceName, Map<String, ? extends Object> context, boolean persist) throws GenericServiceException, RemoteExceptionDescription copied from interface:RemoteDispatcher
Run the service asynchronously.- Specified by:
runAsyncWait
in interfaceRemoteDispatcher
- 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:
GenericServiceException
RemoteException
-
runAsyncWait
public GenericResultWaiter runAsyncWait(String serviceName, Map<String, ? extends Object> context) throws GenericServiceException, RemoteExceptionDescription copied from interface:RemoteDispatcher
Run the service asynchronously. This method WILL persist the job.- Specified by:
runAsyncWait
in interfaceRemoteDispatcher
- Parameters:
serviceName
- Name of the service to run.context
- Map of name, value pairs composing the context.- Returns:
- A new GenericRequester object.
- Throws:
GenericServiceException
RemoteException
-
schedule
public void schedule(String serviceName, Map<String, ? extends Object> context, long startTime, int frequency, int interval, int count, long endTime) throws GenericServiceException, RemoteExceptionDescription copied from interface:RemoteDispatcher
Schedule a service to run asynchronously at a specific start time.- Specified by:
schedule
in interfaceRemoteDispatcher
- 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
RemoteException
-
schedule
public void schedule(String serviceName, Map<String, ? extends Object> context, long startTime, int frequency, int interval, int count) throws GenericServiceException, RemoteExceptionDescription copied from interface:RemoteDispatcher
Schedule a service to run asynchronously at a specific start time.- Specified by:
schedule
in interfaceRemoteDispatcher
- 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
RemoteException
-
schedule
public void schedule(String serviceName, Map<String, ? extends Object> context, long startTime, int frequency, int interval, long endTime) throws GenericServiceException, RemoteExceptionDescription copied from interface:RemoteDispatcher
Schedule a service to run asynchronously at a specific start time.- Specified by:
schedule
in interfaceRemoteDispatcher
- 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
RemoteException
-
schedule
public void schedule(String serviceName, Map<String, ? extends Object> context, long startTime) throws GenericServiceException, RemoteExceptionDescription copied from interface:RemoteDispatcher
Schedule a service to run asynchronously at a specific start time.- Specified by:
schedule
in interfaceRemoteDispatcher
- 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
RemoteException
-
deregister
public void deregister()Deregister. -
checkExportFlag
Check export flag.- Parameters:
serviceName
- the service name- Throws:
GenericServiceException
- the generic service exception
-