All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class examples.jdbc.JDBCRepositorySrv

java.lang.Object
   |
   +----examples.jdbc.JDBCRepositorySrv

public class JDBCRepositorySrv
extends Object
implements MoRepSrvIf
This class provides an implementation of an object repository. The repository contains a mixture of volatile and persistent m-beans. The repository stores volatile m-beans in memory and persistent m-beans in a database. The database is accessed through the JDBC API.

M-beans are stored in domain tables. The M-bean state is stored through serialization. Domain tables are registered with a registry table, that manages the different domain tables.

The repository synchronize m-beans with the current framework. To enable m-bean synchronization the framework should be the first object to register with the repository and objects should not mark fields that reference the framework with the transient keyword.

See Also:
MoRepSrvIf, RegistryTable, DomainTable, SerializationConvertion

Constructor Index

 o JDBCRepositorySrv()
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 retrieve(ObjectName)
Retrieves an m-bean from the repository.
 o setConfig(Vector)
Configures the repository.
 o setDomain(String)
Sets the domain of the repository.
 o stop()
Stop the repository and terminates the connection to the database.
 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 JDBCRepositorySrv
 public JDBCRepositorySrv()
Default constructor.

Methods

 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.
 o isPersistent
 public boolean isPersistent()
Indicates whether the repository offers persistent storage.

Returns:
True if the repository offers persistent storage, false otherwise.
 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.
 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.
 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.
 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.
 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.
 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.
 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.
 o unregister
 public void unregister(Object obj) 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.
 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.
 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.
 o getDomain
 public String getDomain()
Gets the domain of the repository.

Returns:
The domain of the repository.
 o setDomain
 public void setDomain(String domain)
Sets the domain of the repository.

 o setConfig
 public void setConfig(Vector params)
Configures the repository.
The configuration parameters must be specified in the following order: Configures the repository as follows: NOTE: The repository must be configured before it can be used.

Parameters:
params - A vector containing the configuration parameters of the repository.
 o stop
 public void stop()
Stop the repository and terminates the connection to the database.


All Packages  Class Hierarchy  This Package  Previous  Next  Index