@Override public void delete() { // TODO: clear out all state files final State state = new StateBuilder().withConfig( (ObjectNode) myParams.get("state")).build(); if (state != null) { state.delete(); } }
/** * Removes the specific state. * * @param key * the key * @param val * the val */ private void remove(final String key, final InstantiationEntry val) { State innerState = null; if (val != null) { innerState = val.getState(); } if (innerState == null) { innerState = new StateBuilder().withConfig( new StateConfig((ObjectNode) myParams.get("state")).put( "id", key)).build(); } if (innerState != null) { innerState.delete(); } }
/** * 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; } }