2
* Copyright 1999,2004 The Apache Software Foundation.
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
8
* http://www.apache.org/licenses/LICENSE-2.0
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
17
package org.apache.catalina.tribes.group;
19
import java.io.ObjectInput;
20
import java.io.Serializable;
21
import java.io.Externalizable;
22
import java.io.IOException;
23
import java.io.ObjectOutput;
28
* <p>Description: </p>
30
* <p>Copyright: Copyright (c) 2005</p>
34
* @author not attributable
37
public class RpcMessage implements Externalizable {
39
protected Serializable message;
40
protected byte[] uuid;
41
protected byte[] rpcId;
42
protected boolean reply = false;
48
public RpcMessage(byte[] rpcId, byte[] uuid, Serializable message) {
51
this.message = message;
54
public void readExternal(ObjectInput in) throws IOException,ClassNotFoundException {
55
reply = in.readBoolean();
56
int length = in.readInt();
57
uuid = new byte[length];
58
in.read(uuid, 0, length);
59
length = in.readInt();
60
rpcId = new byte[length];
61
in.read(rpcId, 0, length);
62
message = (Serializable)in.readObject();
65
public void writeExternal(ObjectOutput out) throws IOException {
66
out.writeBoolean(reply);
67
out.writeInt(uuid.length);
68
out.write(uuid, 0, uuid.length);
69
out.writeInt(rpcId.length);
70
out.write(rpcId, 0, rpcId.length);
71
out.writeObject(message);