Package org.wildfly.extension.undertow
Class ListenerService
- java.lang.Object
-
- org.wildfly.extension.undertow.ListenerService
-
- All Implemented Interfaces:
org.jboss.msc.Service,org.jboss.msc.service.Service<UndertowListener>,org.jboss.msc.value.Value<UndertowListener>,UndertowListener
- Direct Known Subclasses:
AjpListenerService,HttpListenerService
public abstract class ListenerService extends Object implements org.jboss.msc.service.Service<UndertowListener>, UndertowListener
- Author:
- Tomaz Cerar, Richard Opalka
-
-
Field Summary
Fields Modifier and Type Field Description protected org.jboss.as.server.deployment.DelegatingSupplier<org.jboss.as.network.SocketBinding>bindingprotected org.jboss.as.server.deployment.DelegatingSupplier<io.undertow.connector.ByteBufferPool>bufferPoolprotected static org.xnio.OptionMapcommonOptionsprotected org.xnio.OptionMaplistenerOptionsprotected io.undertow.server.OpenListeneropenListenerprotected org.jboss.as.server.deployment.DelegatingSupplier<org.jboss.as.network.SocketBinding>redirectSocketprotected org.jboss.as.server.deployment.DelegatingSupplier<Server>serverServiceprotected Consumer<ListenerService>serviceConsumerprotected org.xnio.OptionMapsocketOptionsprotected org.jboss.as.server.deployment.DelegatingSupplier<org.xnio.XnioWorker>worker
-
Constructor Summary
Constructors Modifier Constructor Description protectedListenerService(Consumer<ListenerService> serviceConsumer, String name, org.xnio.OptionMap listenerOptions, org.xnio.OptionMap socketOptions, boolean proxyProtocol)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidcleanFailedStart()protected abstract io.undertow.server.OpenListenercreateOpenListener()org.jboss.as.server.deployment.DelegatingSupplier<org.jboss.as.network.SocketBinding>getBinding()org.jboss.as.server.deployment.DelegatingSupplier<io.undertow.connector.ByteBufferPool>getBufferPool()StringgetName()Returns the listener nameio.undertow.server.OpenListenergetOpenListener()abstract StringgetProtocol()Returns the transport protocol.org.jboss.as.server.deployment.DelegatingSupplier<org.jboss.as.network.SocketBinding>getRedirectSocket()ServergetServer()Returns the server this listener is registered with.org.jboss.as.server.deployment.DelegatingSupplier<Server>getServerService()org.jboss.as.network.SocketBindinggetSocketBinding()Returns the listeners socket binding.protected io.undertow.protocols.ssl.UndertowXnioSslgetSsl()protected org.xnio.OptionMapgetSSLOptions(SSLContext sslContext)protected UndertowServicegetUndertowService()org.jboss.as.server.deployment.DelegatingSupplier<org.xnio.XnioWorker>getWorker()booleanisEnabled()abstract booleanisSecure()Returns true if the listener is secure.booleanisShutdown()Returns true if the listener has shut down.protected abstract voidpreStart(org.jboss.msc.service.StartContext context)protected voidregisterBinding()voidsetEnabled(boolean enabled)voidstart(org.jboss.msc.service.StartContext context)voidstop(org.jboss.msc.service.StopContext context)protected voidunregisterBinding()
-
-
-
Field Detail
-
commonOptions
protected static final org.xnio.OptionMap commonOptions
-
serviceConsumer
protected Consumer<ListenerService> serviceConsumer
-
worker
protected final org.jboss.as.server.deployment.DelegatingSupplier<org.xnio.XnioWorker> worker
-
binding
protected final org.jboss.as.server.deployment.DelegatingSupplier<org.jboss.as.network.SocketBinding> binding
-
redirectSocket
protected final org.jboss.as.server.deployment.DelegatingSupplier<org.jboss.as.network.SocketBinding> redirectSocket
-
bufferPool
protected final org.jboss.as.server.deployment.DelegatingSupplier<io.undertow.connector.ByteBufferPool> bufferPool
-
serverService
protected final org.jboss.as.server.deployment.DelegatingSupplier<Server> serverService
-
listenerOptions
protected final org.xnio.OptionMap listenerOptions
-
socketOptions
protected final org.xnio.OptionMap socketOptions
-
openListener
protected volatile io.undertow.server.OpenListener openListener
-
-
Constructor Detail
-
ListenerService
protected ListenerService(Consumer<ListenerService> serviceConsumer, String name, org.xnio.OptionMap listenerOptions, org.xnio.OptionMap socketOptions, boolean proxyProtocol)
-
-
Method Detail
-
getWorker
public org.jboss.as.server.deployment.DelegatingSupplier<org.xnio.XnioWorker> getWorker()
-
getBinding
public org.jboss.as.server.deployment.DelegatingSupplier<org.jboss.as.network.SocketBinding> getBinding()
-
getRedirectSocket
public org.jboss.as.server.deployment.DelegatingSupplier<org.jboss.as.network.SocketBinding> getRedirectSocket()
-
getBufferPool
public org.jboss.as.server.deployment.DelegatingSupplier<io.undertow.connector.ByteBufferPool> getBufferPool()
-
getServerService
public org.jboss.as.server.deployment.DelegatingSupplier<Server> getServerService()
-
getUndertowService
protected UndertowService getUndertowService()
-
getName
public String getName()
Description copied from interface:UndertowListenerReturns the listener name- Specified by:
getNamein interfaceUndertowListener- Returns:
- The listener name
-
getServer
public Server getServer()
Description copied from interface:UndertowListenerReturns the server this listener is registered with.- Specified by:
getServerin interfaceUndertowListener- Returns:
- the server this listener is registered with
-
isEnabled
public boolean isEnabled()
-
getSsl
protected io.undertow.protocols.ssl.UndertowXnioSsl getSsl()
-
getSSLOptions
protected org.xnio.OptionMap getSSLOptions(SSLContext sslContext)
-
setEnabled
public void setEnabled(boolean enabled)
-
isSecure
public abstract boolean isSecure()
Description copied from interface:UndertowListenerReturns true if the listener is secure. In general this will be true for HTTPS listeners, however other listener types may have been explicitly marked as secure.- Specified by:
isSecurein interfaceUndertowListener- Returns:
trueif the listener is considered security
-
registerBinding
protected void registerBinding()
-
unregisterBinding
protected void unregisterBinding()
-
preStart
protected abstract void preStart(org.jboss.msc.service.StartContext context)
-
start
public void start(org.jboss.msc.service.StartContext context) throws org.jboss.msc.service.StartException- Specified by:
startin interfaceorg.jboss.msc.Service- Throws:
org.jboss.msc.service.StartException
-
cleanFailedStart
protected abstract void cleanFailedStart()
-
stop
public void stop(org.jboss.msc.service.StopContext context)
- Specified by:
stopin interfaceorg.jboss.msc.Service
-
getOpenListener
public io.undertow.server.OpenListener getOpenListener()
-
createOpenListener
protected abstract io.undertow.server.OpenListener createOpenListener()
-
getProtocol
public abstract String getProtocol()
Description copied from interface:UndertowListenerReturns the transport protocol. This will generally either be http, https or ajp.- Specified by:
getProtocolin interfaceUndertowListener- Returns:
- The transport protocol
-
isShutdown
public boolean isShutdown()
Description copied from interface:UndertowListenerReturns true if the listener has shut down.- Specified by:
isShutdownin interfaceUndertowListener- Returns:
trueif the listener has been shutdown
-
getSocketBinding
public org.jboss.as.network.SocketBinding getSocketBinding()
Description copied from interface:UndertowListenerReturns the listeners socket binding.- Specified by:
getSocketBindingin interfaceUndertowListener- Returns:
- The listeners socket binding
-
-