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



src/inspectorj/agent/commandset/jdwpcommandset.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   inspectorJ - java profiler                                            *
00003  *   Copyright (C) 2007 by James May
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 
00027 #include "jdwpcommandset.h"
00028 
00029 namespace inspectorj {
00030 namespace agent {
00031 namespace commandset {
00032 
00033 using namespace inspectorj::jdwp;
00034     
00035 // initialize static member
00036 QMap<qint64, jclass> JDWPCommandSet::classMap = QMap<qint64, jclass>();    
00037 
00041 JDWPCommandSet::~JDWPCommandSet()
00042 {
00043 }
00044 
00050 JDWPReply* JDWPCommandSet::getJDWPReply(JDWPCommand* cmd)
00051 {
00052     jdwpReplyPacket pkt;
00053     pkt.id = cmd->getId();
00054     pkt.len = (jint)JDWP_HEADER_LENGTH;
00055     pkt.flags = (jbyte)JDWPTRANSPORT_FLAGS_REPLY;
00056     pkt.errorCode = (short)ERR_NONE;
00057     return new JDWPReply(pkt);
00058 }
00059 
00064 void JDWPCommandSet::sendNotImplementedReply(JDWPCommand* cmd, boost::function< void (JDWPReply*) > cbk)
00065 {
00066     JDWPReply *reply = getJDWPReply(cmd);
00067     reply->setErrorCode((short)ERR_NOT_IMPLEMENTED);
00068     cbk(reply);
00069 }
00070 
00076 QMap<qint64, jclass>& JDWPCommandSet::getClassMap()
00077 {
00078     return classMap;
00079 }
00080 
00081 }
00082 }
00083 }

Generated on Sun Aug 19 17:07:53 2007 for inspectorJ by  doxygen 1.5.1