orca.container
Class AbstractContainerManager

java.lang.Object
  extended by orca.container.AbstractContainerManager
All Implemented Interfaces:
IContainerManager
Direct Known Subclasses:
ShirakoContainerManager

public abstract class AbstractContainerManager
extends java.lang.Object
implements IContainerManager


Field Summary
protected  IContainerAdministrativeConfiguration adminContext
          The administrative-level container configuration.
protected  IContainerConfiguration configuration
          The container configuration.
protected  IContainerDatabase db
          The container database.
protected  boolean fresh
          True if this container was created by processing a fresh configuration file.
protected  ID guid
          Container GUID.
protected  boolean initialized
          True if this container has been initialized (it has processed a configuration file).
protected  LoggingTool logger
          The logger
protected  boolean recovered
          True if the recovery code has been invoked.
protected  java.lang.String root
          The path prefix used by this container.
 
Constructor Summary
AbstractContainerManager()
          Creates a new instance of the container manager.
 
Method Summary
protected abstract  void boot()
          Performs all operations necessary at boot time.
protected abstract  void createDatabase()
          Creates the container database.
 void finishBoot()
          Informs the container manager that it can finish the remaining boot operations.
 IContainerAdministrativeConfiguration getAdministrativeConfiguration()
           
 IContainerConfiguration getConfiguration()
           
 IContainerDatabase getDatabase()
          Returns the container database.
 ID getGuid()
          Returns the container GUID.
 LoggingTool getLogger()
           
 java.lang.String getRootDirectory()
          Returns the root directory.
 void initialize(java.util.Properties p)
          Performs the main initialization routines.
 boolean isFresh()
          Returns true if this is a fresh container (not recovered from previous state).
 boolean isInitialized()
          Returns true if this container has been initialized.
 boolean isRecovered()
           
abstract  void persistConfiguration()
          Persists the container configuration.
protected abstract  void processConfiguration(java.util.Properties p)
          Processes the container configuration properties.
abstract  int recover()
          Recovers the container.
 void setDatabase(IContainerDatabase db)
          Sets the container database.
 void setFresh(boolean value)
           
 void setGuid(ID guid)
          Sets the container GUID.
 void setInitialized(boolean value)
           
 void setRecovered(boolean value)
           
 void setRootDirectory(java.lang.String rootDirectory)
          Sets the root directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

guid

protected ID guid
Container GUID. This object is created when processing the configuration file.


root

protected java.lang.String root
The path prefix used by this container.


fresh

protected boolean fresh
True if this container was created by processing a fresh configuration file. False, if the container was recovered from state stored in a database.


recovered

protected boolean recovered
True if the recovery code has been invoked.


db

protected IContainerDatabase db
The container database. This object is created when processing the configuration file.


logger

protected LoggingTool logger
The logger


adminContext

protected IContainerAdministrativeConfiguration adminContext
The administrative-level container configuration.


configuration

protected IContainerConfiguration configuration
The container configuration.


initialized

protected boolean initialized
True if this container has been initialized (it has processed a configuration file).

Constructor Detail

AbstractContainerManager

public AbstractContainerManager()
Creates a new instance of the container manager.

Method Detail

initialize

public void initialize(java.util.Properties p)
                throws java.lang.Exception
Performs the main initialization routines.

Specified by:
initialize in interface IContainerManager
Parameters:
p - configuration properties list.
Throws:
java.lang.Exception

processConfiguration

protected abstract void processConfiguration(java.util.Properties p)
                                      throws java.lang.Exception
Processes the container configuration properties.

Parameters:
p - container configuration properties list. This class must eventually create an instance of IContainerConfiguration and IContainerAdministrativeConfiguration.
Throws:
java.lang.Exception

createDatabase

protected abstract void createDatabase()
                                throws java.lang.Exception
Creates the container database. The resulting database object must be assigned to db.

Throws:
java.lang.Exception

boot

protected abstract void boot()
                      throws java.lang.Exception
Performs all operations necessary at boot time.

Throws:
java.lang.Exception

getGuid

public ID getGuid()
Description copied from interface: IContainerManager
Returns the container GUID.

Specified by:
getGuid in interface IContainerManager
Returns:

setGuid

public void setGuid(ID guid)
Description copied from interface: IContainerManager
Sets the container GUID.

Specified by:
setGuid in interface IContainerManager

getRootDirectory

public java.lang.String getRootDirectory()
Description copied from interface: IContainerManager
Returns the root directory.

Specified by:
getRootDirectory in interface IContainerManager
Returns:

setDatabase

public void setDatabase(IContainerDatabase db)
Description copied from interface: IContainerManager
Sets the container database.

Specified by:
setDatabase in interface IContainerManager

getDatabase

public IContainerDatabase getDatabase()
Description copied from interface: IContainerManager
Returns the container database.

Specified by:
getDatabase in interface IContainerManager
Returns:

finishBoot

public void finishBoot()
                throws java.lang.Exception
Description copied from interface: IContainerManager
Informs the container manager that it can finish the remaining boot operations. At this point the container must have a database so operations that depend on the existence of the database can now proceeed.

Specified by:
finishBoot in interface IContainerManager
Throws:
java.lang.Exception

persistConfiguration

public abstract void persistConfiguration()
                                   throws java.lang.Exception
Description copied from interface: IContainerManager
Persists the container configuration.

Specified by:
persistConfiguration in interface IContainerManager
Throws:
java.lang.Exception

isFresh

public boolean isFresh()
Description copied from interface: IContainerManager
Returns true if this is a fresh container (not recovered from previous state).

Specified by:
isFresh in interface IContainerManager
Returns:

isInitialized

public boolean isInitialized()
Description copied from interface: IContainerManager
Returns true if this container has been initialized.

Specified by:
isInitialized in interface IContainerManager
Returns:

recover

public abstract int recover()
Description copied from interface: IContainerManager
Recovers the container.

Specified by:
recover in interface IContainerManager
Returns:

setRootDirectory

public void setRootDirectory(java.lang.String rootDirectory)
Description copied from interface: IContainerManager
Sets the root directory.

Specified by:
setRootDirectory in interface IContainerManager

getConfiguration

public IContainerConfiguration getConfiguration()
Specified by:
getConfiguration in interface IContainerManager

getAdministrativeConfiguration

public IContainerAdministrativeConfiguration getAdministrativeConfiguration()
Specified by:
getAdministrativeConfiguration in interface IContainerManager

setFresh

public void setFresh(boolean value)
Specified by:
setFresh in interface IContainerManager

setInitialized

public void setInitialized(boolean value)
Specified by:
setInitialized in interface IContainerManager

setRecovered

public void setRecovered(boolean value)
Specified by:
setRecovered in interface IContainerManager

isRecovered

public boolean isRecovered()
Specified by:
isRecovered in interface IContainerManager

getLogger

public LoggingTool getLogger()
Specified by:
getLogger in interface IContainerManager


Copyright © 2007 Network/Internet Computing Lab. All Rights Reserved.