01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.object.msg;
05:
06: import com.tc.async.api.EventContext;
07: import com.tc.bytes.TCByteBuffer;
08: import com.tc.io.TCByteBufferOutput;
09: 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;
16:
17: /**
18: * Message used for DistributedObjectProtocol
19: *
20: * @author steve
21: */
22: public class RequestRootMessageImpl extends DSOMessageBase implements
23: EventContext, RequestRootMessage {
24: private final static byte ROOT_NAME = 1;
25:
26: private String rootName;
27:
28: public RequestRootMessageImpl(SessionID sessionID,
29: MessageMonitor monitor, TCByteBufferOutput out,
30: MessageChannel channel, TCMessageType type) {
31: super (sessionID, monitor, out, channel, type);
32: }
33:
34: public RequestRootMessageImpl(SessionID sessionID,
35: MessageMonitor monitor, MessageChannel channel,
36: TCMessageHeader header, TCByteBuffer[] data) {
37: super (sessionID, monitor, channel, header, data);
38: }
39:
40: protected void dehydrateValues() {
41: putNVPair(ROOT_NAME, rootName);
42: }
43:
44: protected boolean hydrateValue(byte name) throws IOException {
45: switch (name) {
46: case ROOT_NAME:
47: this .rootName = getStringValue();
48: return true;
49: default:
50: return false;
51: }
52: }
53:
54: public String getRootName() {
55: return rootName;
56: }
57:
58: public void initialize(String name) {
59: this.rootName = name;
60: }
61: }
|