eu.xtreemos.xosd.utilities.logger.storage
Class SimpleHandlerStorage

java.lang.Object
  extended by eu.xtreemos.xosd.utilities.logger.storage.SimpleHandlerStorage
All Implemented Interfaces:
IHandlerStorage

public class SimpleHandlerStorage
extends java.lang.Object
implements IHandlerStorage

simple storage for token handlers. implemented with Hashtable, the key is the handler's class, while the value is the handler itself.

Author:
uros

Field Summary
private  java.util.Hashtable<java.lang.Class,ITokenHandler> handlers
           
 
Constructor Summary
SimpleHandlerStorage()
           
 
Method Summary
 void add(ITokenHandler handler)
           
 int countHandlers()
           
 boolean exists(java.lang.Class type)
           
 IToken handle(java.lang.String raw)
          iterate over all handlers, the first handler capable of generating valid token stops the iteration.
 void remove(java.lang.Class type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

handlers

private java.util.Hashtable<java.lang.Class,ITokenHandler> handlers
Constructor Detail

SimpleHandlerStorage

public SimpleHandlerStorage()
Method Detail

add

public void add(ITokenHandler handler)
Specified by:
add in interface IHandlerStorage

handle

public IToken handle(java.lang.String raw)
iterate over all handlers, the first handler capable of generating valid token stops the iteration.

Specified by:
handle in interface IHandlerStorage

remove

public void remove(java.lang.Class type)
Specified by:
remove in interface IHandlerStorage

exists

public boolean exists(java.lang.Class type)
Specified by:
exists in interface IHandlerStorage

countHandlers

public int countHandlers()
Specified by:
countHandlers in interface IHandlerStorage