SessionInfo session = launchSession.getSession();
StringBuffer tunnels = new StringBuffer();
if (DefaultAgentManager.getInstance().hasActiveAgent(session)) {
try {
Request agentRequest = ((ApplicationService) DefaultAgentManager.getInstance().getService(ApplicationService.class)).launchApplication(launchSession);
AgentTunnel agent = DefaultAgentManager.getInstance().getAgentBySession(launchSession.getSession());
if (!agent.sendRequest(agentRequest, true, 60000)) {
throw new ExtensionException(ExtensionException.AGENT_REFUSED_LAUNCH);
}
ByteArrayReader baw = new ByteArrayReader(agentRequest.getRequestData());
try {
while(true) {
String name = baw.readString();
String hostname = baw.readString();
long port = baw.readInt();