TPTP 4.6.0 Platform Project
Public API Specification

org.eclipse.tptp.platform.probekit.launch.launchpad
Class LaunchPadJVMTI

java.lang.Object
  extended by org.eclipse.tptp.platform.probekit.launch.launchpad.LaunchPadJVMTI

public class LaunchPadJVMTI
extends java.lang.Object

This class replaces LaunchPad.java for the JVMTI implementation of probekit profiling. After the agent attaches but before it calls RESUME there is a small window of time in which we can send commands to the agent. This class is invoked during that time from the agentActive call to the ProbeControlListener, notified at the start of this crucial time. This class is used to first retrieve the ProbeID information stored as an attribute in the LaunchConfiguration which is passed in to agentActive. Once we have the ProbeIDs of all the selected probes, we can look up the probe information for these probes stored in the Probe Registry. Upon retrieving the registry entry, we have to wrap the class file and probescript information as a String using a Base64 encoder so that it can be sent as the commandData in the new execution framework command protocol. The command creation and invocation of agent.sendCommand() happens during deployClasses() which uses the agent passed in to send a command containing all of the necessary probe file information.

Provisional API: This API is subject to change in the next release.
As of TPTP V4.4.0, this is stable provisional API (see http://www.eclipse.org/tptp/home/documents/process/development/api_contract.html).

Constructor Summary
LaunchPadJVMTI()
           
 
Method Summary
 void addFilter(java.lang.String filterString)
          Add a filter to the LaunchPad filter list.
 void agentActive(ICollector currentAgent, org.eclipse.debug.core.ILaunchConfiguration config)
          A method called when the agent gives control to the probekit.
 void clearFilters()
          Wipes out all of the filters in the global filters Vector
static void deployProbeClasses(java.util.Vector bytes, java.util.Vector classNames, IAgent agent, int probeNumber)
          A method to send the probe classes to the Agent using the new execution framework command protocol
 void deployProbes(ProbeRegistryEntry probeRegistryEntry, int probeNumber)
          Begins the process of deploying all of the user-defined probes by first looping through the selected Probe Registry entries and retrieving the probe classPaths.
 void prepareFileArrays(java.lang.Object[] probeClassPath, ICollector agent, int probeNumber)
          This method is used to read in the class files and create two arrays, one of the class files themselves and one of the file names to pass to the method which sends the probekit commands to the agent.
 void setAgent(ICollector agent)
          Set the TPTP profiling agent.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LaunchPadJVMTI

public LaunchPadJVMTI()
Method Detail

agentActive

public void agentActive(ICollector currentAgent,
                        org.eclipse.debug.core.ILaunchConfiguration config)
                 throws org.eclipse.core.runtime.CoreException,
                        LaunchPadException
A method called when the agent gives control to the probekit. The purpose of this method is to extract what we need from the given launch configuration and then use those attributes to send the correct probe files as well as any user-defined filters to the probekit agent extension

Parameters:
currentAgent - - the currently active Agent
config - - the Launch Configuration
Throws:
org.eclipse.core.runtime.CoreException
LaunchPadException

deployProbes

public void deployProbes(ProbeRegistryEntry probeRegistryEntry,
                         int probeNumber)
                  throws LaunchPadException
Begins the process of deploying all of the user-defined probes by first looping through the selected Probe Registry entries and retrieving the probe classPaths. It then sends the classpath information to be put into array format and eventually deployed.

Parameters:
RegsitryEntries - - Vector of selected probes' Regsitry Entries
probeNumber -
Throws:
LaunchPadException

prepareFileArrays

public void prepareFileArrays(java.lang.Object[] probeClassPath,
                              ICollector agent,
                              int probeNumber)
                       throws LaunchPadException
This method is used to read in the class files and create two arrays, one of the class files themselves and one of the file names to pass to the method which sends the probekit commands to the agent.

Parameters:
probeClassPath - - Array of the classPaths for selected probe files
agent- - the active agent we will use to send commands
probeNumber -
Throws:
LaunchPadException

deployProbeClasses

public static void deployProbeClasses(java.util.Vector bytes,
                                      java.util.Vector classNames,
                                      IAgent agent,
                                      int probeNumber)
                               throws LaunchPadException
A method to send the probe classes to the Agent using the new execution framework command protocol

Parameters:
bytes - - The Vector of bytes representing the probe file classes (probescript etc.)
classNames - - A Vector of the classNames for each probe
agent - - The currently active agent
Throws:
LaunchPadException

clearFilters

public void clearFilters()
Wipes out all of the filters in the global filters Vector

See Also:
LaunchPad.clearFilters()

addFilter

public void addFilter(java.lang.String filterString)
Add a filter to the LaunchPad filter list. These filters will override the original filters from the script.

Parameters:
filterString -
See Also:
LaunchPad.addFilter(String)

setAgent

public void setAgent(ICollector agent)
Set the TPTP profiling agent. Probes will be later deployed to this agent.

Parameters:
agent - - The profiling agent

TPTP 4.6.0 Platform Project
Public API Specification