KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > za > org > coefficient > interfaces > Invoker


1 /*
2  * Coefficient - facilitates project based collaboration
3  * Copyright (C) 2003, Dylan Etkin, CSIR icomtek
4  * PO Box 395
5  * Pretoria 0001, RSA
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  */

19
20 package za.org.coefficient.interfaces;
21
22 import za.co.csir.icomtek.workflow.interfaces.WorkflowContext;
23
24 /**
25  * Defines the interface for a module invoker
26  */

27 public interface Invoker {
28
29     /**
30      * This method will look for a request parameter named module and
31      * one named op and will try to fire that operation on the module.
32      */

33     public Object JavaDoc invoke(CoefficientContext ctx) throws Exception JavaDoc;
34
35     /**
36      * This method will invoke the named getter on the named module and
37      * return the result
38      *
39      * @param module names a module in the system
40      * @param method names the getter on the module
41      * @return is the return value of the getter method
42      */

43     public Object JavaDoc invokeGetterOnModule(String JavaDoc module, String JavaDoc method)
44         throws Exception JavaDoc;
45
46     /**
47      * This method will invoke the named method on the named module with the
48      * parameters provided in the incomming object array and return the result
49      *
50      * @param module names a module available in the system
51      * @param method names the method on the module
52      * @param paramVals contains the parameters for the method invoke
53      * @return is the return value of the method
54      */

55     public Object JavaDoc invokeMethodOnModule(String JavaDoc module, String JavaDoc method,
56                                        Object JavaDoc[] paramVals)
57         throws Exception JavaDoc;
58
59     /**
60      * This method will invoke the named method on the named service with the
61      * parameters provided in the incomming object array and return the result
62      *
63      * @param module names a service available in the system, this does not
64      * need to be a module or a theme
65      * @param method names the method on the service
66      * @param paramVals contains the parameters for the method invoke
67      * @return is the return value of the method
68      */

69     public Object JavaDoc invokeMethodOnService(String JavaDoc serviceName, String JavaDoc method,
70                                         Object JavaDoc[] paramVals) throws Exception JavaDoc;
71
72     /**
73      * This method will invoke the named operation on the named module
74      * with the given context as a parameter
75      *
76      * @param module names a module in the system
77      * @param operation names the method to invoke on the module
78      * @param ctx is the coefficient context to be passed to the module
79      * @return is the return value if there is one, null otherwise
80      */

81     public Object JavaDoc invokeOpOnModule(String JavaDoc module, String JavaDoc operation,
82                                    CoefficientContext ctx)
83         throws Exception JavaDoc;
84
85     /**
86      * NOTE: This is bad and is only done to give the workflow some
87      * autonomy
88      * This method will invoke the named operation on the named module
89      * with the given a workflow context which is a CoefficientContext
90      */

91     public Object JavaDoc invokeOpOnModule(String JavaDoc module, String JavaDoc operation,
92                                    WorkflowContext ctx) throws Exception JavaDoc;
93
94     /**
95      * This method returns a reference to the named service.
96      * NOTE: this method can only be used by those in the same class loader
97      * as the requested service. This is because this returns an EJB created
98      * through a local interface, not a remote interface.
99      *
100      * @param serviceName is the service available in the system
101      * @return is the service that was requested
102      */

103     public Object JavaDoc getService(String JavaDoc serviceName) throws Exception JavaDoc;
104
105     /**
106      * This method is used to invoke methods on a system service that must be
107      * a theme.
108      *
109      * @param theme names a theme available in the system, this must be a
110      * theme
111      * @param method names the method on the service
112      * @param paramVals contains the parameters for the method invoke
113      * @return is the return value of the method
114      */

115     public Object JavaDoc invokeMethodOnTheme(String JavaDoc theme, String JavaDoc method,
116                                       Object JavaDoc[] paramVals) throws Exception JavaDoc;
117 }
118
Popular Tags