KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ofbiz > service > rmi > RemoteDispatcher


1 /*
2  * $Id: RemoteDispatcher.java 5462 2005-08-05 18:35:48Z jonesde $
3  *
4  * Copyright (c) 2003 The Open For Business Project - www.ofbiz.org
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a
7  * copy of this software and associated documentation files (the "Software"),
8  * to deal in the Software without restriction, including without limitation
9  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  * and/or sell copies of the Software, and to permit persons to whom the
11  * Software is furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included
14  * in all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
21  * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
22  * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23  *
24  */

25 package org.ofbiz.service.rmi;
26
27 import java.util.Map JavaDoc;
28 import java.rmi.Remote JavaDoc;
29 import java.rmi.RemoteException JavaDoc;
30
31 import org.ofbiz.service.GenericRequester;
32 import org.ofbiz.service.GenericResultWaiter;
33 import org.ofbiz.service.GenericServiceException;
34
35 /**
36  * Generic Services Remote Dispatcher
37  *
38  * @author <a HREF="mailto:jaz@ofbiz.org">Andy Zeneski</a>
39  * @version $Rev: 5462 $
40  * @since 3.0
41  */

42 public interface RemoteDispatcher extends Remote JavaDoc {
43     
44     /**
45      * Run the service synchronously and return the result.
46      * @param serviceName Name of the service to run.
47      * @param context Map of name, value pairs composing the context.
48      * @return Map of name, value pairs composing the result.
49      * @throws GenericServiceException
50      * @throws RemoteException
51      */

52     public Map JavaDoc runSync(String JavaDoc serviceName, Map JavaDoc context) throws GenericServiceException, RemoteException JavaDoc;
53
54     /**
55      * Run the service synchronously with a specified timeout and return the result.
56      * @param serviceName Name of the service to run.
57      * @param context Map of name, value pairs composing the context.
58      * @param transactionTimeout the overriding timeout for the transaction (if we started it).
59      * @param requireNewTransaction if true we will suspend and create a new transaction so we are sure to start.
60      * @return Map of name, value pairs composing the result.
61      * @throws GenericServiceException
62      */

63     public Map JavaDoc runSync(String JavaDoc serviceName, Map JavaDoc context, int transactionTimeout, boolean requireNewTransaction) throws GenericServiceException, RemoteException JavaDoc;
64
65     /**
66      * Run the service synchronously and IGNORE the result.
67      * @param serviceName Name of the service to run.
68      * @param context Map of name, value pairs composing the context.
69      * @throws GenericServiceException
70      * @throws RemoteException
71      */

72     public void runSyncIgnore(String JavaDoc serviceName, Map JavaDoc context) throws GenericServiceException, RemoteException JavaDoc;
73
74     /**
75      * Run the service synchronously with a specified timeout and IGNORE the result.
76      * @param serviceName Name of the service to run.
77      * @param context Map of name, value pairs composing the context.
78      * @param transactionTimeout the overriding timeout for the transaction (if we started it).
79      * @param requireNewTransaction if true we will suspend and create a new transaction so we are sure to start.
80      * @throws GenericServiceException
81      */

82     public void runSyncIgnore(String JavaDoc serviceName, Map JavaDoc context, int transactionTimeout, boolean requireNewTransaction) throws GenericServiceException, RemoteException JavaDoc;
83
84     /**
85      * Run the service asynchronously, passing an instance of GenericRequester that will receive the result.
86      * @param serviceName Name of the service to run.
87      * @param context Map of name, value pairs composing the context.
88      * @param requester Object implementing GenericRequester interface which will receive the result.
89      * @param persist True for store/run; False for run.
90      * @param transactionTimeout the overriding timeout for the transaction (if we started it).
91      * @param requireNewTransaction if true we will suspend and create a new transaction so we are sure to start.
92      * @throws GenericServiceException
93      */

94     public void runAsync(String JavaDoc serviceName, Map JavaDoc context, GenericRequester requester, boolean persist, int transactionTimeout, boolean requireNewTransaction) throws GenericServiceException, RemoteException JavaDoc;
95
96     /**
97      * Run the service asynchronously, passing an instance of GenericRequester that will receive the result.
98      * @param serviceName Name of the service to run.
99      * @param context Map of name, value pairs composing the context.
100      * @param requester Object implementing GenericRequester interface which will receive the result.
101      * @param persist True for store/run; False for run.
102      * @throws GenericServiceException
103      * @throws RemoteException
104      */

105     public void runAsync(String JavaDoc serviceName, Map JavaDoc context, GenericRequester requester, boolean persist) throws GenericServiceException, RemoteException JavaDoc;
106
107     /**
108      * Run the service asynchronously, passing an instance of GenericRequester that will receive the result.
109      * This method WILL persist the job.
110      * @param serviceName Name of the service to run.
111      * @param context Map of name, value pairs composing the context.
112      * @param requester Object implementing GenericRequester interface which will receive the result.
113      * @throws GenericServiceException
114      * @throws RemoteException
115      */

116     public void runAsync(String JavaDoc serviceName, Map JavaDoc context, GenericRequester requester) throws GenericServiceException, RemoteException JavaDoc;
117
118     /**
119      * Run the service asynchronously and IGNORE the result.
120      * @param serviceName Name of the service to run.
121      * @param context Map of name, value pairs composing the context.
122      * @param persist True for store/run; False for run.
123      * @throws GenericServiceException
124      * @throws RemoteException
125      */

126     public void runAsync(String JavaDoc serviceName, Map JavaDoc context, boolean persist) throws GenericServiceException, RemoteException JavaDoc;
127
128     /**
129      * Run the service asynchronously and IGNORE the result. This method WILL persist the job.
130      * @param serviceName Name of the service to run.
131      * @param context Map of name, value pairs composing the context.
132      * @throws GenericServiceException
133      * @throws RemoteException
134      */

135     public void runAsync(String JavaDoc serviceName, Map JavaDoc context) throws GenericServiceException, RemoteException JavaDoc;
136
137     /**
138      * Run the service asynchronously.
139      * @param serviceName Name of the service to run.
140      * @param context Map of name, value pairs composing the context.
141      * @param persist True for store/run; False for run.
142      * @return A new GenericRequester object.
143      * @throws GenericServiceException
144      * @throws RemoteException
145      */

146     public GenericResultWaiter runAsyncWait(String JavaDoc serviceName, Map JavaDoc context, boolean persist) throws GenericServiceException, RemoteException JavaDoc;
147
148     /**
149      * Run the service asynchronously. This method WILL persist the job.
150      * @param serviceName Name of the service to run.
151      * @param context Map of name, value pairs composing the context.
152      * @return A new GenericRequester object.
153      * @throws GenericServiceException
154      * @throws RemoteException
155      */

156     public GenericResultWaiter runAsyncWait(String JavaDoc serviceName, Map JavaDoc context) throws GenericServiceException, RemoteException JavaDoc;
157
158     /**
159      * Schedule a service to run asynchronously at a specific start time.
160      * @param serviceName Name of the service to invoke.
161      * @param context The name/value pairs composing the context.
162      * @param startTime The time to run this service.
163      * @param frequency The frequency of the recurrence (RecurrenceRule.DAILY, etc).
164      * @param interval The interval of the frequency recurrence.
165      * @param count The number of times to repeat.
166      * @param endTime The time in milliseconds the service should expire
167      * @throws GenericServiceException
168      * @throws RemoteException
169      */

170     public void schedule(String JavaDoc serviceName, Map JavaDoc context, long startTime, int frequency, int interval, int count, long endTime) throws GenericServiceException, RemoteException JavaDoc;
171                 
172     /**
173      * Schedule a service to run asynchronously at a specific start time.
174      * @param serviceName Name of the service to invoke.
175      * @param context The name/value pairs composing the context.
176      * @param startTime The time to run this service.
177      * @param frequency The frequency of the recurrence (RecurrenceRule.DAILY, etc).
178      * @param interval The interval of the frequency recurrence.
179      * @param count The number of times to repeat.
180      * @throws GenericServiceException
181      * @throws RemoteException
182      */

183     public void schedule(String JavaDoc serviceName, Map JavaDoc context, long startTime, int frequency, int interval, int count) throws GenericServiceException, RemoteException JavaDoc;
184    
185     /**
186      * Schedule a service to run asynchronously at a specific start time.
187      * @param serviceName Name of the service to invoke.
188      * @param context The name/value pairs composing the context.
189      * @param startTime The time to run this service.
190      * @param frequency The frequency of the recurrence (RecurrenceRule.DAILY, etc).
191      * @param interval The interval of the frequency recurrence.
192      * @param endTime The time in milliseconds the service should expire
193      * @throws GenericServiceException
194      * @throws RemoteException
195      */

196     public void schedule(String JavaDoc serviceName, Map JavaDoc context, long startTime, int frequency, int interval, long endTime) throws GenericServiceException, RemoteException JavaDoc;
197              
198     /**
199      * Schedule a service to run asynchronously at a specific start time.
200      * @param serviceName Name of the service to invoke.
201      * @param context The name/value pairs composing the context.
202      * @param startTime The time to run this service.
203      * @throws GenericServiceException
204      * @throws RemoteException
205      */

206     public void schedule(String JavaDoc serviceName, Map JavaDoc context, long startTime) throws GenericServiceException, RemoteException JavaDoc;
207
208 }
209
210
Popular Tags