org.apache.mina.registry
Class SimpleServiceRegistry

java.lang.Object
  extended by org.apache.mina.registry.SimpleServiceRegistry
All Implemented Interfaces:
ServiceRegistry

public class SimpleServiceRegistry
extends Object
implements ServiceRegistry

A simple implementation of ServiceRegistry. This service registry supports socket, datagram, VM-pipe transport types, and thread pools were added by default.

Version:
$Rev: 332218 $, $Date: 2005-11-10 12:52:42 +0900 $,
Author:
The Apache Directory Project (dev@directory.apache.org)

Field Summary
protected  IoAcceptor datagramIoAcceptor
           
protected  ProtocolAcceptor datagramProtocolAcceptor
           
protected  IoThreadPoolFilter ioThreadPoolFilter
           
protected  ProtocolThreadPoolFilter protocolThreadPoolFilter
           
protected  IoAcceptor socketIoAcceptor
           
protected  ProtocolAcceptor socketProtocolAcceptor
           
protected  ProtocolAcceptor vmPipeAcceptor
           
 
Constructor Summary
SimpleServiceRegistry()
           
 
Method Summary
 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)
           
 Set getAllServices()
          Returns Set of all services bound in this registry.
 IoAcceptor getIoAcceptor(TransportType transportType)
           
 ProtocolAcceptor getProtocolAcceptor(TransportType transportType)
           
 Set getServices(int port)
          Returns Set of services bound in this registry with the specified port number.
 Set getServices(String name)
          Returns Set of services bound in this registry with the specified service(or protocol) name.
 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).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

socketIoAcceptor

protected final IoAcceptor socketIoAcceptor

datagramIoAcceptor

protected final IoAcceptor datagramIoAcceptor

socketProtocolAcceptor

protected final ProtocolAcceptor socketProtocolAcceptor

datagramProtocolAcceptor

protected final ProtocolAcceptor datagramProtocolAcceptor

vmPipeAcceptor

protected final ProtocolAcceptor vmPipeAcceptor

ioThreadPoolFilter

protected final IoThreadPoolFilter ioThreadPoolFilter

protocolThreadPoolFilter

protected final ProtocolThreadPoolFilter protocolThreadPoolFilter
Constructor Detail

SimpleServiceRegistry

public SimpleServiceRegistry()
Method Detail

bind

public void bind(Service service,
                 IoHandler ioHandler)
          throws IOException
Description copied from interface: ServiceRegistry
Binds the specified I/O handler to the specified service.

Specified by:
bind in interface ServiceRegistry
Throws:
IOException

bind

public void bind(Service service,
                 ProtocolProvider protocolProvider)
          throws IOException
Description copied from interface: ServiceRegistry
Binds the specified protocol provider to the specified service.

Specified by:
bind in interface ServiceRegistry
Throws:
IOException

unbind

public void unbind(Service service)
Description copied from interface: ServiceRegistry
Unbinds the specified service (and its aggregated I/O handler or protocol provider).

Specified by:
unbind in interface ServiceRegistry

unbindAll

public void unbindAll()
Description copied from interface: ServiceRegistry
Unbinds all services (and their aggregated I/O handlers or protocol providers).

Specified by:
unbindAll in interface ServiceRegistry

getIoAcceptor

public IoAcceptor getIoAcceptor(TransportType transportType)
Specified by:
getIoAcceptor in interface ServiceRegistry

getProtocolAcceptor

public ProtocolAcceptor getProtocolAcceptor(TransportType transportType)
Specified by:
getProtocolAcceptor in interface ServiceRegistry

getAllServices

public Set getAllServices()
Description copied from interface: ServiceRegistry
Returns Set of all services bound in this registry.

Specified by:
getAllServices in interface ServiceRegistry

getServices

public Set getServices(String name)
Description copied from interface: ServiceRegistry
Returns Set of services bound in this registry with the specified service(or protocol) name.

Specified by:
getServices in interface ServiceRegistry

getServices

public Set getServices(TransportType transportType)
Description copied from interface: ServiceRegistry
Returns Set of services bound in this registry with the specified transport type.

Specified by:
getServices in interface ServiceRegistry

getServices

public Set getServices(int port)
Description copied from interface: ServiceRegistry
Returns Set of services bound in this registry with the specified port number.

Specified by:
getServices in interface ServiceRegistry

findIoAcceptor

protected IoAcceptor findIoAcceptor(TransportType transportType)

findProtocolAcceptor

protected ProtocolAcceptor findProtocolAcceptor(TransportType transportType)


Copyright © 2004-2005 . All Rights Reserved.