org.jboss.messaging.core.settings.impl
Class HierarchicalObjectRepository<T>

java.lang.Object
  extended by org.jboss.messaging.core.settings.impl.HierarchicalObjectRepository<T>
All Implemented Interfaces:
HierarchicalRepository<T>

public class HierarchicalObjectRepository<T>
extends java.lang.Object
implements HierarchicalRepository<T>

allows objects to be mapped against a regex pattern and held in order in a list

Author:
Andy Taylor, Tim Fox

Constructor Summary
HierarchicalObjectRepository()
           
 
Method Summary
 void addMatch(java.lang.String match, T value)
          Add a new match to the repository
 T getMatch(java.lang.String match)
          return the value held against the nearest match
 void registerListener(HierarchicalRepositoryChangeListener listener)
          register a listener to listen for changes in the repository
 void removeMatch(java.lang.String match)
          remove a match from the repository
 void setDefault(T defaultValue)
          set the default value to fallback to if none found
 void unRegisterListener(HierarchicalRepositoryChangeListener listener)
          unregister a listener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HierarchicalObjectRepository

public HierarchicalObjectRepository()
Method Detail

addMatch

public void addMatch(java.lang.String match,
                     T value)
Add a new match to the repository

Specified by:
addMatch in interface HierarchicalRepository<T>
Parameters:
match - The regex to use to match against
value - the value to hold agains the match

getMatch

public T getMatch(java.lang.String match)
return the value held against the nearest match

Specified by:
getMatch in interface HierarchicalRepository<T>
Parameters:
match - the match to look for
Returns:
the value

removeMatch

public void removeMatch(java.lang.String match)
remove a match from the repository

Specified by:
removeMatch in interface HierarchicalRepository<T>
Parameters:
match - the match to remove

registerListener

public void registerListener(HierarchicalRepositoryChangeListener listener)
Description copied from interface: HierarchicalRepository
register a listener to listen for changes in the repository

Specified by:
registerListener in interface HierarchicalRepository<T>

unRegisterListener

public void unRegisterListener(HierarchicalRepositoryChangeListener listener)
Description copied from interface: HierarchicalRepository
unregister a listener

Specified by:
unRegisterListener in interface HierarchicalRepository<T>

setDefault

public void setDefault(T defaultValue)
set the default value to fallback to if none found

Specified by:
setDefault in interface HierarchicalRepository<T>
Parameters:
defaultValue - the value


Copyright © 2006 JBoss Inc. All Rights Reserved.