01: /*******************************************************************************
02: * Copyright (c) 2000, 2007 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jdi.internal.spy;
11:
12: import com.ibm.icu.text.MessageFormat;
13:
14: public class JdwpConversation {
15: private int fId;
16: private JdwpCommandPacket fCommand;
17: private JdwpReplyPacket fReply;
18:
19: JdwpConversation(int id) {
20: fId = id;
21: }
22:
23: void setCommand(JdwpCommandPacket command) {
24: if (fCommand != null) {
25: throw new IllegalArgumentException(
26: MessageFormat
27: .format(
28: "Attempt to overwrite command with {0}", new String[] { command.toString() })); //$NON-NLS-1$
29: }
30: fCommand = command;
31: }
32:
33: void setReply(JdwpReplyPacket reply) {
34: if (fReply != null) {
35: throw new IllegalArgumentException(
36: MessageFormat
37: .format(
38: "Attempt to overwrite reply with {0}", new String[] { reply.toString() })); //$NON-NLS-1$
39: }
40: fReply = reply;
41: }
42:
43: public JdwpCommandPacket getCommand() {
44: return fCommand;
45: }
46:
47: public JdwpReplyPacket getReply() {
48: return fReply;
49: }
50:
51: public int getId() {
52: return fId;
53: }
54: }
|