InstanceWrapper ctx = wrappers.get(contextId);
return ctx;
}
private void removeInstanceWrapper(Object contextId) throws TargetDestructionException {
InstanceWrapper ctx = getInstanceWrapper(contextId);
wrappers.remove(contextId);
// find out if we are dealing with the original client conversation id
// and reset accordingly
if ( ( clientConversationId != null ) && ( clientConversationId.equals(contextId)) ) {
clientConversationId = null;
} else {
// reset the conversationId in the conversation object if present
// so that and ending callback causes the conversation in the originating
// service reference in the client to be reset
callbackConversations.remove(contextId);
}
// stop the component if this removes the last reference
if (clientConversationId == null && callbackConversations.isEmpty()) {
ctx.stop();
}
}