Expresso 5-6

com.jcorporate.expresso.services.test
Class SchemaManager

java.lang.Object
  extended bycom.jcorporate.expresso.services.test.SchemaManager

public class SchemaManager
extends Object

This class reference counts references to various Schema objects. When a reference count drops to zero, the schema is deleted. [If it's not marked read only] If it is marked readonly, then the schema is created, but not deleted. [Makes for much faster checking when running unit tests on, say, a single controller]

Version:
$Revision: 1.12 $ $Date: 2004/11/17 20:48:22 $
Author:
Michael Rimov

Constructor Summary
SchemaManager()
           
 
Method Summary
static void addReadOnlyReference(Schema s)
          Adds a schema reference that is not removed when the count goes to zero because it is a read only schema.
static void addReference(Schema s)
          Add a reference to a schema.
static void addReference(Schema s, boolean forceNoCreate)
          Add a reference to a schema.
static void forceAllSchemaDelete()
           
static void forceSchemaDelete(Schema s)
          Forces the schema deletion even if the schema is marked "read only"
static void removeReference(Schema s)
          Reduces the reference count to Schema s.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaManager

public SchemaManager()
Method Detail

addReference

public static void addReference(Schema s)
Add a reference to a schema. Create the schema if no previous reference

Parameters:
s - The Schema to reference

addReference

public static void addReference(Schema s,
                                boolean forceNoCreate)
Add a reference to a schema. Create the schema if no previous reference

Parameters:
s - The Schema to reference
forceNoCreate - Set to true if you just want a reference added, but no schema created. This is used if DBToolTests are being run in the test suite.

addReadOnlyReference

public static void addReadOnlyReference(Schema s)
Adds a schema reference that is not removed when the count goes to zero because it is a read only schema. You can undo this 'read-onliness' by calling forceSchemaDelete() which will remove the read only flags for this schema. Note that if any other reference is added for this schema, then if it's a non-readonly reference, than the schema will be deleted as usual.

Parameters:
s - the Schema to add

removeReference

public static void removeReference(Schema s)
Reduces the reference count to Schema s. Deletes the schema if the reference count is reduced to zero.

Parameters:
s - the Schema to remove a reference.

forceSchemaDelete

public static void forceSchemaDelete(Schema s)
Forces the schema deletion even if the schema is marked "read only"

Parameters:
s - the schema to force a delete

forceAllSchemaDelete

public static void forceAllSchemaDelete()

Expresso 5-6

Please see www.jcorporate.com for information about new Expresso releases.