Search in sources :

Example 1 with ChannelUpgradeHandler

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();
}
Also used : ListenerRegistry(io.undertow.server.ListenerRegistry) CapabilityServiceBuilder(org.jboss.as.controller.CapabilityServiceBuilder) ChannelUpgradeHandler(io.undertow.server.handlers.ChannelUpgradeHandler)

Aggregations

ListenerRegistry (io.undertow.server.ListenerRegistry)1 ChannelUpgradeHandler (io.undertow.server.handlers.ChannelUpgradeHandler)1 CapabilityServiceBuilder (org.jboss.as.controller.CapabilityServiceBuilder)1