public abstract class AbstractProtocolService extends java.lang.Object implements ProtocolService
| Modifier and Type | Field and Description |
|---|---|
private boolean |
enabled
A flag set to tell if the server is enabled or not
|
private java.lang.String |
serviceId
The server ID
|
private java.lang.String |
serviceName
The service name
|
private boolean |
started
A flag set to indicate if the server is started or not
|
protected java.util.Set<Transport> |
transports
The service transports.
|
| Constructor and Description |
|---|
AbstractProtocolService() |
| Modifier and Type | Method and Description |
|---|---|
void |
addTransports(Transport... transports)
Add underlying transports
|
org.apache.mina.transport.socket.DatagramAcceptor |
getDatagramAcceptor(Transport udpTransport)
If this protocol service supports UDP transport then this gets the
non-null MINA DatagramAcceptor it uses.
|
java.lang.String |
getServiceId()
Gets the instance identifier for this ProtocolService.
|
java.lang.String |
getServiceName()
Gets a descriptive name for the kind of service this represents.
|
org.apache.mina.transport.socket.SocketAcceptor |
getSocketAcceptor(Transport tcpTransport)
If this protocol service support TCP transport then this gets the
MINA SocketAcceptor it uses.
|
Transport[] |
getTransports() |
boolean |
isEnabled()
Services can be enabled or disabled.
|
boolean |
isStarted()
Gets whether or not this service has been started.
|
void |
setEnabled(boolean enabled)
Sets whether or not this ProtocolService is enabled.
|
void |
setServiceId(java.lang.String serviceId)
Sets the instance identifier for this ProtocolService.
|
void |
setServiceName(java.lang.String name)
Sets the descriptive name for the kind of service this represents.
|
protected void |
setStarted(boolean started) |
void |
setTransports(Transport... transports)
Set the underlying transports
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitstart, stopprivate boolean started
private boolean enabled
private java.lang.String serviceId
private java.lang.String serviceName
protected java.util.Set<Transport> transports
public boolean isStarted()
isStarted in interface ProtocolServiceprotected void setStarted(boolean started)
started - The state of this serverpublic boolean isEnabled()
isEnabled in interface ProtocolServicepublic void setEnabled(boolean enabled)
setEnabled in interface ProtocolServiceenabled - true to enable, false to disablepublic java.lang.String getServiceId()
getServiceId in interface ProtocolServicepublic void setServiceId(java.lang.String serviceId)
setServiceId in interface ProtocolServiceserviceId - an identifier for the service instancepublic java.lang.String getServiceName()
getServiceName in interface ProtocolServicepublic void setServiceName(java.lang.String name)
setServiceName in interface ProtocolServicename - a descriptive name for the kind of this servicepublic Transport[] getTransports()
public void setTransports(Transport... transports)
transports - The transportspublic void addTransports(Transport... transports)
transports - The transportspublic org.apache.mina.transport.socket.DatagramAcceptor getDatagramAcceptor(Transport udpTransport)
getDatagramAcceptor in interface ProtocolServicepublic org.apache.mina.transport.socket.SocketAcceptor getSocketAcceptor(Transport tcpTransport)
getSocketAcceptor in interface ProtocolService