org.apache.jetspeed.om.registry.base
Class BaseClientRegistry

java.lang.Object
  extended byorg.apache.jetspeed.om.registry.base.BaseOrderedRegistry
      extended byorg.apache.jetspeed.om.registry.base.BaseClientRegistry
All Implemented Interfaces:
ClientRegistry, LocalRegistry, Registry

public class BaseClientRegistry
extends BaseOrderedRegistry
implements ClientRegistry

Simple implementation of the ClientRegistry interface.

Extends BaseRegistry implementation to override object creation method and ensure Registry object is synchronized with its persistence backend by delegating actual addition/deletion of objects to the registry service.

To avoid loops, a RegistryService implementation using this class nees to call the addLocalEntry/removeLocalEntry methods to modify the in memory state of this Registry

Version:
$Id: BaseClientRegistry.java,v 1.6 2005/03/21 18:21:37 sgala Exp $
Author:
Stephan Hesmer, Raphaël Luta

Field Summary
 
Fields inherited from class org.apache.jetspeed.om.registry.base.BaseOrderedRegistry
entries, idx
 
Constructor Summary
BaseClientRegistry()
           
 
Method Summary
 void addEntry(RegistryEntry entry)
          Add the given entry to the registry with the given name.
 RegistryEntry createEntry()
          Creates a new RegistryEntry instance compatible with the current Registry instance implementation
 ClientEntry findEntry(java.lang.String useragent)
          Returns the client which matches the given useragent string.
 void removeEntry(RegistryEntry entry)
          Removes the given entry from the Registry
 void removeEntry(java.lang.String name)
          Removes the given entry from the Registry
 void setEntry(RegistryEntry entry)
          Set the entry in the registry with the specified name and Entry
 
Methods inherited from class org.apache.jetspeed.om.registry.base.BaseOrderedRegistry
addLocalEntry, getEntries, getEntry, getEntryCount, hasEntry, listEntryNames, removeLocalEntry, removeLocalEntry, setLocalEntry, toArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.jetspeed.om.registry.Registry
getEntries, getEntry, getEntryCount, hasEntry, listEntryNames, toArray
 

Constructor Detail

BaseClientRegistry

public BaseClientRegistry()
Method Detail

setEntry

public void setEntry(RegistryEntry entry)
              throws InvalidEntryException
Description copied from interface: Registry
Set the entry in the registry with the specified name and Entry

Specified by:
setEntry in interface Registry
Overrides:
setEntry in class BaseOrderedRegistry
Throws:
InvalidEntryException
See Also:
Registry#setEntry

addEntry

public void addEntry(RegistryEntry entry)
              throws InvalidEntryException
Description copied from interface: Registry
Add the given entry to the registry with the given name.

Specified by:
addEntry in interface Registry
Overrides:
addEntry in class BaseOrderedRegistry
Throws:
InvalidEntryException
See Also:
Registry.addEntry(java.lang.String, org.apache.jetspeed.om.registry.RegistryEntry)

removeEntry

public void removeEntry(java.lang.String name)
Description copied from interface: Registry
Removes the given entry from the Registry

Specified by:
removeEntry in interface Registry
Overrides:
removeEntry in class BaseOrderedRegistry
See Also:
Registry.removeEntry(java.lang.String, java.lang.String)

removeEntry

public void removeEntry(RegistryEntry entry)
Description copied from interface: Registry
Removes the given entry from the Registry

Specified by:
removeEntry in interface Registry
Overrides:
removeEntry in class BaseOrderedRegistry
See Also:
Registry.removeEntry(java.lang.String, java.lang.String)

findEntry

public ClientEntry findEntry(java.lang.String useragent)
Returns the client which matches the given useragent string.

Specified by:
findEntry in interface ClientRegistry
Parameters:
useragent - the useragent to match
Returns:
the found client or null if the user-agent does not match any defined client

createEntry

public RegistryEntry createEntry()
Creates a new RegistryEntry instance compatible with the current Registry instance implementation

Specified by:
createEntry in interface Registry
Overrides:
createEntry in class BaseOrderedRegistry
Returns:
the newly created RegistryEntry


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.