// TODO: cast to raw type to get away from generic issue..
@SuppressWarnings({"unchecked", "rawtypes"})
public ContainerMethodExecutor getContainerMethodExecutor(ProtocolDefinition protocol, ProtocolConfiguration protocolConfiguration)
{
final ContextSnapshot state = executorService.get().createSnapshotContext();
ContainerMethodExecutor executor = ((Protocol)protocol.getProtocol()).getExecutor(
protocolConfiguration,
protocolMetadata.get(), new CommandCallback()
{
@Override
public void fired(Command<?> event)
{
state.activate();
try
{
remoteEvent.fire(event);
}
finally
{
state.deactivate();
}
}
});
return executor;
}