use of io.undertow.server.handlers.ChannelUpgradeHandler in project wildfly by wildfly.
the class HTTPUpgradeService method installService.
@SuppressWarnings("unchecked")
public static void installService(final CapabilityServiceTarget target, String activeMQServerName, final String acceptorName, final String httpListenerName) {
final CapabilityServiceBuilder sb = target.addCapability(HTTPAcceptorDefinition.CAPABILITY);
sb.provides(MessagingServices.getHttpUpgradeServiceName(activeMQServerName, acceptorName));
Supplier<ChannelUpgradeHandler> upgradeSupplier = sb.requiresCapability(HTTP_UPGRADE_REGISTRY_CAPABILITY_NAME, ChannelUpgradeHandler.class, httpListenerName);
Supplier<ListenerRegistry> listenerRegistrySupplier = sb.requiresCapability(HTTP_LISTENER_REGISTRY_CAPABILITY_NAME, ListenerRegistry.class);
sb.requires(ActiveMQActivationService.getServiceName(MessagingServices.getActiveMQServiceName(activeMQServerName)));
final HTTPUpgradeService service = new HTTPUpgradeService(activeMQServerName, acceptorName, httpListenerName, upgradeSupplier, listenerRegistrySupplier);
sb.setInitialMode(ServiceController.Mode.PASSIVE);
sb.setInstance(service);
sb.install();
}
Aggregations