is.lill.acre.protocol
Class ProtocolManager

java.lang.Object
  extended by java.util.Observable
      extended by is.lill.acre.protocol.ProtocolManager

public class ProtocolManager
extends java.util.Observable

Class to manage protocols for an agent platform This is designed to be shared among all agents


Constructor Summary
ProtocolManager()
           
 
Method Summary
 void addProtocol(Protocol protocol)
          Add a Protocol to the manager
 void addRepository(IProtocolRepository repository)
           
 void addSource(IProtocolSource source)
          Add a single source to this manager, from which a protocol should be read
 Protocol getProtocolByDescriptor(ProtocolDescriptor pd)
          Given a protocol descriptor, get the associated protocol
 java.util.Collection<Protocol> getProtocols()
          Get all the protocols loaded
 java.util.Set<Protocol> getProtocolsMatchingDescriptor(ProtocolDescriptor pd)
           
 void removeProtocol(Protocol protocol)
          Unload a protocol from the manager
 int size()
          Get the number of protocols loaded
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProtocolManager

public ProtocolManager()
Method Detail

addSource

public void addSource(IProtocolSource source)
Add a single source to this manager, from which a protocol should be read

Parameters:
source -

size

public int size()
Get the number of protocols loaded

Returns:

addProtocol

public void addProtocol(Protocol protocol)
Add a Protocol to the manager

Parameters:
protocol -

getProtocols

public java.util.Collection<Protocol> getProtocols()
Get all the protocols loaded

Returns:

removeProtocol

public void removeProtocol(Protocol protocol)
Unload a protocol from the manager

Parameters:
protocol -

getProtocolByDescriptor

public Protocol getProtocolByDescriptor(ProtocolDescriptor pd)
Given a protocol descriptor, get the associated protocol

Parameters:
pd - Descriptor of the desired protocol
Returns:
The protocol described by the descriptor, or null if the protocol manager has no way of finding it.

getProtocolsMatchingDescriptor

public java.util.Set<Protocol> getProtocolsMatchingDescriptor(ProtocolDescriptor pd)

addRepository

public void addRepository(IProtocolRepository repository)
                   throws RepositoryException
Throws:
RepositoryException