public class SimpleServiceRegistry extends java.lang.Object implements ServiceRegistry
ServiceRegistry
.
This service registry supports socket, datagram, VM-pipe transport types,
and thread pools were added by default.Modifier and Type | Field and Description |
---|---|
protected IoAcceptor |
datagramIoAcceptor |
protected ProtocolAcceptor |
datagramProtocolAcceptor |
protected IoThreadPoolFilter |
ioThreadPoolFilter |
protected ProtocolThreadPoolFilter |
protocolThreadPoolFilter |
protected IoAcceptor |
socketIoAcceptor |
protected ProtocolAcceptor |
socketProtocolAcceptor |
protected ProtocolAcceptor |
vmPipeAcceptor |
Constructor and Description |
---|
SimpleServiceRegistry() |
Modifier and Type | Method and Description |
---|---|
void |
bind(Service service,
IoHandler ioHandler)
Binds the specified I/O handler to the specified service.
|
void |
bind(Service service,
ProtocolProvider protocolProvider)
Binds the specified protocol provider to the specified service.
|
protected IoAcceptor |
findIoAcceptor(TransportType transportType) |
protected ProtocolAcceptor |
findProtocolAcceptor(TransportType transportType) |
java.util.Set |
getAllServices()
Returns
Set of all services bound in this registry. |
IoAcceptor |
getIoAcceptor(TransportType transportType) |
ProtocolAcceptor |
getProtocolAcceptor(TransportType transportType) |
java.util.Set |
getServices(int port)
Returns
Set of services bound in this registry with the
specified port number. |
java.util.Set |
getServices(java.lang.String name)
Returns
Set of services bound in this registry with the
specified service(or protocol) name. |
java.util.Set |
getServices(TransportType transportType)
Returns
Set of services bound in this registry with the
specified transport type. |
void |
unbind(Service service)
Unbinds the specified service (and its aggregated I/O handler or
protocol provider).
|
void |
unbindAll()
Unbinds all services (and their aggregated I/O handlers or
protocol providers).
|
protected final IoAcceptor socketIoAcceptor
protected final IoAcceptor datagramIoAcceptor
protected final ProtocolAcceptor socketProtocolAcceptor
protected final ProtocolAcceptor datagramProtocolAcceptor
protected final ProtocolAcceptor vmPipeAcceptor
protected final IoThreadPoolFilter ioThreadPoolFilter
protected final ProtocolThreadPoolFilter protocolThreadPoolFilter
public void bind(Service service, IoHandler ioHandler) throws java.io.IOException
ServiceRegistry
bind
in interface ServiceRegistry
java.io.IOException
public void bind(Service service, ProtocolProvider protocolProvider) throws java.io.IOException
ServiceRegistry
bind
in interface ServiceRegistry
java.io.IOException
public void unbind(Service service)
ServiceRegistry
unbind
in interface ServiceRegistry
public void unbindAll()
ServiceRegistry
unbindAll
in interface ServiceRegistry
public IoAcceptor getIoAcceptor(TransportType transportType)
getIoAcceptor
in interface ServiceRegistry
public ProtocolAcceptor getProtocolAcceptor(TransportType transportType)
getProtocolAcceptor
in interface ServiceRegistry
public java.util.Set getAllServices()
ServiceRegistry
Set
of all services bound in this registry.getAllServices
in interface ServiceRegistry
public java.util.Set getServices(java.lang.String name)
ServiceRegistry
Set
of services bound in this registry with the
specified service(or protocol) name.getServices
in interface ServiceRegistry
public java.util.Set getServices(TransportType transportType)
ServiceRegistry
Set
of services bound in this registry with the
specified transport type.getServices
in interface ServiceRegistry
public java.util.Set getServices(int port)
ServiceRegistry
Set
of services bound in this registry with the
specified port number.getServices
in interface ServiceRegistry
protected IoAcceptor findIoAcceptor(TransportType transportType)
protected ProtocolAcceptor findProtocolAcceptor(TransportType transportType)