2
* This program is free software; you can redistribute it and/or modify
3
* it under the terms of the GNU General Public License as published by
4
* the Free Software Foundation; either version 2 of the License, or
5
* (at your option) any later version.
6
* This program is distributed in the hope that it will be useful,
7
* but WITHOUT ANY WARRANTY; without even the implied warranty of
8
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9
* GNU General Public License for more details.
10
* You should have received a copy of the GNU General Public License
11
* along with this program; if not, write to the Free Software
12
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
14
package games.strategy.engine.message;
16
import java.io.Externalizable;
17
import java.io.IOException;
18
import java.io.ObjectInput;
19
import java.io.ObjectOutput;
25
* @author Sean Bridges
28
* The results of a method execution.
30
* Note that either one of m_rVal or m_exception will be null,
31
* since the method can either throw or return
34
class RemoteMethodCallResults implements Externalizable
36
private Object m_rVal;
37
//throwable implements Serializable
38
private Throwable m_exception;
40
public RemoteMethodCallResults()
45
public RemoteMethodCallResults(final Object rVal)
51
public RemoteMethodCallResults(Throwable exception)
54
m_exception = exception;
57
public Throwable getException()
61
public Object getRVal()
66
public void writeExternal(ObjectOutput out) throws IOException
71
out.writeObject(m_rVal);
76
out.writeObject(m_exception);
80
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
82
boolean rVal = in.read() == 1;
85
m_rVal = in.readObject();
89
m_exception = (Throwable) in.readObject();