edu.uci.isr.yancees.core
Class ProtocolManager

java.lang.Object
  extended by edu.uci.isr.yancees.core.ProtocolManager

public class ProtocolManager
extends java.lang.Object

There is only one instance of subscriptionManager per process (core or client) The protocol manager handles the creation of protocol plug-in instances, to be manipulated by the ProtocolAPI


Field Summary
protected  boolean print
           
 
Constructor Summary
protected ProtocolManager()
          Protected here prevents direct instantiation of this singleton but allows the extension of this class and the invocation of this construction by the specializatio class.
 
Method Summary
static ProtocolManager getInstance()
          The only way to access the unique instance of ProtocolManager is by using this access method
 ProtocolPluginInterface getNewUnsharedPluginIntance(java.lang.String protocolId, SubscriberInterface si)
          Creates a new instance of a protocol plug-in
 ProtocolPluginInterface getSharedPluginInstance(java.lang.String protocolId, SubscriberInterface si)
          This method allows the protocol mananger to share plug-in instances
 void setPluginManager(ProtocolPluginManagerInterface pm)
          Configures the plug-in manager to be used in the resoluiton of the tags in the incomming subscriptions.
 void terminateSharedProtocolPluginInstance(ProtocolPluginInterface pi)
          Terminates a shared plug-in instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

print

protected boolean print
Constructor Detail

ProtocolManager

protected ProtocolManager()
Protected here prevents direct instantiation of this singleton but allows the extension of this class and the invocation of this construction by the specializatio class.

Method Detail

getInstance

public static ProtocolManager getInstance()
The only way to access the unique instance of ProtocolManager is by using this access method

Returns:
the unique instance of this class.

setPluginManager

public void setPluginManager(ProtocolPluginManagerInterface pm)
Configures the plug-in manager to be used in the resoluiton of the tags in the incomming subscriptions.

Parameters:
pm - is the reference to the plug-in manager.

getSharedPluginInstance

public ProtocolPluginInterface getSharedPluginInstance(java.lang.String protocolId,
                                                       SubscriberInterface si)
                                                throws ProtocolManagerException
This method allows the protocol mananger to share plug-in instances

Parameters:
protocolId - is the name of the protocol to be created
si - is the subscriber interface that uniquely identifies the caller.
Returns:
an instance of the protocol plug-in with the respective name.
Throws:
ProtocolManagerException

getNewUnsharedPluginIntance

public ProtocolPluginInterface getNewUnsharedPluginIntance(java.lang.String protocolId,
                                                           SubscriberInterface si)
                                                    throws ProtocolManagerException
Creates a new instance of a protocol plug-in

Parameters:
protocolId - is the name of the protocol object to create
Returns:
an unshared protocol object instance
Throws:
ProtocolManagerException

terminateSharedProtocolPluginInstance

public void terminateSharedProtocolPluginInstance(ProtocolPluginInterface pi)
Terminates a shared plug-in instance. This method must be called when the plug-in is no longer necessary. The unshared protocol instances are automatically terminated.

Parameters:
pi - is a reference to the protocol plug-in to be terminated