|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.turbine.services.BaseInitable org.apache.turbine.services.BaseService org.apache.turbine.services.TurbineBaseService org.apache.jetspeed.services.registry.CastorRegistryService
This is an implementation of the RegistryService
based on the Castor XML serialization mechanisms
This registry aggregates multiple RegistryFragment to store the regsistry entries
This service expects the following properties to be set for correct operation:
Field Summary | |
static java.lang.String |
DEFAULT_EXTENSION
|
static java.lang.String |
DEFAULT_MAPPING
|
static int |
DEFAULT_REFRESH
|
protected java.util.Hashtable |
defaults
The list of default fragments stores for newly created objects |
protected java.lang.String |
directory
the base regsitry directory |
protected boolean |
enableMessaging
enable messaging |
protected java.util.Hashtable |
entryIndex
Associates entries with their fragments name for quick lookup |
protected java.lang.String |
extension
the extension for registry files |
protected org.apache.xml.serialize.OutputFormat |
format
the output format for pretty printing when saving registries |
protected java.util.Hashtable |
fragments
The Castor generated RegsitryFragment objects |
protected static JetspeedLogger |
logger
Static initialization of the logger for this class |
protected org.exolab.castor.mapping.Mapping |
mapping
the Castor mapping file name |
protected java.util.Hashtable |
registries
regsitry type keyed list of entries |
protected RegistryWatcher |
watcher
the Watcher object which monitors the regsitry directory |
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 | |
CastorRegistryService()
|
Method Summary | |
void |
addEntry(java.lang.String regName,
RegistryEntry entry)
Add a new RegistryEntry in the named Registry. |
RegistryEntry |
createEntry(java.lang.String regName)
Creates a new RegistryEntry instance compatible with the current Registry instance implementation |
void |
createFragment(java.lang.String name,
java.io.Reader reader,
boolean persistent)
Read and unmarshal a fragment in memory |
protected javax.jms.Message |
createMessage(java.lang.String registry,
java.lang.String entryName)
|
protected Registry |
createRegistry(java.lang.String name)
|
Registry |
get(java.lang.String regName)
Returns a Registry object for further manipulation |
RegistryEntry |
getEntry(java.lang.String regName,
java.lang.String entryName)
Returns a RegistryEntry from the named Registry. |
java.util.Map |
getFragmentMap()
|
java.util.Enumeration |
getNames()
List all the registry currently available to this service |
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 |
protected java.util.Map |
loadDatabaseManagedRegistries(org.apache.turbine.services.resources.ResourceService serviceConf)
|
void |
loadFragment(java.lang.String file)
Load and unmarshal a RegistryFragment from the file |
void |
onMessage(javax.jms.Message message)
|
void |
refresh()
Refresh the state of the registry implementation. |
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 regName,
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 |
removeFragment(java.lang.String file)
Remove a fragment from storage |
void |
saveEntry(java.lang.String regName,
RegistryEntry entry)
Saves a RegistryEntry to the named Registry. |
void |
saveFragment(java.lang.String file)
Marshal and save a RegistryFragment to disk |
void |
shutdown()
This is the shutdown method called by the Turbine Service framework |
protected void |
updateFragment(java.lang.String name,
RegistryFragment fragment)
Updates a fragment in storage and the associated entryIndex |
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 |
Field Detail |
protected static final JetspeedLogger logger
public static final int DEFAULT_REFRESH
public static final java.lang.String DEFAULT_EXTENSION
public static final java.lang.String DEFAULT_MAPPING
protected java.util.Hashtable registries
protected java.util.Hashtable fragments
protected java.util.Hashtable defaults
protected java.util.Hashtable entryIndex
protected RegistryWatcher watcher
protected org.exolab.castor.mapping.Mapping mapping
protected org.apache.xml.serialize.OutputFormat format
protected java.lang.String directory
protected java.lang.String extension
protected boolean enableMessaging
Constructor Detail |
public CastorRegistryService()
Method Detail |
public Registry get(java.lang.String regName)
get
in interface RegistryService
regName
- the name of the registry to fetch
public java.util.Enumeration getNames()
getNames
in interface RegistryService
public RegistryEntry createEntry(java.lang.String regName)
createEntry
in interface RegistryService
regName
- the name of the registry to use
public RegistryEntry getEntry(java.lang.String regName, java.lang.String entryName)
Registry.getEntry(java.lang.String)
getEntry
in interface RegistryService
regName
- the name of the registryentryName
- the name of the entry to retrieve from the
registry
public void addEntry(java.lang.String regName, RegistryEntry entry) throws RegistryException
Registry.addEntry(org.apache.jetspeed.om.registry.RegistryEntry)
addEntry
in interface RegistryService
regName
- the name of the registryentry
- the Registry entry to add
Sends
- a RegistryException if the manager can't add
the provided entry
RegistryException
public void removeEntry(java.lang.String regName, java.lang.String entryName)
Registry.removeEntry(org.apache.jetspeed.om.registry.RegistryEntry)
removeEntry
in interface RegistryService
regName
- the name of the registryentryName
- the name of the entry to removepublic void init(javax.servlet.ServletConfig conf) throws org.apache.turbine.services.InitializationException
Service
framework
org.apache.turbine.services.InitializationException
protected java.util.Map loadDatabaseManagedRegistries(org.apache.turbine.services.resources.ResourceService serviceConf)
protected Registry createRegistry(java.lang.String name)
public void init() throws org.apache.turbine.services.InitializationException
init
in interface org.apache.turbine.services.Initable
org.apache.turbine.services.InitializationException
public void shutdown()
Service
framework
shutdown
in interface org.apache.turbine.services.Initable
public void refresh()
refresh
in interface FileRegistry
public java.util.Map getFragmentMap()
getFragmentMap
in interface FileRegistry
public void loadFragment(java.lang.String file)
loadFragment
in interface FileRegistry
file
- the absolute file path storing this fragmentpublic void createFragment(java.lang.String name, java.io.Reader reader, boolean persistent)
createFragment
in interface FileRegistry
name
- the name of this fragmentreader
- the reader to use for creating this fragmentpersistent
- whether this fragment should be persisted on disk in
the registrypublic void saveFragment(java.lang.String file)
saveFragment
in interface FileRegistry
file
- the absolute file path storing this fragmentpublic void removeFragment(java.lang.String file)
removeFragment
in interface FileRegistry
file
- the absolute file path storing this fragmentprotected void updateFragment(java.lang.String name, RegistryFragment fragment)
protected void refresh(java.lang.String regName)
regName
- the name of the Registry to refreshpublic void saveEntry(java.lang.String regName, RegistryEntry entry) throws RegistryException
RegistryService
Registry.removeEntry(org.apache.jetspeed.om.registry.RegistryEntry)
saveEntry
in interface RegistryService
regName
- the name of the registryentry
- the name of the entry to remove
RegistryException
org.apache.jetspeed.services.registry.RegistryService#saveEntry(java.lang.String, java.lang.String)
protected javax.jms.Message createMessage(java.lang.String registry, java.lang.String entryName)
public void onMessage(javax.jms.Message message)
onMessage
in interface javax.jms.MessageListener
MessageListener.onMessage(javax.jms.Message)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |