KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdi > internal > spy > JdwpConversation


1 /*******************************************************************************
2  * Copyright (c) 2000, 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdi.internal.spy;
12
13 import com.ibm.icu.text.MessageFormat;
14
15
16 public class JdwpConversation {
17     private int fId;
18     private JdwpCommandPacket fCommand;
19     private JdwpReplyPacket fReply;
20
21     JdwpConversation(int id) {
22         fId = id;
23     }
24
25     void setCommand(JdwpCommandPacket command) {
26         if (fCommand != null) {
27             throw new IllegalArgumentException JavaDoc(MessageFormat.format("Attempt to overwrite command with {0}", new String JavaDoc[] {command.toString()})); //$NON-NLS-1$
28
}
29         fCommand = command;
30     }
31
32     void setReply(JdwpReplyPacket reply) {
33         if (fReply != null) {
34             throw new IllegalArgumentException JavaDoc(MessageFormat.format("Attempt to overwrite reply with {0}", new String JavaDoc[] {reply.toString()})); //$NON-NLS-1$
35
}
36         fReply = reply;
37     }
38
39     public JdwpCommandPacket getCommand() {
40         return fCommand;
41     }
42
43     public JdwpReplyPacket getReply() {
44         return fReply;
45     }
46     
47     public int getId() {
48         return fId;
49     }
50 }
51
Popular Tags