org.apache.jetspeed.services.registry
Class HybridRegistryService

java.lang.Object
  extended byorg.apache.turbine.services.BaseInitable
      extended byorg.apache.turbine.services.BaseService
          extended byorg.apache.turbine.services.TurbineBaseService
              extended byorg.apache.jetspeed.services.registry.CastorRegistryService
                  extended byorg.apache.jetspeed.services.registry.HybridRegistryService
All Implemented Interfaces:
FileRegistry, HybridRegistry, org.apache.turbine.services.Initable, javax.jms.MessageListener, RegistryService, org.apache.turbine.services.Service

public class HybridRegistryService
extends CastorRegistryService
implements HybridRegistry

Implements the Jetspeed Registry Service interface, with a hybrid of Database and File-based (Castor) Registry storage. Allows user to store some registries in the database, and others on the file system.

Version:
$Id: HybridRegistryService.java,v 1.12 2004/08/05 04:27:03 jford Exp $
Author:
David Sean Taylor

Field Summary
 
Fields inherited from class org.apache.jetspeed.services.registry.CastorRegistryService
DEFAULT_EXTENSION, DEFAULT_MAPPING, DEFAULT_REFRESH, defaults, directory, enableMessaging, entryIndex, extension, format, fragments, mapping, registries, watcher
 
Fields inherited from class org.apache.turbine.services.BaseService
configuration, name, properties, serviceBroker
 
Fields inherited from class org.apache.turbine.services.BaseInitable
initableBroker, isInitialized
 
Fields inherited from interface org.apache.jetspeed.services.registry.RegistryService
SERVICE_NAME
 
Constructor Summary
HybridRegistryService()
           
 
Method Summary
 void addEntry(java.lang.String registryName, RegistryEntry entry)
          Add a new RegistryEntry in the named Registry.
 RegistryEntry createEntry(java.lang.String registryName)
          Creates a new RegistryEntry instance compatible with the current Registry instance implementation
 Registry get(java.lang.String registryName)
          Returns a Registry object for further manipulation
 RegistryEntry getEntry(java.lang.String registryName, java.lang.String entryName)
          Returns a RegistryEntry from the named Registry.
 java.util.Enumeration getNames()
          List all the registry currently available to this service
 boolean getReplaceImportedEntries()
           
 void init()
          Late init method from Turbine Service model
 void init(javax.servlet.ServletConfig conf)
          This is the early initialization method called by the Turbine Service framework
 java.util.List listDatabaseRegistries()
          List of all registries managed in the database.
 java.util.List listFileRegistries()
          List of all registries managed in the file system.
 void onMessage(javax.jms.Message message)
           
protected  void refresh(java.lang.String regName)
          Scan all the registry fragments for new entries relevant to this registry and update its definition.
 void removeEntry(java.lang.String registryName, java.lang.String entryName)
          Deletes a RegistryEntry from the named Registry This is a convenience wrapper around Registry.removeEntry(org.apache.jetspeed.om.registry.RegistryEntry)
 void saveEntry(java.lang.String registryName, RegistryEntry entry)
          Saves a RegistryEntry to the named Registry.
 void shutdown()
          This is the shutdown method called by the Turbine Service framework
 
Methods inherited from class org.apache.jetspeed.services.registry.CastorRegistryService
createFragment, createMessage, createRegistry, getFragmentMap, loadDatabaseManagedRegistries, loadFragment, refresh, removeFragment, saveFragment, updateFragment
 
Methods inherited from class org.apache.turbine.services.TurbineBaseService
init, init
 
Methods inherited from class org.apache.turbine.services.BaseService
getConfiguration, getName, getProperties, getServiceBroker, setName, setServiceBroker
 
Methods inherited from class org.apache.turbine.services.BaseInitable
getInit, getInitableBroker, setInit, setInitableBroker
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.turbine.services.Service
getConfiguration, getName, getProperties, setName, setServiceBroker
 
Methods inherited from interface org.apache.turbine.services.Initable
getInit, init, setInitableBroker
 

Constructor Detail

HybridRegistryService

public HybridRegistryService()
Method Detail

init

public void init(javax.servlet.ServletConfig conf)
          throws org.apache.turbine.services.InitializationException
This is the early initialization method called by the Turbine Service framework

Overrides:
init in class CastorRegistryService
Throws:
org.apache.turbine.services.InitializationException

getReplaceImportedEntries

public boolean getReplaceImportedEntries()

getNames

public java.util.Enumeration getNames()
Description copied from class: CastorRegistryService
List all the registry currently available to this service

Specified by:
getNames in interface RegistryService
Overrides:
getNames in class CastorRegistryService
Returns:
an Enumeration of registry names.

listDatabaseRegistries

public java.util.List listDatabaseRegistries()
Description copied from interface: HybridRegistry
List of all registries managed in the database.

Specified by:
listDatabaseRegistries in interface HybridRegistry

listFileRegistries

public java.util.List listFileRegistries()
Description copied from interface: HybridRegistry
List of all registries managed in the file system.

Specified by:
listFileRegistries in interface HybridRegistry

get

public Registry get(java.lang.String registryName)
Description copied from class: CastorRegistryService
Returns a Registry object for further manipulation

Specified by:
get in interface RegistryService
Overrides:
get in class CastorRegistryService
Parameters:
registryName - the name of the registry to fetch
Returns:
a Registry object if found by the manager or null

createEntry

public RegistryEntry createEntry(java.lang.String registryName)
Description copied from class: CastorRegistryService
Creates a new RegistryEntry instance compatible with the current Registry instance implementation

Specified by:
createEntry in interface RegistryService
Overrides:
createEntry in class CastorRegistryService
Parameters:
registryName - the name of the registry to use
Returns:
the newly created RegistryEntry

getEntry

public RegistryEntry getEntry(java.lang.String registryName,
                              java.lang.String entryName)
Description copied from class: CastorRegistryService
Returns a RegistryEntry from the named Registry. This is a convenience wrapper around Registry.getEntry(java.lang.String)

Specified by:
getEntry in interface RegistryService
Overrides:
getEntry in class CastorRegistryService
Parameters:
registryName - the name of the registry
entryName - the name of the entry to retrieve from the registry
Returns:
a RegistryEntry object if the key is found or null

addEntry

public void addEntry(java.lang.String registryName,
                     RegistryEntry entry)
              throws RegistryException
Description copied from class: CastorRegistryService
Add a new RegistryEntry in the named Registry. This is a convenience wrapper around Registry.addEntry(org.apache.jetspeed.om.registry.RegistryEntry)

Specified by:
addEntry in interface RegistryService
Overrides:
addEntry in class CastorRegistryService
Parameters:
registryName - the name of the registry
entry - the Registry entry to add
Throws:
RegistryException

removeEntry

public void removeEntry(java.lang.String registryName,
                        java.lang.String entryName)
Description copied from class: CastorRegistryService
Deletes a RegistryEntry from the named Registry This is a convenience wrapper around Registry.removeEntry(org.apache.jetspeed.om.registry.RegistryEntry)

Specified by:
removeEntry in interface RegistryService
Overrides:
removeEntry in class CastorRegistryService
Parameters:
registryName - the name of the registry
entryName - the name of the entry to remove

saveEntry

public void saveEntry(java.lang.String registryName,
                      RegistryEntry entry)
               throws RegistryException
Description copied from interface: RegistryService
Saves a RegistryEntry to the named Registry. This should save the entry immediately to the underlying storage mechanism. This is a convenience wrapper around Registry.removeEntry(org.apache.jetspeed.om.registry.RegistryEntry)

Specified by:
saveEntry in interface RegistryService
Overrides:
saveEntry in class CastorRegistryService
Throws:
RegistryException
See Also:
org.apache.jetspeed.services.registry.RegistryService#saveEntry(java.lang.String, java.lang.String)

refresh

protected void refresh(java.lang.String regName)
Description copied from class: CastorRegistryService
Scan all the registry fragments for new entries relevant to this registry and update its definition.

Overrides:
refresh in class CastorRegistryService
Parameters:
regName - the name of the Registry to refresh

init

public void init()
          throws org.apache.turbine.services.InitializationException
Late init method from Turbine Service model

Specified by:
init in interface org.apache.turbine.services.Initable
Overrides:
init in class CastorRegistryService
Throws:
org.apache.turbine.services.InitializationException

shutdown

public void shutdown()
This is the shutdown method called by the Turbine Service framework

Specified by:
shutdown in interface org.apache.turbine.services.Initable
Overrides:
shutdown in class CastorRegistryService

onMessage

public void onMessage(javax.jms.Message message)
Specified by:
onMessage in interface javax.jms.MessageListener
Overrides:
onMessage in class CastorRegistryService
See Also:
MessageListener.onMessage(javax.jms.Message)


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