01: /*
02: * $Id: GenericEngine.java,v 1.1 2003/08/17 05:12:39 ajzeneski Exp $
03: *
04: * Copyright (c) 2001, 2002 The Open For Business Project - www.ofbiz.org
05: *
06: * Permission is hereby granted, free of charge, to any person obtaining a
07: * copy of this software and associated documentation files (the "Software"),
08: * to deal in the Software without restriction, including without limitation
09: * 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.engine;
26:
27: import java.util.Map;
28:
29: import org.ofbiz.service.GenericRequester;
30: import org.ofbiz.service.GenericServiceException;
31: import org.ofbiz.service.ModelService;
32:
33: /**
34: * Generic Engine Interface
35: *
36: * @author <a href="mailto:jaz@ofbiz.org">Andy Zeneski</a>
37: * @author <a href="mailto:jonesde@ofbiz.org">David E. Jones</a>
38: * @version $Revision: 1.1 $
39: * @since 2.0
40: */
41: public interface GenericEngine {
42:
43: /**
44: * Run the service synchronously and return the result.
45: *
46: * @param localName Name of the LocalDispatcher.
47: * @param modelService Service model object.
48: * @param context Map of name, value pairs composing the context.
49: * @return Map of name, value pairs composing the result.
50: * @throws GenericServiceException
51: */
52: public Map runSync(String localName, ModelService modelService,
53: Map context) throws GenericServiceException;
54:
55: /**
56: * Run the service synchronously and IGNORE the result.
57: *
58: * @param localName Name of the LocalDispatcher.
59: * @param modelService Service model object.
60: * @param context Map of name, value pairs composing the context.
61: * @throws GenericServiceException
62: */
63: public void runSyncIgnore(String localName,
64: ModelService modelService, Map context)
65: throws GenericServiceException;
66:
67: /**
68: * Run the service asynchronously, passing an instance of GenericRequester that will receive the result.
69: *
70: * @param localName Name of the LocalDispatcher.
71: * @param modelService Service model object.
72: * @param context Map of name, value pairs composing the context.
73: * @param requester Object implementing GenericRequester interface which will receive the result.
74: * @param persist True for store/run; False for run.
75: * @throws GenericServiceException
76: */
77: public void runAsync(String localName, ModelService modelService,
78: Map context, GenericRequester requester, boolean persist)
79: throws GenericServiceException;
80:
81: /**
82: * Run the service asynchronously and IGNORE the result.
83: *
84: * @param localName Name of the LocalDispatcher.
85: * @param modelService Service model object.
86: * @param context Map of name, value pairs composing the context.
87: * @param persist True for store/run; False for run.
88: * @throws GenericServiceException
89: */
90: public void runAsync(String localName, ModelService modelService,
91: Map context, boolean persist)
92: throws GenericServiceException;
93:
94: }
|