|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.jaw.impl.agent.services.light.RepositorySrv | +--com.sun.jaw.impl.agent.services.persistent.PersistentRepSrv
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.
MoRepSrvIf
,
ObjectInputStream
,
ObjectOutputStream
,
Serializable
,
Externalizable
, Serialized FormField Summary | |
protected Framework |
cmf
Reference to the Framework. |
protected java.lang.String |
domain
The domain name of the server the repository is attached to. |
Constructor Summary | |
PersistentRepSrv()
Default constructor. |
Method Summary | |
boolean |
contains(java.lang.Object object)
Verifies whether a singleton m-bean is registered with the repository. |
boolean |
contains(ObjectName name)
Verifies whether an m-bean is registered with the repository. |
protected boolean |
containsDB(ObjectName name)
Verifies whether an m-bean is in the database. |
protected void |
enableSync(Framework cmf)
Enables the synhronization of m-beans with this framework. |
protected java.util.Vector |
getDBObject(ObjectName name,
QueryExp query)
Gets handles on m-beans in the database. |
java.lang.String |
getDomain()
Gets the domain of the repository. |
java.lang.Integer |
getNbElements()
Gets the number of m-beans registered with the repository. |
java.util.Vector |
getObject(ObjectName name,
QueryExp query)
Gets handles on m-beans controlled by the repository. |
protected boolean |
isFramework(java.lang.Object object)
Tests if the object is an instance of a framework. |
boolean |
isPersistent()
Indicates whether the repository offers persistent storage. |
boolean |
isQuerySrv()
Indicates whether the repository supports filtering. |
void |
register(java.lang.Object object,
ObjectName name)
Invoked by the core management framework to register a volatile m-bean with the repository. |
void |
registerDB(java.lang.Object object,
ObjectName name)
Invoked by the core management framework to register a persistent m-bean with the repository. |
java.lang.ClassLoader |
resolveClassLoader(ObjectName aloader)
Gets the class loader associated with an m-bean that is being deserialized. |
java.lang.Object |
retrieve(ObjectName name)
Retrieves an m-bean from the repository. |
ObjectName |
retrieveClassLoaderName(java.lang.ClassLoader loader)
Gets the object name of a class loader. |
protected java.lang.Object |
retrieveDB(ObjectName name)
Retrieves an m-bean from the database. |
void |
setConfig(java.util.Vector params)
Configures the repository and starts the database. |
void |
setDomain(java.lang.String domain)
Sets the domain of the repository. |
void |
stop()
Stop the repository and release allocated resources. |
void |
unregister(java.lang.Object object)
Removes a singleton m-bean from the repository. |
void |
unregister(ObjectName name)
Removes an m-bean from the repository. |
protected void |
unregisterDB(ObjectName name)
Removes an m-bean from the database. |
void |
update(java.lang.Object object,
ObjectName name)
Updates an m-bean registered with the repository. |
protected void |
updateDB(java.lang.Object object,
ObjectName name)
Updates an m-bean in the database. |
protected boolean |
validateRegistration(ObjectName name)
Validate the registration of a new m-bean. |
Methods inherited from class com.sun.jaw.impl.agent.services.light.RepositorySrv |
getClassVersion |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected java.lang.String domain
protected transient Framework cmf
Constructor Detail |
public PersistentRepSrv()
Method Detail |
public void setConfig(java.util.Vector params)
The configuration parameters must be specified in the following order:
default.db
by default.
All parameters are String
objects or null
if not specified.
If the parameter vector is empty or null
, default values are
used.
params
- A vector containing the configuration parameters
of the repository.public boolean isQuerySrv()
public boolean isPersistent()
public boolean contains(ObjectName name)
name
- The object name of the m-bean.public java.lang.Object retrieve(ObjectName name)
name
- The object name of the m-bean to be retrieved.public boolean contains(java.lang.Object object)
object
- The m-bean.public void registerDB(java.lang.Object object, ObjectName name) throws InstanceAlreadyExistException
object
- The m-bean to be registered.name
- The object name with which the m-bean is
to be registered.public void register(java.lang.Object object, ObjectName name) throws InstanceAlreadyExistException
object
- The m-bean to be registered.name
- The object name with which the m-bean is
to be registered.public void update(java.lang.Object object, ObjectName name) throws InstanceNotFoundException
object
- The new instance of the m-bean.name
- The object name of the m-bean to be updated.public void unregister(ObjectName name) throws InstanceNotFoundException
name
- The object name of the m-bean to be removed.public void unregister(java.lang.Object object) throws InstanceNotFoundException
object
- The m-bean to be removed from the repository.public java.util.Vector getObject(ObjectName name, QueryExp query)
name
- An object name that specifies the m-beans to be
selected.query
- A query to be applied to the selected m-beans.public java.lang.Integer getNbElements()
public java.lang.String getDomain()
public void setDomain(java.lang.String domain)
public java.lang.ClassLoader resolveClassLoader(ObjectName aloader)
aloader
- The object name of the class loader.public ObjectName retrieveClassLoaderName(java.lang.ClassLoader loader)
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.
loader
- The class loader.public void stop()
protected boolean containsDB(ObjectName name)
name
- The object name of the m-bean.protected java.lang.Object retrieveDB(ObjectName name)
name
- The object name of the m-bean to be retrieved.protected void updateDB(java.lang.Object object, ObjectName name) throws InstanceNotFoundException
object
- The new instance of the m-bean.name
- The object name of the m-bean to be updated.protected void unregisterDB(ObjectName name) throws InstanceNotFoundException
name
- The object name of the m-bean to be removed.protected java.util.Vector getDBObject(ObjectName name, QueryExp query)
name
- An object name that specifies the m-beans to be
selected.query
- A query to be applied to the selected m-beans.protected boolean validateRegistration(ObjectName name)
name
- The object name of the m-bean to be registered.
For a registration to be valid two things are checked:
1) If the m-bean is a singleton, no other m-beans of this
class are registered.
2) If the m-bean is not a singleton, no singleton of this
class is regitered.protected boolean isFramework(java.lang.Object object)
object
- The object to be tested.protected void enableSync(Framework cmf)
cmf
- The reference to the framework.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |