/** * Destroy the agent. */ @Access(AccessType.UNAVAILABLE) protected void destroy() { eventCaller.on("destroy"); if (scheduler != null) { scheduler.delete(); scheduler = null; } if (transport != null) { transport.disconnect(); transport.delete(); transport = null; } if (protocolStack != null) { protocolStack.delete(); protocolStack = null; } if (state != null) { state.delete(); state = null; } if (is != null) { is.deregister(agentId); is = null; } }