KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > object > msg > RequestRootMessageImpl


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.object.msg;
5
6 import com.tc.async.api.EventContext;
7 import com.tc.bytes.TCByteBuffer;
8 import com.tc.io.TCByteBufferOutput;
9 import com.tc.net.protocol.tcm.MessageChannel;
10 import com.tc.net.protocol.tcm.MessageMonitor;
11 import com.tc.net.protocol.tcm.TCMessageHeader;
12 import com.tc.net.protocol.tcm.TCMessageType;
13 import com.tc.object.session.SessionID;
14
15 import java.io.IOException JavaDoc;
16
17 /**
18  * Message used for DistributedObjectProtocol
19  *
20  * @author steve
21  */

22 public class RequestRootMessageImpl extends DSOMessageBase implements EventContext, RequestRootMessage {
23   private final static byte ROOT_NAME = 1;
24
25   private String JavaDoc rootName;
26
27   public RequestRootMessageImpl(MessageMonitor monitor, TCByteBufferOutput out, MessageChannel channel, TCMessageType type) {
28     super(monitor, out, channel, type);
29   }
30
31   public RequestRootMessageImpl(SessionID sessionID, MessageMonitor monitor, MessageChannel channel, TCMessageHeader header, TCByteBuffer[] data) {
32     super(sessionID, monitor, channel, header, data);
33   }
34
35   protected void dehydrateValues() {
36     putNVPair(ROOT_NAME, rootName);
37   }
38
39   protected boolean hydrateValue(byte name) throws IOException JavaDoc {
40     switch (name) {
41       case ROOT_NAME:
42         this.rootName = getStringValue();
43         return true;
44       default:
45         return false;
46     }
47   }
48   
49   public String JavaDoc getRootName() {
50     return rootName;
51   }
52
53   public void initialize(String JavaDoc name) {
54     this.rootName = name;
55   }
56 }
Popular Tags