org.objectweb.jorm.lib
Class AbstractPMapcluster

java.lang.Object
  extended byorg.objectweb.jorm.lib.AbstractPMapcluster
All Implemented Interfaces:
PMapCluster
Direct Known Subclasses:
FosPMapCluster, RdbPMapCluster

public abstract class AbstractPMapcluster
extends java.lang.Object
implements PMapCluster

Abstract common implementation of a PMapCluster. This implementation manages the dependencies (the list of classes of the cluster).

Author:
S.Chassande-Barrioz

Field Summary
protected  java.util.Set jcNames
          The names of the Jorm classes defined and managed by this PMapCluster
protected  boolean structuresActive
          Indicates if the cluster is active: - data structure created - cluster started
protected  java.util.Set unresolvedDependencies
          The names of the Jorm classes not yet defined but to manage by this PMapCluster.
 
Constructor Summary
AbstractPMapcluster()
           
 
Method Summary
 void addDependency(java.lang.String jcname)
          Add a dependency to the cluster
 void classDefined(java.lang.String jcname)
           
 boolean containClass(java.lang.String jcname)
          Looks for this JORM class name into this map cluster.
 java.util.Collection getClusterClasses()
          Retrieves an Iterator over the collection of all JORM classes whose mapping structures have to be controlled altogether.
 java.util.Set getUnResolvedDependencies()
           
 boolean isDefined()
          Indicates if the mapping cluster is fully defined.
 void start()
          Starts this map cluster.
 void stop()
          Stops this map cluster.
 void updateMappingStructures()
          Aligns existing mapping structures to the ones define by this map cluster.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.jorm.api.PMapCluster
createMappingStructures, deleteData, deleteMappingStructures
 

Field Detail

jcNames

protected java.util.Set jcNames
The names of the Jorm classes defined and managed by this PMapCluster


unresolvedDependencies

protected java.util.Set unresolvedDependencies
The names of the Jorm classes not yet defined but to manage by this PMapCluster. An empty list mean the cluster is complete and can be started.


structuresActive

protected boolean structuresActive
Indicates if the cluster is active: - data structure created - cluster started

Constructor Detail

AbstractPMapcluster

public AbstractPMapcluster()
Method Detail

getClusterClasses

public java.util.Collection getClusterClasses()
Retrieves an Iterator over the collection of all JORM classes whose mapping structures have to be controlled altogether.

Specified by:
getClusterClasses in interface PMapCluster
Returns:
The Iterator over this collection.

isDefined

public boolean isDefined()
Description copied from interface: PMapCluster
Indicates if the mapping cluster is fully defined.

Specified by:
isDefined in interface PMapCluster
Returns:
the 'true' value if the mapping cluster is fully defined, false otherwise.

getUnResolvedDependencies

public java.util.Set getUnResolvedDependencies()
Specified by:
getUnResolvedDependencies in interface PMapCluster
Returns:
the collection of unresolved dependencies. This is the set of jorm class names which must be mapped before starting the cluster.

addDependency

public void addDependency(java.lang.String jcname)
Description copied from interface: PMapCluster
Add a dependency to the cluster

Specified by:
addDependency in interface PMapCluster
Parameters:
jcname - the name of the jorm class

classDefined

public void classDefined(java.lang.String jcname)
Specified by:
classDefined in interface PMapCluster

containClass

public boolean containClass(java.lang.String jcname)
Looks for this JORM class name into this map cluster.

Parameters:
jcname - The JORM class name.
Returns:
true if this JORM class name is already assigned to this cluster.

start

public void start()
           throws PException
Starts this map cluster. The following operation cannot be executed anymore: createMappingStructures, deleteMappingStructures, and updateMappingStructures.

Specified by:
start in interface PMapCluster
Throws:
org.objectweb.jorm.api.PException
PException

stop

public void stop()
          throws PException
Stops this map cluster.

Specified by:
stop in interface PMapCluster
Throws:
org.objectweb.jorm.api.PException
PException

updateMappingStructures

public void updateMappingStructures()
                             throws PException,
                                    java.lang.UnsupportedOperationException
Aligns existing mapping structures to the ones define by this map cluster. This operation allows schema evolution on existing data store. It is thus usually difficult to support in the general case.

Specified by:
updateMappingStructures in interface PMapCluster
Throws:
org.objectweb.jorm.api.PException - Thrown when the data store cannot perform this operation.
java.lang.UnsupportedOperationException - Thrown if this operation is not supported by the mapping.
PException