Session sess = SessionPool.getOrCreateConcreteSession(sess_id, null);
if(sess != null) {
if(sess instanceof ConsumerSession)
sess.detach(GateTalk.Request.Role.SOURCE);
else if(sess instanceof ProducerSession)
sess.detach(GateTalk.Request.Role.SINK);
}
synchronized(SessionPool.pool) {
SessionPool.pool.remove(sess_id);
}
res_builder.setSuccess(true).setContext(String.format("destroyed %d", sess_id));