org.apache.neethi
Class PolicyRegistryImpl

java.lang.Object
  extended by org.apache.neethi.PolicyRegistryImpl
All Implemented Interfaces:
PolicyRegistry

public class PolicyRegistryImpl
extends Object
implements PolicyRegistry

Provides a default implementation of PolicyRegistry interface.


Constructor Summary
PolicyRegistryImpl()
           
PolicyRegistryImpl(PolicyRegistry parent)
          Constructs a PolicyRegistryImpl with the specified PolicyRegistry as it's parent.
 
Method Summary
 PolicyRegistry getParent()
           
 Policy lookup(String key)
          Returns the Policy that the specified key is mapped.
 void register(String key, Policy policy)
          Associates a key with a Policy
 void remove(String key)
          Removes the mapping for this key if present.
 void setParent(PolicyRegistry parent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolicyRegistryImpl

public PolicyRegistryImpl()

PolicyRegistryImpl

public PolicyRegistryImpl(PolicyRegistry parent)
Constructs a PolicyRegistryImpl with the specified PolicyRegistry as it's parent. If it can't lookup a Policy in it's own registry then it lookup in the parent and returns the results.

Parameters:
parent - the Parent of this PolicyRegistry
Method Detail

lookup

public Policy lookup(String key)
Description copied from interface: PolicyRegistry
Returns the Policy that the specified key is mapped. Returns null if no Policy is associated with that key.

Specified by:
lookup in interface PolicyRegistry
Parameters:
key - the key whose associated Policy is to be returned.
Returns:
the policy associated with the specified key.

register

public void register(String key,
                     Policy policy)
Description copied from interface: PolicyRegistry
Associates a key with a Policy

Specified by:
register in interface PolicyRegistry
Parameters:
key - the key that the specified Policy to be associated
policy - the policy to be associated with the key

remove

public void remove(String key)
Description copied from interface: PolicyRegistry
Removes the mapping for this key if present.

Specified by:
remove in interface PolicyRegistry
Parameters:
key - the key whose mapping is to be removed

setParent

public void setParent(PolicyRegistry parent)

getParent

public PolicyRegistry getParent()


Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.