aspoev.manager.schema
Class SchemaManager

java.lang.Object
  extended byaspoev.manager.schema.SchemaManager
Direct Known Subclasses:
ClassVersioningManager, ContextVersioningManager, SchemaModificationManager

public abstract class SchemaManager
extends java.lang.Object

Subclasses dictate how they want to handle schema evolution.

See Also:
- aspoev.manager.schema.ClassVersioningManager aspoev.manager.schema.SchemaModificationManager aspoev.manager.schema.SchemaVersioningManager

Field Summary
static java.lang.String defaultSchema
           
protected  pJ.jasmine.Hashtab reassignedTypes
          This field maps types to what they should now be typed as.
static VariableReferenceElement SCHEMA_EXTENT
           
protected  pJ.jasmine.Hashtab substitutibleTypes
           
 
Constructor Summary
SchemaManager()
           
 
Method Summary
 void addType(TypeReferenceElement newType)
          Submits a new version of a type, or a new type entirely to the schema manager.
 void alteredFieldReferenced(InterpreterException ie)
          This method allows the schema manager to take automomous action when an alteration to a field results in invalidated references.
 void alteredMethodReferenced(InterpreterException ie)
          This method allows the schema manager to take automomous action when an alteration to a method results in invalidated references.
 boolean assignableFrom(TypeReferenceElement one, TypeReferenceElement two)
          Defines whether or not a type is assignable from another type.
 TypeReferenceElement bindType(TypeReferenceElement type)
          This method recieves mostly types with version , and expects the implementation to bind a concrete version.
 boolean compareTypes(TypeReferenceElement one, TypeReferenceElement two)
          This method encapsulates the algorithm for type equality.
 void declareSubstitutable(TypeReferenceElement one, TypeReferenceElement two)
          This method tells the schema manager to view the second argument type as substitutable for the first argument type.
 void fieldExposed(InterpreterException ie)
          This method allows the schema manager to take automomous action when an alteration to a field exposes an inherited, previously overridden field declaration.
 void fieldOverridden(InterpreterException ie)
          This method allows the schema manager to take automomous action when an alteration to a field overrides an inherited field declaration.
 TypeReferenceElement getActiveVersion(TypeReferenceElement otherVersion)
          This method returns the version of the argument type that is active or preferred in the current context ('context' to be defined and evaluated by the schema manager).
 java.util.Collection getEquivalentTypes(TypeReferenceElement type)
          This method returns a collection of equivalent types based on the type equality semantics defined by the Schema Manager as well as any substitutable types.
 TypeReferenceElement getReassignedType(TypeReferenceElement deprecated)
          This method returns the type that the argument type has been reassigned to.
 SchemaExtent getSchemaExtent()
          Returns the schema used by this schema manager.
 QueryEnumeration getSubstitutableTypes(TypeReferenceElement type)
          Returns all types which have been declared substitutable to the argument type by the schema manager.
 java.util.Collection getTypeExtent(TypeReferenceElement type)
          Returns all versions of this type present in the schema.
 boolean isSubstitutibleFor(TypeReferenceElement one, TypeReferenceElement two)
          Returns 'true' if the second argument is substitutable for the first in the view of the schema manager.
 void methodExposed(InterpreterException ie)
          This method allows the schema manager to take automomous action when an alteration to a method exposes an inherited, previously overridden method declaration.
 void methodOverridden(InterpreterException ie)
          This method allows the schema manager to take automomous action when an alteration to a method overrides an inherited method declaration.
 void print(java.lang.String s)
          \ * Util Methods * * \
 TypeReferenceElement reclassifyType(TypeReferenceElement deprecated)
          This method must be defined by implementing strategies to dictate how persistent instances of a removed class are classified as in the future.
 void removedFieldReferenced(InterpreterException ie)
          This method allows the schema manager to take automomous action when references to a field remain after the removal of the field.
 void removedMethodReferenced(InterpreterException ie)
          This method allows the schema manager to take automomous action when references to a method remain after the removal of the method.
 void removeType(TypeReferenceElement removed)
          This method effects the removal of a type from the schema.
 void renamedMemberReferenced(InterpreterException ie)
          This method allows the schema manager to take automomous action when references to a member remain after the renaming of the member.
 void renamedTypeReferenced(InterpreterException ie)
          This method allows the schema manager to take automomous action when a renamed type is used under its old name.
 void setSchemaExtent(SchemaExtent newExtent)
           
 void transitionFrom(SchemaExtent oldSchema)
          This method dictates how a schema manager will transition from the schema of the previous schema manager.
 void typeMismatch(TypeMismatchException tme)
          This method reports a type mismatch exception for advice by the schema manager.
 void unknownField(UnknownFieldReferenceException ufre)
          This method allows the schema-consistent handling of references to unknown fields (due to type mismatch).
 void unknownMethod(UnknownMethodInvokationException umie)
          This method allows the schema-consistent handling of invocations to unknown methods (due to type mismatch).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCHEMA_EXTENT

public static final VariableReferenceElement SCHEMA_EXTENT

defaultSchema

public static final java.lang.String defaultSchema
See Also:
Constant Field Values

reassignedTypes

protected pJ.jasmine.Hashtab reassignedTypes
This field maps types to what they should now be typed as. For example, if a type is removed from the database, then instances of that type should be converted to the mapped value. Key = removed, Value = alternative type


substitutibleTypes

protected pJ.jasmine.Hashtab substitutibleTypes
Constructor Detail

SchemaManager

public SchemaManager()
Method Detail

addType

public void addType(TypeReferenceElement newType)
Submits a new version of a type, or a new type entirely to the schema manager. Implementing strategies must define how this addition affects the schema. Default implementation simply adds the type or version to the schema.


assignableFrom

public boolean assignableFrom(TypeReferenceElement one,
                              TypeReferenceElement two)
Defines whether or not a type is assignable from another type. Default implementation searches for the first type in the second type's supertypes.


bindType

public TypeReferenceElement bindType(TypeReferenceElement type)
This method recieves mostly types with version , and expects the implementation to bind a concrete version. For most managers, this just involves returning the 'preferred,' or 'active' version of the type, however, since some implementations (ClassVersioning) do not have an 'active' version of types, this method forces them to pick one and go with it. Default implementation returns the 'active' version.


compareTypes

public boolean compareTypes(TypeReferenceElement one,
                            TypeReferenceElement two)
This method encapsulates the algorithm for type equality. Returns 'true' if two argument types are equal, false otherwise. The default implementation compares the namespaces, names, and versions of the types and returns true if all three are equal.


getEquivalentTypes

public java.util.Collection getEquivalentTypes(TypeReferenceElement type)
This method returns a collection of equivalent types based on the type equality semantics defined by the Schema Manager as well as any substitutable types. Implementing strategies do not need to alter this method.


getReassignedType

public TypeReferenceElement getReassignedType(TypeReferenceElement deprecated)
This method returns the type that the argument type has been reassigned to. Implementing strategies do not need to alter this method. Implementing strategies do not need to alter this method.


getActiveVersion

public TypeReferenceElement getActiveVersion(TypeReferenceElement otherVersion)
This method returns the version of the argument type that is active or preferred in the current context ('context' to be defined and evaluated by the schema manager). Default implementation returns the most current version of the argument type which is present in the schema. Implementing strategies should override this method to reflect the appropriate type.


getSchemaExtent

public final SchemaExtent getSchemaExtent()
Returns the schema used by this schema manager.


getSubstitutableTypes

public final QueryEnumeration getSubstitutableTypes(TypeReferenceElement type)
Returns all types which have been declared substitutable to the argument type by the schema manager.


getTypeExtent

public final java.util.Collection getTypeExtent(TypeReferenceElement type)
Returns all versions of this type present in the schema.


isSubstitutibleFor

public boolean isSubstitutibleFor(TypeReferenceElement one,
                                  TypeReferenceElement two)
Returns 'true' if the second argument is substitutable for the first in the view of the schema manager. Implementing strategies do not need to alter this method.


removeType

public void removeType(TypeReferenceElement removed)
This method effects the removal of a type from the schema. Instances of the removed type must be forward to otehr versions or base types. Default implementation first attempts to reclassify instances as other versions, then as base types. Impementing strategies must take action necessary at type removal at this point.


reclassifyType

public TypeReferenceElement reclassifyType(TypeReferenceElement deprecated)
This method must be defined by implementing strategies to dictate how persistent instances of a removed class are classified as in the future. This is a tough call for this class to make, and should probably be left to a more informed subclass of SchemaManager.


declareSubstitutable

public final void declareSubstitutable(TypeReferenceElement one,
                                       TypeReferenceElement two)
This method tells the schema manager to view the second argument type as substitutable for the first argument type.


setSchemaExtent

public void setSchemaExtent(SchemaExtent newExtent)

transitionFrom

public void transitionFrom(SchemaExtent oldSchema)
This method dictates how a schema manager will transition from the schema of the previous schema manager. The old schema is provided in the argument, and contains remapped and substitutable type relationships. Default implementation redeclares substitutable types and remappings, unless remapped types are present in the new schema.


typeMismatch

public void typeMismatch(TypeMismatchException tme)
This method reports a type mismatch exception for advice by the schema manager. A type mismatch exception could occur when an application specifies a version which is different from the schema version. It could also occur when schema management strategies have been changed. Default implementation


unknownField

public void unknownField(UnknownFieldReferenceException ufre)
This method allows the schema-consistent handling of references to unknown fields (due to type mismatch). Default implementation simply informs the exception of the Schema's version of the instance. However, implementations may wish to allow versions other than the schema version if the schema version does not possess the referenced field. Note that this method only advises the exception as to which type the object should be.


unknownMethod

public void unknownMethod(UnknownMethodInvokationException umie)
This method allows the schema-consistent handling of invocations to unknown methods (due to type mismatch). Default implementation simply informs the exception of the Schema's version of the instance. However, implementations may wish to allow versions other than the schema version if the schema version does not possess the invoked method. Note that this method only advises the exception as to which type the object should be.


alteredFieldReferenced

public void alteredFieldReferenced(InterpreterException ie)
This method allows the schema manager to take automomous action when an alteration to a field results in invalidated references. Only schema managers which attempt to reflectively resolve inconsistencies need implement this method. No default implementation.


alteredMethodReferenced

public void alteredMethodReferenced(InterpreterException ie)
This method allows the schema manager to take automomous action when an alteration to a method results in invalidated references. Only schema managers which attempt to reflectively resolve inconsistencies need implement this method. No default implementation.


fieldExposed

public void fieldExposed(InterpreterException ie)
This method allows the schema manager to take automomous action when an alteration to a field exposes an inherited, previously overridden field declaration. Only schema managers reflective which attempt to reflectively resolve inconsistencies need implement this method. No default implementation.


methodExposed

public void methodExposed(InterpreterException ie)
This method allows the schema manager to take automomous action when an alteration to a method exposes an inherited, previously overridden method declaration. Only schema managers reflective which attempt to reflectively resolve inconsistencies need implement this method. No default implementation.


fieldOverridden

public void fieldOverridden(InterpreterException ie)
This method allows the schema manager to take automomous action when an alteration to a field overrides an inherited field declaration. Only schema managers which attempt to reflectively resolve inconsistencies need implement this method. No default implementation.


methodOverridden

public void methodOverridden(InterpreterException ie)
This method allows the schema manager to take automomous action when an alteration to a method overrides an inherited method declaration. Only schema managers which attempt to reflectively resolve inconsistencies need implement this method. No default implementation.


removedFieldReferenced

public void removedFieldReferenced(InterpreterException ie)
This method allows the schema manager to take automomous action when references to a field remain after the removal of the field. Only schema managers which attempt to reflectively resolve inconsistencies need implement this method. No default implementation.


removedMethodReferenced

public void removedMethodReferenced(InterpreterException ie)
This method allows the schema manager to take automomous action when references to a method remain after the removal of the method. Only schema managers which attempt to reflectively resolve inconsistencies need implement this method. No default implementation.


renamedMemberReferenced

public void renamedMemberReferenced(InterpreterException ie)
This method allows the schema manager to take automomous action when references to a member remain after the renaming of the member. Only schema managers which attempt to reflectively resolve inconsistencies need implement this method. No default implementation, but supported by the Default Rename Member Handler object within the framework.


renamedTypeReferenced

public void renamedTypeReferenced(InterpreterException ie)
This method allows the schema manager to take automomous action when a renamed type is used under its old name. Only schema managers which attempt to reflectively resolve inconsistencies need implement this method. No default implementation.


print

public void print(java.lang.String s)
\ * Util Methods * * \