ij-16.png   inspectorJ -- JavaTM Profiler
sf project site browse source checkout source
SourceForge.net Logo



inspectorj::jdwp::JDWPCommand Class Reference

#include <jdwpcommand.h>

Inheritance diagram for inspectorj::jdwp::JDWPCommand:

Inheritance graph
[legend]
Collaboration diagram for inspectorj::jdwp::JDWPCommand:

Collaboration graph
[legend]
List of all members.

Detailed Description

JDWPCommand wraps the jdwpCmdPacket struct.

Author:
James May
See also:
jdwpTransport.h

Definition at line 42 of file jdwpcommand.h.

Public Member Functions

 JDWPCommand (jdwpCmdPacket &)
 Constructor that wraps a jdwpCmdPacket.
 ~JDWPCommand ()
 Destructor.
JDWPCommandcopy ()
 Copy function that produces a deep copy of this.
jint getId ()
 Returns the packet's id.
jbyte getCmd ()
 Returns the packet's command.
jbyte getCmdSet ()
 Returns the packet's command set.
jbyte getPacketType ()
 Returns the jdwp packet's flags byte.

Static Public Member Functions

static JDWPCommandnewCommand (virtualMachineCmd)
 Constructor for virtual machine commands.
static JDWPCommandnewCommand (inspectorjCmd)
 Constructor for inspectorj commands.
static JDWPCommandnewCommand (referenceTypeCmd)
 Constructor for reference type commands.
static JDWPCommandnewCommand (byteCodeCmd)
 Constructor for reference type commands.
static JDWPCommandnewCommand (classTypeCmd)
 Constructor for class type commands.
static JDWPCommandnewCommand (arrayTypeCmd)
 Constructor for array type commands.
static JDWPCommandnewCommand (methodCmd)
 Constructor for method commands.
static JDWPCommandnewCommand (objectReferenceCmd)
 Constructor for object reference commands.
static JDWPCommandnewCommand (stringReferenceCmd)
 Constructor for string reference commands.
static JDWPCommandnewCommand (threadReferenceCmd)
 Constructor for thread reference commands.
static JDWPCommandnewCommand (threadGroupReferenceCmd)
 Constructor for thread group reference commands.
static JDWPCommandnewCommand (arrayReferenceCmd)
 Constructor for array reference commands.
static JDWPCommandnewCommand (classLoaderReferenceCmd)
 Constructor for class loader reference commands.
static JDWPCommandnewCommand (eventRequestCmd)
 Constructor for event request commands.
static JDWPCommandnewCommand (stackFrameCmd)
 Constructor for stack frame commands.
static JDWPCommandnewCommand (classObjectReferenceCmd)
 Constructor for class object reference commands.
static JDWPCommandnewCommand (eventCmd)
 Constructor for event commands.

Private Member Functions

 JDWPCommand (jbyte cmdSet, jbyte cmd)
 Private constructor.
int getNextId ()
 Returns the next id by incrementing the static field nextId.

Private Attributes

jdwpCmdPacket cmdPacket
 The command packet struct.

Static Private Attributes

static int nextId
 The static id.


Constructor & Destructor Documentation

JDWPCommand::JDWPCommand ( jdwpCmdPacket &  packet  ) 

Constructor that wraps a jdwpCmdPacket.

This constructor is intended to be used when a command packet is received from the profiler server and we don't yet know what its data payload is. In such a case we would read the data from the socket and store it in a jdwpCmdPacket and pass it to this ctor.

Definition at line 41 of file jdwpcommand.cpp.

References inspectorj::jdwp::JDWPPacket::bytes, cmdPacket, inspectorj::jdwp::JDWPPacket::data, and inspectorj::jdwp::JDWP_HEADER_LENGTH.

Referenced by copy(), and newCommand().

JDWPCommand::~JDWPCommand (  ) 

Destructor.

Definition at line 72 of file jdwpcommand.cpp.

References cmdPacket.

JDWPCommand::JDWPCommand ( jbyte  cmdSet,
jbyte  cmd 
) [private]

Private constructor.

This constructor is used internally.

Parameters:
cmdSet The cmdSet byte for this command
cmd The cmd within the command set
See also:
jdwpTransport.h

Definition at line 87 of file jdwpcommand.cpp.

References inspectorj::jdwp::JDWPPacket::bytes, cmdPacket, inspectorj::jdwp::JDWPPacket::data, and getNextId().


Member Function Documentation

JDWPCommand * JDWPCommand::copy (  )  [virtual]

Copy function that produces a deep copy of this.

This function re-implements JDWPPacket::copy(). This is necessary since the base class, JDWPPacket, has pure virtual functions and therefore cannot provide a copy constructor.

Implements inspectorj::jdwp::JDWPPacket.

Definition at line 64 of file jdwpcommand.cpp.

References cmdPacket, and JDWPCommand().

JDWPCommand * JDWPCommand::newCommand ( virtualMachineCmd  cmd  )  [static]

Constructor for virtual machine commands.

Parameters:
cmd A cmd from the virtual machine command set

Definition at line 128 of file jdwpcommand.cpp.

References JDWPCommand().

Referenced by inspectorj::toolset::ClassToolSet::disassembleBytecodes(), inspectorj::toolset::ClassToolSet::getAllLoadedClasses(), and inspectorj::toolset::ClassToolSet::getClassDetails().

JDWPCommand * JDWPCommand::newCommand ( inspectorjCmd  cmd  )  [static]

Constructor for inspectorj commands.

Parameters:
cmd A cmd from the inspectorj command set

Definition at line 138 of file jdwpcommand.cpp.

References JDWPCommand().

JDWPCommand * JDWPCommand::newCommand ( referenceTypeCmd  cmd  )  [static]

Constructor for reference type commands.

Parameters:
cmd A cmd from the reference type command set

Definition at line 108 of file jdwpcommand.cpp.

References JDWPCommand().

JDWPCommand * JDWPCommand::newCommand ( byteCodeCmd  cmd  )  [static]

Constructor for reference type commands.

Parameters:
cmd A cmd from the reference type command set

Definition at line 118 of file jdwpcommand.cpp.

References JDWPCommand().

JDWPCommand * JDWPCommand::newCommand ( classTypeCmd  cmd  )  [static]

Constructor for class type commands.

Parameters:
cmd A cmd from the class type command set

Definition at line 148 of file jdwpcommand.cpp.

References JDWPCommand().

JDWPCommand * JDWPCommand::newCommand ( arrayTypeCmd  cmd  )  [static]

Constructor for array type commands.

Parameters:
cmd A cmd from the array type command set

Definition at line 158 of file jdwpcommand.cpp.

References JDWPCommand().

JDWPCommand * JDWPCommand::newCommand ( methodCmd  cmd  )  [static]

Constructor for method commands.

Parameters:
cmd A cmd from the method command set

Definition at line 168 of file jdwpcommand.cpp.

References JDWPCommand().

JDWPCommand * JDWPCommand::newCommand ( objectReferenceCmd  cmd  )  [static]

Constructor for object reference commands.

Parameters:
cmd A cmd from the object reference command set

Definition at line 178 of file jdwpcommand.cpp.

References JDWPCommand().

JDWPCommand * JDWPCommand::newCommand ( stringReferenceCmd  cmd  )  [static]

Constructor for string reference commands.

Parameters:
cmd A cmd from the string reference command set

Definition at line 188 of file jdwpcommand.cpp.

References JDWPCommand().

JDWPCommand * JDWPCommand::newCommand ( threadReferenceCmd  cmd  )  [static]

Constructor for thread reference commands.

Parameters:
cmd A cmd from the thread reference command set

Definition at line 198 of file jdwpcommand.cpp.

References JDWPCommand().

JDWPCommand * JDWPCommand::newCommand ( threadGroupReferenceCmd  cmd  )  [static]

Constructor for thread group reference commands.

Parameters:
cmd A cmd from the thread group reference command set

Definition at line 208 of file jdwpcommand.cpp.

References JDWPCommand().

JDWPCommand * JDWPCommand::newCommand ( arrayReferenceCmd  cmd  )  [static]

Constructor for array reference commands.

Parameters:
cmd A cmd from the array reference command set

Definition at line 218 of file jdwpcommand.cpp.

References JDWPCommand().

JDWPCommand * JDWPCommand::newCommand ( classLoaderReferenceCmd  cmd  )  [static]

Constructor for class loader reference commands.

Parameters:
cmd A cmd from the class loader reference command set

Definition at line 228 of file jdwpcommand.cpp.

References JDWPCommand().

JDWPCommand * JDWPCommand::newCommand ( eventRequestCmd  cmd  )  [static]

Constructor for event request commands.

Parameters:
cmd A cmd from the event request command set

Definition at line 238 of file jdwpcommand.cpp.

References JDWPCommand().

JDWPCommand * JDWPCommand::newCommand ( stackFrameCmd  cmd  )  [static]

Constructor for stack frame commands.

Parameters:
cmd A cmd from the stack frame command set

Definition at line 248 of file jdwpcommand.cpp.

References JDWPCommand().

JDWPCommand * JDWPCommand::newCommand ( classObjectReferenceCmd  cmd  )  [static]

Constructor for class object reference commands.

Parameters:
cmd A cmd from the class object reference command set

Definition at line 258 of file jdwpcommand.cpp.

References JDWPCommand().

JDWPCommand * JDWPCommand::newCommand ( eventCmd  cmd  )  [static]

Constructor for event commands.

Parameters:
cmd A cmd from the event command set

Definition at line 268 of file jdwpcommand.cpp.

References JDWPCommand().

jint JDWPCommand::getId (  )  [virtual]

Returns the packet's id.

Implements inspectorj::jdwp::JDWPPacket.

Definition at line 301 of file jdwpcommand.cpp.

References cmdPacket.

Referenced by inspectorj::agent::commandset::JDWPCommandSet::getJDWPReply(), inspectorj::agent::AgentPacketHandler::processCommand(), and inspectorj::client::ClientPacketHandler::sendJDWPCommand().

jbyte JDWPCommand::getCmd (  ) 

Returns the packet's command.

Definition at line 285 of file jdwpcommand.cpp.

References cmdPacket.

Referenced by inspectorj::agent::commandset::VirtualMachineCmdSet::process(), inspectorj::agent::commandset::ReferenceTypeCmdSet::process(), inspectorj::agent::commandset::BytecodeCmdSet::process(), and inspectorj::client::ClientPacketHandler::sendJDWPCommand().

jbyte JDWPCommand::getCmdSet (  ) 

Returns the packet's command set.

Definition at line 293 of file jdwpcommand.cpp.

References cmdPacket.

Referenced by inspectorj::agent::AgentPacketHandler::processCommand(), and inspectorj::client::ClientPacketHandler::sendJDWPCommand().

jbyte JDWPCommand::getPacketType (  )  [virtual]

Returns the jdwp packet's flags byte.

This identifies the packet as a command packet or a reply packet.

Implements inspectorj::jdwp::JDWPPacket.

Definition at line 277 of file jdwpcommand.cpp.

References cmdPacket.

Referenced by inspectorj::client::ClientPacketHandler::sendJDWPCommand().

int JDWPCommand::getNextId (  )  [private]

Returns the next id by incrementing the static field nextId.

This should only be called from the private constructor.

Definition at line 310 of file jdwpcommand.cpp.

References nextId.

Referenced by JDWPCommand().


Member Data Documentation

jdwpCmdPacket inspectorj::jdwp::JDWPCommand::cmdPacket [private]

The command packet struct.

Definition at line 77 of file jdwpcommand.h.

Referenced by copy(), getCmd(), getCmdSet(), getId(), getPacketType(), JDWPCommand(), and ~JDWPCommand().

int JDWPCommand::nextId [static, private]

The static id.

Definition at line 80 of file jdwpcommand.h.

Referenced by getNextId().


The documentation for this class was generated from the following files:
Generated on Sun Aug 19 17:08:17 2007 for inspectorJ by  doxygen 1.5.1