KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jgroups > protocols > TunnelHeader


1 // $Id: TunnelHeader.java,v 1.5 2004/09/15 16:21:11 belaban Exp $
2

3 package org.jgroups.protocols;
4
5 import org.jgroups.Header;
6
7 import java.io.IOException JavaDoc;
8 import java.io.ObjectInput JavaDoc;
9 import java.io.ObjectOutput JavaDoc;
10
11
12
13
14 public class TunnelHeader extends Header {
15     public String JavaDoc channel_name=null;
16
17     public TunnelHeader() {} // used for externalization
18

19     public TunnelHeader(String JavaDoc n) {channel_name=n;}
20
21     public long size() {
22         return 100;
23     }
24
25     public String JavaDoc toString() {
26         return "[TUNNEL:channel_name=" + channel_name + ']';
27     }
28
29
30     public void writeExternal(ObjectOutput JavaDoc out) throws IOException JavaDoc {
31         out.writeObject(channel_name);
32     }
33
34
35
36     public void readExternal(ObjectInput JavaDoc in) throws IOException JavaDoc, ClassNotFoundException JavaDoc {
37         channel_name=(String JavaDoc)in.readObject();
38     }
39
40
41 }
42
Popular Tags