Class COM.ibm.jaws.services.sroot.SimpleRootBC
All Packages Class Hierarchy This Package Previous Next Index
Class COM.ibm.jaws.services.sroot.SimpleRootBC
java.lang.Object
|
+----COM.ibm.jaws.motk.BaseAO
|
+----COM.ibm.jaws.motk.BaseQC
|
+----COM.ibm.jaws.motk.BaseKC
|
+----COM.ibm.jaws.motk.BaseBC
|
+----COM.ibm.jaws.services.sroot.SimpleRootBC
- public class SimpleRootBC
- extends BaseBC
- implements Managed, Syncable
This is a simple root BaseCollection. It is transient (i.e., does
not need to have its state externalized and internalized.) Its MOs
are defined by files residing in a directory, called its base
directory. The base directory is set in a class method call
(getRoot). Once one instance of this BC is created in an address
space by a getRoot call, all other calls specifing the same base
directory will return the same instance. It can only be removed
from the address space by an explicit call to release. This will
deactivate it and remove its class memory until the next call to
getRoot for the same directory at which time it will be
reactivated.
New entries can be added to or removed from the base directory at
any time, but removing entries from the base directory will not
cause them to be deactivated.
Restrictions:
The current implementation does not release MOs once they have
been activated until the whole BC is released by an explicit
call. This will be improved in future releases.
See
Overview for an overview of the SimpleRootBC and how to use
it.
(Alternate link to the Overview.)
-
activeMOs
- The active objects list.
-
baseDir
- The actual base directory.
-
baseDirName
- The path name of the base directory.
-
containedObjectDC
- The dependent context for contained objects
-
d
-
-
SimpleRootBC()
- Required default constructor, does nothing
-
SimpleRootBC(String)
-
-
SimpleRootBC(String, SRootNC)
-
-
activateBaseDir()
-
-
activateObjectFromData(String, InputEDStream, String)
- News up the object and adds it to the active list.
-
activateObjectFromFile(String)
- Only called once per root level object.
-
createFromCopy(String, Manageable, String)
- Creates an file in the activation space directory using the
specified key as its name.
-
createFromCopy(String, Manageable, String, boolean)
- Creates an file in the activation space directory using the
specified key as its name.
-
createFromData(String, InputEDStream, String)
- Creates an file in the activation space directory using the
specified key as its name.
-
createFromData(String, InputEDStream, String, boolean)
- Creates an file in the activation space directory using the
specified key as its name.
-
createFromDefault(String, Object, String)
- Not supported
-
evaluate(String, String)
-
-
externalizeToStream(OutputEDStream)
- Does nothing
-
finalize()
- Code to perform when this object is garbage collected.
-
getActivationSpaceName()
- Returns the activation space id of this object.
-
getConstantRandomId()
- Returns the java.lang.Object.hashCode() for this object's
activation space name.
-
getDependentContext()
-
-
getIdentifier(BaseCollection)
-
-
getRoot(String)
-
-
initialize()
- sets up the name context to hand to contained objects as a
dependent context (containedObjectDC)
-
internalizeFromStream(InputEDStream)
- Does nothing
-
isIdentical(Identifiable)
- Returns true if the two objects are SimpleRoots for the same
activation space.
-
release()
- Releases all the resources associated with this activation
space.
-
remove()
- Not supported
-
resolve(String)
- Provides support for absolute key paths, you need to override
this and add support for relatitive key paths.
-
saveDependentContext()
-
-
saveMO(String)
- Saves the state of a top level MO.
-
sync()
- Saves the state of all the active top level objects in this
activation space.
d
public static Debug d
baseDirName
protected transient String baseDirName
- The path name of the base directory.
baseDir
protected transient File baseDir
- The actual base directory.
activeMOs
protected transient Hashtable activeMOs
- The active objects list.
containedObjectDC
protected transient SRootNC containedObjectDC
- The dependent context for contained objects
SimpleRootBC
public SimpleRootBC()
- Required default constructor, does nothing
SimpleRootBC
public SimpleRootBC(String baseDirName)
SimpleRootBC
public SimpleRootBC(String baseDirName,
SRootNC dependentContext)
getRoot
public static SimpleRootBC getRoot(String baseDirName)
getDependentContext
public SRootNC getDependentContext()
activateBaseDir
protected void activateBaseDir()
saveDependentContext
public void saveDependentContext()
getActivationSpaceName
public String getActivationSpaceName()
- Returns the activation space id of this object.
initialize
protected void initialize()
- sets up the name context to hand to contained objects as a
dependent context (containedObjectDC)
evaluate
public Iterator evaluate(String queryParameter,
String queryString)
- Overrides:
- evaluate in class BaseQC
resolve
public Object resolve(String keyPathString)
- Provides support for absolute key paths, you need to override
this and add support for relatitive key paths.
- Overrides:
- resolve in class BaseKC
activateObjectFromFile
public SRootMO activateObjectFromFile(String keyName)
- Only called once per root level object. This actually opens the
file and then calls activateFromData to really activate the object.
This is called the first time resolve is called for the
object or one of its aliases.
saveMO
protected void saveMO(String key)
- Saves the state of a top level MO. Key names the MO. Throws an
error if the MO is not active.
createFromData
public Managed createFromData(String key,
InputEDStream data,
String interfaceKey)
- Creates an file in the activation space directory using the
specified key as its name. This file will contain the essential
data for the created object.
- Overrides:
- createFromData in class BaseBC
- See Also:
- createFromData
createFromData
public Managed createFromData(String key,
InputEDStream data,
String interfaceKey,
boolean allowDuplicates)
- Creates an file in the activation space directory using the
specified key as its name. This file will contain the essential
data for the created object. If allowDuplicates is true then an
existing file if any will be overwritten.
- See Also:
- createFromData
activateObjectFromData
protected SRootMO activateObjectFromData(String key,
InputEDStream in,
String moClassName)
- News up the object and adds it to the active list.
createFromCopy
public Managed createFromCopy(String key,
Manageable copy,
String interfaceKey)
- Creates an file in the activation space directory using the
specified key as its name. This file will contain the essential
data for the created object.
- Overrides:
- createFromCopy in class BaseBC
- See Also:
- createFromCopy
createFromCopy
public Managed createFromCopy(String key,
Manageable copy,
String interfaceKey,
boolean allowDuplicates)
- Creates an file in the activation space directory using the
specified key as its name. This file will contain the essential
data for the created object. If allowDuplicates is true then an
existing file if any will be overwritten.
- See Also:
- createFromCopy
createFromDefault
public Managed createFromDefault(String key,
Object creator,
String interfaceName)
- Not supported
- Overrides:
- createFromDefault in class BaseBC
externalizeToStream
public void externalizeToStream(OutputEDStream out)
- Does nothing
- Overrides:
- externalizeToStream in class BaseAO
internalizeFromStream
public void internalizeFromStream(InputEDStream in)
- Does nothing
- Overrides:
- internalizeFromStream in class BaseAO
sync
public void sync()
- Saves the state of all the active top level objects in this
activation space.
finalize
public void finalize()
- Code to perform when this object is garbage collected.
- Overrides:
- finalize in class Object
release
public void release()
- Releases all the resources associated with this activation
space. Note: this does not save the resources first. Call saveAll
first if you want to save the state of the objects in the
activation space.
- Overrides:
- release in class BaseAO
- See Also:
- release
remove
public void remove()
- Not supported
- Overrides:
- remove in class BaseAO
getIdentifier
public String getIdentifier(BaseCollection relativeTo)
isIdentical
public boolean isIdentical(Identifiable otherObject)
- Returns true if the two objects are SimpleRoots for the same
activation space.
- See Also:
- isIdentical
getConstantRandomId
public int getConstantRandomId()
- Returns the java.lang.Object.hashCode() for this object's
activation space name.
- See Also:
- getConstantRandomId
All Packages Class Hierarchy This Package Previous Next Index