org.ofbiz.service.rmi
Class RemoteDispatcherImpl

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by org.ofbiz.service.rmi.RemoteDispatcherImpl
All Implemented Interfaces:
java.io.Serializable, java.rmi.Remote, RemoteDispatcher

public class RemoteDispatcherImpl
extends java.rmi.server.UnicastRemoteObject
implements RemoteDispatcher

Generic Services Remote Dispatcher Implementation

See Also:
Serialized Form

Field Summary
protected  LocalDispatcher dispatcher
           
static java.lang.String module
           
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
RemoteDispatcherImpl(LocalDispatcher dispatcher, java.rmi.server.RMIClientSocketFactory csf, java.rmi.server.RMIServerSocketFactory ssf)
           
 
Method Summary
protected  void checkExportFlag(java.lang.String serviceName)
           
 void deregister()
           
 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, 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, 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, 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.
 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.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

module

public static final java.lang.String module

dispatcher

protected LocalDispatcher dispatcher
Constructor Detail

RemoteDispatcherImpl

public RemoteDispatcherImpl(LocalDispatcher dispatcher,
                            java.rmi.server.RMIClientSocketFactory csf,
                            java.rmi.server.RMIServerSocketFactory ssf)
                     throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException
Method Detail

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 GenericServiceException,
                                                                java.rmi.RemoteException
Description copied from interface: RemoteDispatcher
Run the service synchronously and return the result.

Specified by:
runSync in interface RemoteDispatcher
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
java.rmi.RemoteException

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 GenericServiceException,
                                                                java.rmi.RemoteException
Description copied from interface: RemoteDispatcher
Run the service synchronously with a specified timeout and return the result.

Specified by:
runSync in interface RemoteDispatcher
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
java.rmi.RemoteException

runSyncIgnore

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

Specified by:
runSyncIgnore in interface RemoteDispatcher
Parameters:
serviceName - Name of the service to run.
context - Map of name, value pairs composing the context.
Throws:
GenericServiceException
java.rmi.RemoteException

runSyncIgnore

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

Specified by:
runSyncIgnore in interface RemoteDispatcher
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
java.rmi.RemoteException

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 GenericServiceException,
                     java.rmi.RemoteException
Description copied from interface: RemoteDispatcher
Run the service asynchronously, passing an instance of GenericRequester that will receive the result.

Specified by:
runAsync in interface RemoteDispatcher
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
java.rmi.RemoteException

runAsync

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

Specified by:
runAsync in interface RemoteDispatcher
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
java.rmi.RemoteException

runAsync

public void runAsync(java.lang.String serviceName,
                     java.util.Map<java.lang.String,? extends java.lang.Object> context,
                     GenericRequester requester)
              throws GenericServiceException,
                     java.rmi.RemoteException
Description 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 interface RemoteDispatcher
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
java.rmi.RemoteException

runAsync

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

Specified by:
runAsync in interface RemoteDispatcher
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
java.rmi.RemoteException

runAsync

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

Specified by:
runAsync in interface RemoteDispatcher
Parameters:
serviceName - Name of the service to run.
context - Map of name, value pairs composing the context.
Throws:
GenericServiceException
java.rmi.RemoteException

runAsyncWait

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

Specified by:
runAsyncWait in interface RemoteDispatcher
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
java.rmi.RemoteException

runAsyncWait

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

Specified by:
runAsyncWait in interface RemoteDispatcher
Parameters:
serviceName - Name of the service to run.
context - Map of name, value pairs composing the context.
Returns:
A new GenericRequester object.
Throws:
GenericServiceException
java.rmi.RemoteException

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,
                     java.rmi.RemoteException
Description copied from interface: RemoteDispatcher
Schedule a service to run asynchronously at a specific start time.

Specified by:
schedule in interface RemoteDispatcher
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
java.rmi.RemoteException

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,
                     java.rmi.RemoteException
Description copied from interface: RemoteDispatcher
Schedule a service to run asynchronously at a specific start time.

Specified by:
schedule in interface RemoteDispatcher
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
java.rmi.RemoteException

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,
                     java.rmi.RemoteException
Description copied from interface: RemoteDispatcher
Schedule a service to run asynchronously at a specific start time.

Specified by:
schedule in interface RemoteDispatcher
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
java.rmi.RemoteException

schedule

public void schedule(java.lang.String serviceName,
                     java.util.Map<java.lang.String,? extends java.lang.Object> context,
                     long startTime)
              throws GenericServiceException,
                     java.rmi.RemoteException
Description copied from interface: RemoteDispatcher
Schedule a service to run asynchronously at a specific start time.

Specified by:
schedule in interface RemoteDispatcher
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
java.rmi.RemoteException

deregister

public void deregister()

checkExportFlag

protected void checkExportFlag(java.lang.String serviceName)
                        throws GenericServiceException
Throws:
GenericServiceException