org.jboss.messaging.core.remoting
Interface ConnectorRegistry

All Known Implementing Classes:
ConnectorRegistryImpl

public interface ConnectorRegistry

The ConnectorRegistry keeps track of Configurations and NIOConnectors. When a MinaService is started, it register its Configuration. When a client is created, it gets its NIOConnector from the ConnectorRegistry using the Configuration corresponding to the server it wants to connect to. If the ConnectionRegistry contains this Configuration, it implies that the Client is in the same VM than the server. In that case, we optimize by returning a INVMConnector regardless of the transport type defined by the Configuration

Version:
$Revision$
Author:
Jeff Mesnil

Method Summary
 void clear()
           
 NIOConnector getConnector(Location location, ConnectionParams connectionParams)
           
 int getConnectorCount(Location location)
           
 int getRegisteredConfigurationSize()
           
 boolean register(Location location, PacketDispatcher serverDispatcher)
           
 NIOConnector removeConnector(Location location)
          Decrement the number of references on the NIOConnector corresponding to the Configuration.
 boolean unregister(Location location)
           
 

Method Detail

register

boolean register(Location location,
                 PacketDispatcher serverDispatcher)
Returns:
true if this Configuration has not already been registered, false else

unregister

boolean unregister(Location location)
Returns:
true if this Configuration was registered, false else

getConnector

NIOConnector getConnector(Location location,
                          ConnectionParams connectionParams)

removeConnector

NIOConnector removeConnector(Location location)
Decrement the number of references on the NIOConnector corresponding to the Configuration. If there is only one reference, remove it from the connectors Map and returns it. Otherwise return null.

Parameters:
location - a Location
Returns:
the NIOConnector if there is no longer any references to it or null
Throws:
java.lang.IllegalStateException - if no NIOConnector were created for the given Configuration

getRegisteredConfigurationSize

int getRegisteredConfigurationSize()

getConnectorCount

int getConnectorCount(Location location)

clear

void clear()


Copyright © 2006 JBoss Inc. All Rights Reserved.