KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > rift > coad > daemon > messageservice > RPCMessage


1 /*
2  * MessageQueueClient: The message queue client library
3  * Copyright (C) 2006 Rift IT Contracting
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  *
19  * RPCMessage.java
20  */

21
22 package com.rift.coad.daemon.messageservice;
23
24 /**
25  * The definition of the RPC message.
26  *
27  * @author Brett Chaldecott
28  */

29 public interface RPCMessage extends Message {
30     /**
31      * This method sets the XML body for the message.
32      *
33      * @param xml The string containing the formatted xml for the request.
34      * @exception MessageServiceException
35      */

36     public void setMethodBodyXML(String JavaDoc xml) throws MessageServiceException;
37     
38     
39     /**
40      * This method returns the XML body of the message.
41      *
42      * @return The string containing the formatted xml for the request.
43      * @exception MessageServiceException
44      */

45     public String JavaDoc getMethodBodyXML() throws MessageServiceException;
46     
47     
48     /**
49      * This method sets the method information for
50      *
51      * @param returnType The return type for this message.
52      * @param name The name of this method.
53      * @param types The types that are arguments to this method.
54      * @exception MessageServiceException
55      */

56     public void defineMethod(Class JavaDoc returnType, String JavaDoc name, Class JavaDoc[] types)
57     throws MessageServiceException;
58     
59     
60     /**
61      * This method retrieves the return type of a method.
62      *
63      * @return The object containing the return type information.
64      * @exception MessageServiceException
65      */

66     public Object JavaDoc getReturnType() throws MessageServiceException;
67     
68     
69     /**
70      * This method returns the name of the method being wrapped.
71      *
72      * @return The string containing the method name.
73      * @exception MessageServiceException
74      */

75     public String JavaDoc getMethodName() throws MessageServiceException;
76     
77     
78     /**
79      * This method returns the argument types for this method.
80      *
81      * @return The list of arguments.
82      * @exception MessageServiceException
83      */

84     public Class JavaDoc[] getArgumentTypes() throws MessageServiceException;
85     
86     
87     /**
88      * This method sets the arguments for this message.
89      *
90      * @param args The arguments to set.
91      * @exception MessageServiceException
92      */

93     public void setArguments(Object JavaDoc[] args) throws MessageServiceException;
94     
95     
96     /**
97      * This method returns the arguments for a method.
98      *
99      * @return The list of arguments.
100      * @exception MessageServiceException.
101      */

102     public Object JavaDoc[] getArguments() throws MessageServiceException;
103     
104     
105     /**
106      * This method returns true if an exception was thrown.
107      *
108      * @return TRUE if and exception was generated, FALSE if not.
109      * @exception MessageServiceException
110      */

111     public boolean generatedException() throws MessageServiceException;
112     
113     
114     /**
115      * This method returns the result of the RPC call.
116      *
117      * @return The object returns as a result of the asynchronis call.
118      * @exception MessageServiceException
119      */

120     public Object JavaDoc getResult() throws MessageServiceException;
121     
122     
123     /**
124      * This method is responsible for setting the result of the return.
125      *
126      * @param result The result of the message.
127      * @exception MessageServiceException
128      */

129     public void setResult(Object JavaDoc result) throws MessageServiceException;
130     
131     
132     /**
133      * This method returns the exception that got thrown while processing this
134      * RPC message.
135      *
136      * @return The exception that got thrown while processing this message.
137      * @exception MessageServiceException
138      */

139     public Throwable JavaDoc getThrowable() throws MessageServiceException;
140     
141     
142     /**
143      * This method returns the exception that got thrown while processing this
144      * RPC message.
145      *
146      * @param throwable The throwable exception to set.
147      * @exception MessageServiceException
148      */

149     public void setThrowable(Throwable JavaDoc throwable) throws MessageServiceException;
150 }
151
Popular Tags