All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.jaw.impl.agent.services.persistent.PersistentRepSrv

java.lang.Object
   |
   +----com.sun.jaw.impl.agent.services.light.RepositorySrv
           |
           +----com.sun.jaw.impl.agent.services.persistent.PersistentRepSrv

public class PersistentRepSrv
extends RepositorySrv
implements MoRepSrvIf, ResolveLoaderIf
This class provides an implementation of a persistent repository. The repository contains a mixture of volatile and persistent m-beans. The repository stores volatile m-beans in memory. It stores persistent m-beans in a flat-file database. The framework should be the first object to register with the repository, enabling the synchronization of m-beans with the current framework. To enable framework synchronization the repository has to be a trusted class. i.e. It must be loaded by the premordial(system) classloader. Each persistent m-bean is stored as a serialized Java object. For each persistent m-bean, the repository stores:

The repository stores the object name of the class loader to enable it to locate the class loader when an agent deserializes the m-bean. To locate a class loader, the repository internally invokes these methods:

Note - Use the setConfig method to configure the repository before trying to register any m-beans with it.

See Also:
MoRepSrvIf, ObjectInputStream, ObjectOutputStream, Serializable, Externalizable

Constructor Index

 o PersistentRepSrv()
Default constructor.

Method Index

 o contains(Object)
Verifies whether a singleton m-bean is registered with the repository.
 o contains(ObjectName)
Verifies whether an m-bean is registered with the repository.
 o getDomain()
Gets the domain of the repository.
 o getNbElements()
Gets the number of m-beans registered with the repository.
 o getObject(ObjectName, QueryExp)
Gets handles on m-beans controlled by the repository.
 o isPersistent()
Indicates whether the repository offers persistent storage.
 o isQuerySrv()
Indicates whether the repository supports filtering.
 o register(Object, ObjectName)
Invoked by the core management framework to register a volatile m-bean with the repository.
 o registerDB(Object, ObjectName)
Invoked by the core management framework to register a persistent m-bean with the repository.
 o resolveClassLoader(ObjectName)
Gets the class loader associated with an m-bean that is being deserialized.
 o retrieve(ObjectName)
Retrieves an m-bean from the repository.
 o retrieveClassLoaderName(ClassLoader)
Gets the object name of a class loader.
 o setConfig(Vector)
Configures the repository and starts the database.
 o setDomain(String)
Sets the domain of the repository.
 o stop()
Stop the repository and release allocated resources.
 o unregister(Object)
Removes a singleton m-bean from the repository.
 o unregister(ObjectName)
Removes an m-bean from the repository.
 o update(Object, ObjectName)
Updates an m-bean registered with the repository.

Constructors

 o PersistentRepSrv
 public PersistentRepSrv()
Default constructor.

Methods

 o setConfig
 public void setConfig(Vector params)
Configures the repository and starts the database.

The configuration parameters must be specified in the following order:

All parameters are String objects or null if not specified. If the parameter vector is empty or null, default values are used.

Parameters:
params - A vector containing the configuration parameters of the repository.
Overrides:
setConfig in class RepositorySrv
 o isQuerySrv
 public boolean isQuerySrv()
Indicates whether the repository supports filtering. If the repository does not support filtering, the core management framework will perform filtering for the repository.

Returns:
True if the filtering is supported, false otherwise.
Overrides:
isQuerySrv in class RepositorySrv
 o isPersistent
 public boolean isPersistent()
Indicates whether the repository offers persistent storage.

Returns:
True if the repository offers persistent storage, false otherwise.
Overrides:
isPersistent in class RepositorySrv
 o contains
 public boolean contains(ObjectName name)
Verifies whether an m-bean is registered with the repository.

Parameters:
name - The object name of the m-bean.
Returns:
True if the m-bean is registered with the repository, false otherwise.
Overrides:
contains in class RepositorySrv
 o retrieve
 public Object retrieve(ObjectName name)
Retrieves an m-bean from the repository.

Parameters:
name - The object name of the m-bean to be retrieved.
Returns:
The retrieved m-bean, or null if it could not be retrieved.
Overrides:
retrieve in class RepositorySrv
 o contains
 public boolean contains(Object object)
Verifies whether a singleton m-bean is registered with the repository. A singleton m-bean has no search key in its object name and is, therefore, the only instance of the class permitted in the domain.

Parameters:
object - The m-bean.
Returns:
True if the m-bean is registered with the repository, false otherwise.
Overrides:
contains in class RepositorySrv
 o registerDB
 public void registerDB(Object object,
                        ObjectName name) throws InstanceAlreadyExistException
Invoked by the core management framework to register a persistent m-bean with the repository.

Parameters:
object - The m-bean to be registered.
name - The object name with which the m-bean is to be registered.
Throws: InstanceAlreadyExistException
The m-bean is already registered in the object repository.
Overrides:
registerDB in class RepositorySrv
 o register
 public void register(Object object,
                      ObjectName name) throws InstanceAlreadyExistException
Invoked by the core management framework to register a volatile m-bean with the repository.

Parameters:
object - The m-bean to be registered.
name - The object name with which the m-bean is to be registered.
Throws: InstanceAlreadyExistException
The m-bean is already registered in the repository.
Overrides:
register in class RepositorySrv
 o update
 public void update(Object object,
                    ObjectName name) throws InstanceNotFoundException
Updates an m-bean registered with the repository.

Parameters:
object - The new instance of the m-bean.
name - The object name of the m-bean to be updated.
Throws: InstanceNotFoundException
The specified m-bean was not found in the repository.
Overrides:
update in class RepositorySrv
 o unregister
 public void unregister(ObjectName name) throws InstanceNotFoundException
Removes an m-bean from the repository.

Parameters:
name - The object name of the m-bean to be removed.
Throws: InstanceNotFoundException
The specified m-bean was not found in the repository.
Overrides:
unregister in class RepositorySrv
 o unregister
 public void unregister(Object object) throws InstanceNotFoundException
Removes a singleton m-bean from the repository. A singleton m-bean has no search key in its object name and is, therefore, the only instance of the class permitted in the domain.

Parameters:
object - The m-bean to be removed from the repository.
Throws: InstanceNotFoundException
The specified m-bean was not found in the repository.
Overrides:
unregister in class RepositorySrv
 o getObject
 public Vector getObject(ObjectName name,
                         QueryExp query)
Gets handles on m-beans controlled by the repository.

Parameters:
name - An object name that specifies the m-beans to be selected.
query - A query to be applied to the selected m-beans.
Returns:
A list of named objects corresponding to the selected m-beans.
Overrides:
getObject in class RepositorySrv
 o getNbElements
 public Integer getNbElements()
Gets the number of m-beans registered with the repository.

Returns:
The number of m-beans registered with the repository.
Overrides:
getNbElements in class RepositorySrv
 o getDomain
 public String getDomain()
Gets the domain of the repository.

Returns:
The domain of the repository.
Overrides:
getDomain in class RepositorySrv
 o setDomain
 public void setDomain(String domain)
Sets the domain of the repository.

Overrides:
setDomain in class RepositorySrv
 o resolveClassLoader
 public ClassLoader resolveClassLoader(ObjectName aloader)
Gets the class loader associated with an m-bean that is being deserialized. It is the class loader that loaded the m-bean when it was instantiated. The repository internally invokes this method when the m-bean is deserialized. The method searches the repository to find the class loader.

Parameters:
aloader - The object name of the class loader.
Returns:
The required class loader, or null if the class loader could not be retrieved.
 o retrieveClassLoaderName
 public ObjectName retrieveClassLoaderName(ClassLoader loader)
Gets the object name of a class loader. The repository internally invokes this method when an m-bean is deserialized. The method analyzes the specified loader to find the method getLoaderName with the following signature:

ObjectName getLoaderName()

The getLoaderName method found is invoked with no parameters and returns the object name of the class loader.

Parameters:
loader - The class loader.
Returns:
The object name of the class loader, or null if the object name could not be retrieved.
 o stop
 public void stop()
Stop the repository and release allocated resources.


All Packages  Class Hierarchy  This Package  Previous  Next  Index