Modifier | Constructor and Description |
---|---|
protected |
ServerDecorator(Server server)
Constructs a new
ServerDecorator , to decorate the given Server . |
Modifier and Type | Method and Description |
---|---|
void |
addSessionObserver(org.macroing.cit.network.SessionObserver sessionObserver)
Adds
sessionObserver to the decorated Server , if absent. |
ServerConfiguration |
getServerConfiguration()
Returns the
ServerConfiguration provided by the decorated Server instance. |
java.util.List<org.macroing.cit.network.SessionObserver> |
getSessionObservers()
|
protected void |
onStart()
Overridden to call the method
start() for the decorated Server instance. |
protected void |
onStop()
Overridden to call the method
stop() for the decorated Server instance. |
void |
removeSessionObserver(org.macroing.cit.network.SessionObserver sessionObserver)
Removes
sessionObserver from the decorated Server , if present. |
protected ServerDecorator(Server server)
ServerDecorator
, to decorate the given Server
.
If server
is null
, a NullPointerException
will be thrown.
server
- the Server
to decoratejava.lang.NullPointerException
- thrown if, and only if, server
is null
public final java.util.List<org.macroing.cit.network.SessionObserver> getSessionObservers()
List
containing all SessionObserver
s currently added to the decorated Server
instance.
Modifying the returned List
will not affect this Server
instance. And it should not affect the decorated Server
instance either.
getSessionObservers
in class Server
List
containing all SessionObserver
s currently added to the decorated Server
instancepublic final ServerConfiguration getServerConfiguration()
ServerConfiguration
provided by the decorated Server
instance.getServerConfiguration
in class Server
ServerConfiguration
provided by the decorated Server
instancepublic final void addSessionObserver(org.macroing.cit.network.SessionObserver sessionObserver)
sessionObserver
to the decorated Server
, if absent.
If sessionObserver
is null
, a NullPointerException
will be thrown.
addSessionObserver
in class Server
sessionObserver
- the SessionObserver
to addjava.lang.NullPointerException
- thrown if, and only if, sessionObserver
is null
protected void onStart()
start()
for the decorated Server
instance.
If you need to do additional work before or after that, this method is open for extension. You should not forget to call super.onStart()
, however.
onStart
in class org.macroing.cit.messaging.Messaging
protected void onStop()
stop()
for the decorated Server
instance.
If you need to do additional work before or after that, this method is open for extension. You should not forget to call super.onStop()
, however.
onStop
in class org.macroing.cit.messaging.Messaging
public final void removeSessionObserver(org.macroing.cit.network.SessionObserver sessionObserver)
sessionObserver
from the decorated Server
, if present.
If sessionObserver
is null
, a NullPointerException
will be thrown.
removeSessionObserver
in class Server
sessionObserver
- the SessionObserver
to removejava.lang.NullPointerException
- thrown if, and only if, sessionObserver
is null