use of org.wildfly.clustering.dispatcher.CommandDispatcher in project wildfly by wildfly.
the class ConcurrentBroadcastCommandDispatcherFactory method createCommandDispatcher.
@SuppressWarnings("unchecked")
@Override
public <C> CommandDispatcher<C> createCommandDispatcher(Object id, C context) {
CommandDispatcherFactory dispatcherFactory = this.factory;
Function<Runnable, CommandDispatcher<?>> factory = new Function<Runnable, CommandDispatcher<?>>() {
@Override
public CommandDispatcher<C> apply(Runnable closeTask) {
CommandDispatcher<C> dispatcher = dispatcherFactory.createCommandDispatcher(id, context, WildFlySecurityManager.getClassLoaderPrivileged(this.getClass()));
return new ConcurrentCommandDispatcher<>(dispatcher, closeTask);
}
};
return (CommandDispatcher<C>) this.dispatchers.apply(id, factory);
}
Aggregations