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



inspectorj::agent::AgentPacketHandler Class Reference

#include <agentpackethandler.h>

Collaboration diagram for inspectorj::agent::AgentPacketHandler:

Collaboration graph
[legend]
List of all members.

Detailed Description

AgentPacketHandler class handles jdwpCmdPackets that are received from the client.

Commands are dispatched to the appropriate JDWPCommandSet for processing.

Author:
James May

Definition at line 51 of file agentpackethandler.h.

Public Member Functions

 AgentPacketHandler (JavaVM *vm, JNIEnv *env, jvmtiEnv *jvmti, AgentSocket *socket=0)
 Constructor.
 ~AgentPacketHandler ()
 Destructor.
void setAgentSocket (AgentSocket *&)
 Sets the AgentSocket used by the handler.
JDWPCommandSetgetCommandSet (jbyte cmd)
 Returns an appropriate JDWPCommandSet for the jdwpCmdPacket.
JDWPReplygetReply ()
void createCommandSets ()
 Create the command sets to be used.
void attachCurrentThreadToVM ()
 Attach the current thread to the java virtual machine.
void processCommand (JDWPCommand *cmd)
 Process the JDWPCommand.

Private Member Functions

void writeReply (JDWPReply *)
 Write a reply to the AgentSocket.

Private Attributes

JavaVM * vm
JNIEnv * env
jvmtiEnv * jvmti
AgentSocketsocket
VirtualMachineCmdSetvmCmdSet
ReferenceTypeCmdSetrefTypeCmdSet
BytecodeCmdSetbcCmdSet


Constructor & Destructor Documentation

inspectorj::agent::AgentPacketHandler::AgentPacketHandler ( JavaVM *  vm,
JNIEnv *  env,
jvmtiEnv *  jvmti,
AgentSocket socket = 0 
)

Constructor.

Parameters:
env The jvmtiEnv (JVMTI Environment) ptr
socket AgentSocket

Definition at line 40 of file agentpackethandler.cpp.

References createCommandSets().

inspectorj::agent::AgentPacketHandler::~AgentPacketHandler (  ) 

Destructor.

Definition at line 50 of file agentpackethandler.cpp.

References vmCmdSet.


Member Function Documentation

void inspectorj::agent::AgentPacketHandler::setAgentSocket ( AgentSocket *&  socket  ) 

Sets the AgentSocket used by the handler.

Parameters:
socket The AgentSocket

Definition at line 118 of file agentpackethandler.cpp.

References socket.

Referenced by inspectorj::agent::AgentServer::start().

JDWPCommandSet * inspectorj::agent::AgentPacketHandler::getCommandSet ( jbyte  cmd  ) 

Returns an appropriate JDWPCommandSet for the jdwpCmdPacket.

Parameters:
pkt The jdwpCmdPacket

Definition at line 127 of file agentpackethandler.cpp.

References bcCmdSet, refTypeCmdSet, and vmCmdSet.

Referenced by processCommand().

void inspectorj::agent::AgentPacketHandler::createCommandSets (  ) 

Create the command sets to be used.

Definition at line 61 of file agentpackethandler.cpp.

References bcCmdSet, env, jvmti, refTypeCmdSet, vm, and vmCmdSet.

Referenced by AgentPacketHandler().

void inspectorj::agent::AgentPacketHandler::attachCurrentThreadToVM (  ) 

Attach the current thread to the java virtual machine.

Definition at line 71 of file agentpackethandler.cpp.

References env, and vm.

Referenced by inspectorj::agent::AgentServer::start().

void inspectorj::agent::AgentPacketHandler::processCommand ( JDWPCommand cmd  ) 

Process the JDWPCommand.

Parameters:
cmd The JDWPCommand to process

Definition at line 93 of file agentpackethandler.cpp.

References inspectorj::jdwp::ERR_NOT_IMPLEMENTED, inspectorj::jdwp::JDWPCommand::getCmdSet(), getCommandSet(), inspectorj::jdwp::JDWPCommand::getId(), inspectorj::agent::commandset::JDWPCommandSet::process(), and writeReply().

Referenced by inspectorj::agent::AgentServer::start().

void inspectorj::agent::AgentPacketHandler::writeReply ( JDWPReply reply  )  [private]

Write a reply to the AgentSocket.

Parameters:
reply The JDWPReply that wraps a jdwpReplyPacket.

Definition at line 81 of file agentpackethandler.cpp.

References socket, and inspectorj::agent::AgentSocket::writeReply().

Referenced by processCommand().


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