@Access(AccessType.UNAVAILABLE)
public void delete() {
// TODO: unsubscribe from all subscriptions
// cancel all scheduled tasks.
Scheduler scheduler = getScheduler();
for (String taskId : scheduler.getTasks()) {
scheduler.cancelTask(taskId);
}
// remove all keys from the state
// Note: the state itself will be deleted by the AgentFactory
state.clear();