gr.uoa.di.madgik.commons.channel.registry
Class ChannelRegistry

java.lang.Object
  extended by gr.uoa.di.madgik.commons.channel.registry.ChannelRegistry

public class ChannelRegistry
extends java.lang.Object

ChannelRegistry is a utility class that acts as a container for channels. It is the main connector point so that outlets can locate inlets

Author:
gpapanikos

Constructor Summary
ChannelRegistry()
           
 
Method Summary
static ChannelRegistryKey Register(ChannelState State, INozzleConfig Config, java.lang.String RegisteringNozzle)
          Registers a channel and assigns it a referencable unique identifier.
static ChannelRegistryEntry Retrieve(ChannelRegistryKey Key)
          Retrieves the associated to a registry key entry
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChannelRegistry

public ChannelRegistry()
Method Detail

Register

public static ChannelRegistryKey Register(ChannelState State,
                                          INozzleConfig Config,
                                          java.lang.String RegisteringNozzle)
Registers a channel and assigns it a referencable unique identifier. the IChannelProxy.SetChannelRegistryKey(ChannelRegistryKey) is called so that now the inlet side of the channel has all the information needed to complete its instantiation of inlet side proxy able to identify fully the served channel. The cleanup module ChannelRegistryCleanUp is registered with events produced by the registered ChannelState so that it can cleanup the registry entries when the channel will be disposed.

Parameters:
State - the state that represents the main synchronization point
Config - the configuration of the created channel
RegisteringNozzle - the inlet nozzle
Returns:
the assigned channel registry key

Retrieve

public static ChannelRegistryEntry Retrieve(ChannelRegistryKey Key)
Retrieves the associated to a registry key entry

Parameters:
Key - The registry key of which to retrieve the entry
Returns:
The associated entry or null if the registry does not contain any record for the specific key