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>
binding
protected org.jboss.as.server.deployment.DelegatingSupplier<io.undertow.connector.ByteBufferPool>
bufferPool
protected static org.xnio.OptionMap
commonOptions
protected org.xnio.OptionMap
listenerOptions
protected io.undertow.server.OpenListener
openListener
protected org.jboss.as.server.deployment.DelegatingSupplier<org.jboss.as.network.SocketBinding>
redirectSocket
protected org.jboss.as.server.deployment.DelegatingSupplier<Server>
serverService
protected Consumer<ListenerService>
serviceConsumer
protected org.xnio.OptionMap
socketOptions
protected org.jboss.as.server.deployment.DelegatingSupplier<org.xnio.XnioWorker>
worker
-
Constructor Summary
Constructors Modifier Constructor Description protected
ListenerService(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 void
cleanFailedStart()
protected abstract io.undertow.server.OpenListener
createOpenListener()
org.jboss.as.server.deployment.DelegatingSupplier<org.jboss.as.network.SocketBinding>
getBinding()
org.jboss.as.server.deployment.DelegatingSupplier<io.undertow.connector.ByteBufferPool>
getBufferPool()
String
getName()
Returns the listener nameio.undertow.server.OpenListener
getOpenListener()
abstract String
getProtocol()
Returns the transport protocol.org.jboss.as.server.deployment.DelegatingSupplier<org.jboss.as.network.SocketBinding>
getRedirectSocket()
Server
getServer()
Returns the server this listener is registered with.org.jboss.as.server.deployment.DelegatingSupplier<Server>
getServerService()
org.jboss.as.network.SocketBinding
getSocketBinding()
Returns the listeners socket binding.protected io.undertow.protocols.ssl.UndertowXnioSsl
getSsl()
protected org.xnio.OptionMap
getSSLOptions(SSLContext sslContext)
protected UndertowService
getUndertowService()
org.jboss.as.server.deployment.DelegatingSupplier<org.xnio.XnioWorker>
getWorker()
boolean
isEnabled()
abstract boolean
isSecure()
Returns true if the listener is secure.boolean
isShutdown()
Returns true if the listener has shut down.protected abstract void
preStart(org.jboss.msc.service.StartContext context)
protected void
registerBinding()
void
setEnabled(boolean enabled)
void
start(org.jboss.msc.service.StartContext context)
void
stop(org.jboss.msc.service.StopContext context)
protected void
unregisterBinding()
-
-
-
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:UndertowListener
Returns the listener name- Specified by:
getName
in interfaceUndertowListener
- Returns:
- The listener name
-
getServer
public Server getServer()
Description copied from interface:UndertowListener
Returns the server this listener is registered with.- Specified by:
getServer
in 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:UndertowListener
Returns 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:
isSecure
in interfaceUndertowListener
- Returns:
true
if 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:
start
in 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:
stop
in 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:UndertowListener
Returns the transport protocol. This will generally either be http, https or ajp.- Specified by:
getProtocol
in interfaceUndertowListener
- Returns:
- The transport protocol
-
isShutdown
public boolean isShutdown()
Description copied from interface:UndertowListener
Returns true if the listener has shut down.- Specified by:
isShutdown
in interfaceUndertowListener
- Returns:
true
if the listener has been shutdown
-
getSocketBinding
public org.jboss.as.network.SocketBinding getSocketBinding()
Description copied from interface:UndertowListener
Returns the listeners socket binding.- Specified by:
getSocketBinding
in interfaceUndertowListener
- Returns:
- The listeners socket binding
-
-