atg.rview
Class RelationalViewManagerImpl

java.lang.Object
  extended by atg.rview.RelationalViewManager
      extended by atg.rview.RelationalViewManagerImpl
All Implemented Interfaces:
NameContextBindingListener, NameContextElement, AdminableService, ApplicationLogging, Service, ServiceListener, CacheInvalidationListener, Schedulable, java.util.EventListener

public class RelationalViewManagerImpl
extends RelationalViewManager
implements NameContextBindingListener, NameContextElement, ServiceListener, Service, ApplicationLogging, AdminableService, Schedulable

This is an implementation of RelationalViewManager, implemented as a Nucleus service. It expects a property "descriptionFiles", which points to the files containing the description files that will be used to define the relational views in the system. It also expects the "JDBCConnection property" to be set if a single Connection is to be used by the system (usually for standalone, or test programs), or the "connectionPool" property to be set if a JDBCConnectionPool is to be used (which is most likely when using Dynamo).

This can also be run "standalone" outside of Dynamo. To do so, one of the initialize() methods must be called after constructing the RelationalViewManagerImpl.


Field Summary
static java.lang.String CLASS_VERSION
           
static java.lang.String JOIN_STYLE_ANSI
           
static java.lang.String JOIN_STYLE_DB2
           
static java.lang.String JOIN_STYLE_INFORMIX
           
static java.lang.String JOIN_STYLE_MICROSOFT
           
static java.lang.String JOIN_STYLE_NONE
           
static java.lang.String JOIN_STYLE_ORACLE
           
static java.lang.String JOIN_STYLE_SYBASE
           
static java.lang.String SERVICE_INFO_KEY
          Should be used as a key to retrieve the serviceInfo property from ResourceBundles
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
RelationalViewManagerImpl()
          Constructor
 
Method Summary
 void addLogListener(LogListener pListener)
          Adds a listener to the list of log listeners
 boolean checkInternalIntegrity()
          This checks the integrity of the cache manager's internal structures, especially the LRU list of entries.
 void commit()
          Commits any operations performed by this Thread since the last commit or rollback, releasing any Connection resources, and committing any cache invalidations that have occurred as a result of the committed operations.
protected  javax.servlet.Servlet createAdminServlet()
          Creates and returns a new Servlet that will administer this service.
 void doStartService()
          This initializes the manager by reading the description files and creating the internal structures needed to handle the RelationalViews and caches.
 void doStopService()
          This is called when a Service is required to shut down.
 java.lang.String getAbsoluteName()
          Returns the absolute name of this service, using Nucleus to get the absolute name.
 javax.servlet.Servlet getAdminServlet()
          Returns the Servlet that will handle requests directed at this service.
 CacheInfo getCacheInfo()
          Returns a CacheInfo describing the runtime state of the internal caches.
 int getCacheSize()
           
 java.sql.Connection getConnection()
          Returns a Connection that a RelationalViewImpl can use.
 JDBCConnectionPool getConnectionPool()
           
 javax.sql.DataSource getDataSource()
           
 DefinitionFile getDefinitionFile()
          Returns the DefinitionFile that defines all of the RelationalViews and ResultSetProcessors used by the RelationalViewManager.
 java.io.File[] getDescriptionFiles()
           
 java.lang.String[] getDescriptionResourceFiles()
           
 boolean getEnforceMemoryAsynchronously()
           
 int getEnforceMemoryMaximumRemove()
           
 Schedule getEnforceMemorySchedule()
           
 InvalidationRelay getInvalidationRelay()
           
 java.sql.Connection getJDBCConnection()
           
 java.lang.String getJoinStyle()
           
 int getLogListenerCount()
          Returns the number of log listeners
 LogListener[] getLogListeners()
          Returns the list of log listeners as an array property.
 long getMaximumEntryLifetime()
           
 java.lang.String getName()
          Returns the name by which this element is know within its enclosing NameContext.
 NameContext getNameContext()
          Returns the NameContext into which this element has been bound, or null if the element is not bound in a NameContext.
 Nucleus getNucleus()
          Returns the Nucleus managing this Service
 RelationalView getRelationalView(java.lang.String pRelationalViewName)
          Returns the RelationalView with the given name, or null if there is no such RelationalView.
 java.lang.String getRelayRegisterName()
           
 ResultSetProcessor getResultSetProcessor(java.lang.String pResultSetProcessorName)
          Returns the ResultSetProcessor with the given name, or null if there is no such ResultSetProcessor.
 NameContext getRoot()
          Searches up the tree until it finds the root NameContext
 atg.rview.Rowmap getRowmap(java.lang.String pRowmapName)
          Returns the Rowmap with the given name, or null if there is no such Rowmap.
 Scheduler getScheduler()
           
 Configuration getServiceConfiguration()
          Returns the Configuration that was used to create this Service, null if there was none.
 java.lang.String getServiceInfo()
          Returns the a descriptive string about this service
 javax.transaction.Transaction getTransaction()
           
 javax.transaction.TransactionManager getTransactionManager()
           
 boolean getUseCallableStatement()
           
 boolean getUseDataSource()
           
 boolean getUseSetAsciiStream()
           
 boolean getUseSetBinaryStream()
           
 boolean getUseSetCharacterStream()
           
 boolean getUseSetObject()
           
 boolean getUseSetUnicodeStream()
           
 boolean getVerifyDefinitionFiles()
           
 void initialize(DefinitionFile pParsedFile)
          Initializes the RelationalViewManagerImpl from the specified DefinitionFile, which should be parsed from a description file or created "by hand".
 void initialize(java.io.File[] pFiles)
          Initializes the RelationalViewManagerImpl from the specified list of Files.
 void initialize(java.io.InputStream pIn)
          Initializes the RelationalViewManagerImpl by reading the description file from the given InputStream.
 void initialize(java.lang.String[] pResourceFiles)
          Initializes the RelationalViewManagerImpl from the specified list of resource file names.
 void invalidateAllCaches()
          This invalidates all of the caches in the system.
 void invalidateCache(java.lang.String pCacheName)
          Invalidates all of the entries in the cache with the specified name.
 void invalidateCacheEntries(java.lang.String pCacheName, java.lang.Object[][] pKeys)
          Invalidates multiple entries in the specified cache.
 void invalidateCacheEntry(java.lang.String pCacheName, java.lang.Object[] pKey)
          Invalidates an entry in the specified cache.
 void invalidateCachesByTableName(java.lang.String pTableName)
          This invalidates all of the caches whose entries depend on the specified table.
 boolean isAnsiJoinStyle()
           
 boolean isDB2JoinStyle()
           
 boolean isInformixJoinStyle()
           
 boolean isLoggingDebug()
          This method returns whether or not an debug log event should be broadcast.
 boolean isLoggingError()
          This method returns whether or not an error log event should be broadcast.
 boolean isLoggingInfo()
          This method returns whether or not an info log event should be broadcast.
 boolean isLoggingWarning()
          This method returns whether or not an warning log event should be broadcast.
 boolean isNoneJoinStyle()
           
 boolean isOracleJoinStyle()
           
 boolean isRunning()
          Returns true if this Service is currently running.
 boolean isSybaseJoinStyle()
           
 void logDebug(java.lang.String pMessage)
          Logs an debug event with the specified message
 void logDebug(java.lang.String pMessage, java.lang.Throwable pThrowable)
          Logs an debug event with the specified message and Throwable
 void logDebug(java.lang.Throwable pThrowable)
          Logs an debug event with the specified Throwable
 void logError(java.lang.String pMessage)
          Logs an error event with the specified message
 void logError(java.lang.String pMessage, java.lang.Throwable pThrowable)
          Logs an error event with the specified message and Throwable
 void logError(java.lang.Throwable pThrowable)
          Logs an error event with the specified Throwable
 void logInfo(java.lang.String pMessage)
          Logs an info event with the specified message
 void logInfo(java.lang.String pMessage, java.lang.Throwable pThrowable)
          Logs an info event with the specified message and Throwable
 void logInfo(java.lang.Throwable pThrowable)
          Logs an info event with the specified Throwable
 void logWarning(java.lang.String pMessage)
          Logs an warning event with the specified message
 void logWarning(java.lang.String pMessage, java.lang.Throwable pThrowable)
          Logs an warning event with the specified message and Throwable
 void logWarning(java.lang.Throwable pThrowable)
          Logs an warning event with the specified Throwable
 void nameContextElementBound(NameContextBindingEvent pEvent)
          This is called to notify this context that it is being bound into a NameContext.
 void nameContextElementUnbound(NameContextBindingEvent pEvent)
          This is called to notify this context that it is being unbound from a NameContext.
 void performScheduledTask(Scheduler pScheduler, ScheduledJob pJob)
          Removes enough entries to get the memory size back within allowed limits
 void removeLogListener(LogListener pListener)
          Removes a listener from the list of log listeners
 java.lang.String reportInternalIntegrity()
          This checks the integrity of the cache manager's internal structures, especially the LRU list of entries.
 java.lang.Object resolveName(java.lang.String pName)
          Resolves the specified name, relative to this context's parent.
 java.lang.Object resolveName(java.lang.String pName, boolean pCreate)
          Resolves the specified name, relative to this context's parent.
 void rollback()
          Cancels any operations performed by this Thread since the last commit or rollback, releasing any Connection resources.
 void sendLogEvent(LogEvent pLogEvent)
          Sends a LogEvent to all of the listeners
 void setCacheSize(int pCacheSize)
           
 void setConnectionPool(JDBCConnectionPool pConnectionPool)
           
 void setDataSource(javax.sql.DataSource pDataSource)
           
 void setDescriptionFiles(java.io.File[] pDescriptionFiles)
           
 void setDescriptionResourceFiles(java.lang.String[] pDescriptionResourceFiles)
           
 void setEnforceMemoryAsynchronously(boolean pEnforceMemoryAsynchronously)
           
 void setEnforceMemoryMaximumRemove(int pEnforceMemoryMaximumRemove)
           
 void setEnforceMemorySchedule(Schedule pEnforceMemorySchedule)
           
 void setInvalidationRelay(InvalidationRelay pInvalidationRelay)
           
 void setJDBCConnection(java.sql.Connection pJDBCConnection)
           
 void setJoinStyle(java.lang.String pJoinStyle)
           
 void setLoggingDebug(boolean pLogging)
          Sets whether or not error log events should be logged.
 void setLoggingError(boolean pLogging)
          Sets whether or not error log events should be logged.
 void setLoggingInfo(boolean pLogging)
          Sets whether or not info log events should be logged.
 void setLoggingWarning(boolean pLogging)
          Sets whether or not warning log events should be logged.
 void setMaximumEntryLifetime(long pMaximumEntryLifetime)
           
 void setRelayRegisterName(java.lang.String pRelayRegisterName)
           
 void setScheduler(Scheduler pScheduler)
           
 void setServiceInfo(java.lang.String pServiceInfo)
          Sets the a descriptive string about this service
 void setTransaction(javax.transaction.Transaction pTransaction)
           
 void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
           
 void setUseCallableStatement(boolean pUseCallableStatement)
           
 void setUseDataSource(boolean pUseDataSource)
           
 void setUseSetAsciiStream(boolean pUseSetAsciiStream)
           
 void setUseSetBinaryStream(boolean pUseSetBinaryStream)
           
 void setUseSetCharacterStream(boolean pUseSetCharacterStream)
           
 void setUseSetObject(boolean pUseSetObject)
           
 void setUseSetUnicodeStream(boolean pUseSetUnicodeStream)
           
 void setVerifyDefinitionFiles(boolean pVerifyDefinitionFiles)
           
 void startService(ServiceEvent pEvent)
          Starts the service running.
 void stopService()
          Stops the service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

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

SERVICE_INFO_KEY

public static final java.lang.String SERVICE_INFO_KEY
Should be used as a key to retrieve the serviceInfo property from ResourceBundles

See Also:
Constant Field Values

JOIN_STYLE_DB2

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

JOIN_STYLE_INFORMIX

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

JOIN_STYLE_ORACLE

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

JOIN_STYLE_SYBASE

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

JOIN_STYLE_MICROSOFT

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

JOIN_STYLE_ANSI

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

JOIN_STYLE_NONE

public static final java.lang.String JOIN_STYLE_NONE
See Also:
Constant Field Values
Constructor Detail

RelationalViewManagerImpl

public RelationalViewManagerImpl()
Constructor

Method Detail

getTransaction

public javax.transaction.Transaction getTransaction()

setTransaction

public void setTransaction(javax.transaction.Transaction pTransaction)

getDescriptionFiles

public java.io.File[] getDescriptionFiles()

setDescriptionFiles

public void setDescriptionFiles(java.io.File[] pDescriptionFiles)

getDescriptionResourceFiles

public java.lang.String[] getDescriptionResourceFiles()

setDescriptionResourceFiles

public void setDescriptionResourceFiles(java.lang.String[] pDescriptionResourceFiles)

getJDBCConnection

public java.sql.Connection getJDBCConnection()

setJDBCConnection

public void setJDBCConnection(java.sql.Connection pJDBCConnection)

getConnectionPool

public JDBCConnectionPool getConnectionPool()

setConnectionPool

public void setConnectionPool(JDBCConnectionPool pConnectionPool)

getTransactionManager

public javax.transaction.TransactionManager getTransactionManager()

setTransactionManager

public void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)

getDataSource

public javax.sql.DataSource getDataSource()

setDataSource

public void setDataSource(javax.sql.DataSource pDataSource)

getUseDataSource

public boolean getUseDataSource()

setUseDataSource

public void setUseDataSource(boolean pUseDataSource)

getCacheSize

public int getCacheSize()

setCacheSize

public void setCacheSize(int pCacheSize)

getMaximumEntryLifetime

public long getMaximumEntryLifetime()

setMaximumEntryLifetime

public void setMaximumEntryLifetime(long pMaximumEntryLifetime)

getVerifyDefinitionFiles

public boolean getVerifyDefinitionFiles()

setVerifyDefinitionFiles

public void setVerifyDefinitionFiles(boolean pVerifyDefinitionFiles)

getUseSetObject

public boolean getUseSetObject()

setUseSetObject

public void setUseSetObject(boolean pUseSetObject)

getUseSetBinaryStream

public boolean getUseSetBinaryStream()

setUseSetBinaryStream

public void setUseSetBinaryStream(boolean pUseSetBinaryStream)

getUseSetAsciiStream

public boolean getUseSetAsciiStream()

setUseSetAsciiStream

public void setUseSetAsciiStream(boolean pUseSetAsciiStream)

getUseSetUnicodeStream

public boolean getUseSetUnicodeStream()

setUseSetUnicodeStream

public void setUseSetUnicodeStream(boolean pUseSetUnicodeStream)

getUseSetCharacterStream

public boolean getUseSetCharacterStream()

setUseSetCharacterStream

public void setUseSetCharacterStream(boolean pUseSetCharacterStream)

getUseCallableStatement

public boolean getUseCallableStatement()

setUseCallableStatement

public void setUseCallableStatement(boolean pUseCallableStatement)

getJoinStyle

public java.lang.String getJoinStyle()

setJoinStyle

public void setJoinStyle(java.lang.String pJoinStyle)

isDB2JoinStyle

public boolean isDB2JoinStyle()

isInformixJoinStyle

public boolean isInformixJoinStyle()

isOracleJoinStyle

public boolean isOracleJoinStyle()

isSybaseJoinStyle

public boolean isSybaseJoinStyle()

isAnsiJoinStyle

public boolean isAnsiJoinStyle()

isNoneJoinStyle

public boolean isNoneJoinStyle()

getInvalidationRelay

public InvalidationRelay getInvalidationRelay()

setInvalidationRelay

public void setInvalidationRelay(InvalidationRelay pInvalidationRelay)

getRelayRegisterName

public java.lang.String getRelayRegisterName()

setRelayRegisterName

public void setRelayRegisterName(java.lang.String pRelayRegisterName)

getEnforceMemoryAsynchronously

public boolean getEnforceMemoryAsynchronously()

setEnforceMemoryAsynchronously

public void setEnforceMemoryAsynchronously(boolean pEnforceMemoryAsynchronously)

getEnforceMemorySchedule

public Schedule getEnforceMemorySchedule()

setEnforceMemorySchedule

public void setEnforceMemorySchedule(Schedule pEnforceMemorySchedule)

getEnforceMemoryMaximumRemove

public int getEnforceMemoryMaximumRemove()

setEnforceMemoryMaximumRemove

public void setEnforceMemoryMaximumRemove(int pEnforceMemoryMaximumRemove)

getScheduler

public Scheduler getScheduler()

setScheduler

public void setScheduler(Scheduler pScheduler)

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException

Returns a Connection that a RelationalViewImpl can use. If a Connection was explicitly assigned to the "JDBCConnection" property, then that connection will be returned. If a DataSource/TransactionManager has been assigned and useDataSource is set to true, then a Connection will be returned from the DataSource, using the transaction manager. If a JDBCConnectionPool was assigned to the "connectionPool" property, then a Connection will be returned from the pool. Only one Connection will be allocated per Thread - i.e., if the Thread has already checked out a Connection, then that same connection will be returned. The Connection will not be returned to the connection pool until commit or rollback is called.

Applications should avoid calling commit, rollback, or close on the Connection. Instead, the application should call commit or rollback on the RelationalViewManager, which will automatically take care of the Connection. If useDataSource is set to true, then then the standard transaction mechanisms can be used to complete the transaction - they are equivalent to calling commit/rollback on the RelationalViewManager.

Specified by:
getConnection in class RelationalViewManager
Throws:
java.sql.SQLException

performScheduledTask

public void performScheduledTask(Scheduler pScheduler,
                                 ScheduledJob pJob)
Removes enough entries to get the memory size back within allowed limits

Specified by:
performScheduledTask in interface Schedulable
Parameters:
pScheduler - calling the job
pJob - the ScheduledJob

doStartService

public void doStartService()
                    throws ServiceException
This initializes the manager by reading the description files and creating the internal structures needed to handle the RelationalViews and caches.

Throws:
ServiceException

initialize

public void initialize(java.io.File[] pFiles)
                throws RelationalViewException
Initializes the RelationalViewManagerImpl from the specified list of Files. The Files are treated as if they were concatenated, in order, into a single file.

Throws:
RelationalViewException

initialize

public void initialize(java.lang.String[] pResourceFiles)
                throws RelationalViewException
Initializes the RelationalViewManagerImpl from the specified list of resource file names. The resource files are treated as if they were concatenated, in order, into a single file. The resource file names are resolved by searching through CLASSPATH. For example, if a name is "atg/rviews/Rview1.rvw", then this will search through CLASSPATH for a file with that name (thereby allowing .rvw files to be packaged with classes).

Throws:
RelationalViewException

initialize

public void initialize(DefinitionFile pParsedFile)
                throws RelationalViewException
Initializes the RelationalViewManagerImpl from the specified DefinitionFile, which should be parsed from a description file or created "by hand".

Throws:
RelationalViewException

initialize

public void initialize(java.io.InputStream pIn)
                throws RelationalViewException
Initializes the RelationalViewManagerImpl by reading the description file from the given InputStream.

Throws:
RelationalViewException

getRowmap

public atg.rview.Rowmap getRowmap(java.lang.String pRowmapName)
Returns the Rowmap with the given name, or null if there is no such Rowmap.


getDefinitionFile

public DefinitionFile getDefinitionFile()
Returns the DefinitionFile that defines all of the RelationalViews and ResultSetProcessors used by the RelationalViewManager.

Specified by:
getDefinitionFile in class RelationalViewManager

getRelationalView

public RelationalView getRelationalView(java.lang.String pRelationalViewName)
Returns the RelationalView with the given name, or null if there is no such RelationalView.

Specified by:
getRelationalView in class RelationalViewManager

getResultSetProcessor

public ResultSetProcessor getResultSetProcessor(java.lang.String pResultSetProcessorName)
Returns the ResultSetProcessor with the given name, or null if there is no such ResultSetProcessor.

Specified by:
getResultSetProcessor in class RelationalViewManager

getCacheInfo

public CacheInfo getCacheInfo()
Returns a CacheInfo describing the runtime state of the internal caches.

Specified by:
getCacheInfo in class RelationalViewManager

invalidateAllCaches

public void invalidateAllCaches()
This invalidates all of the caches in the system.

Specified by:
invalidateAllCaches in interface CacheInvalidationListener

invalidateCachesByTableName

public void invalidateCachesByTableName(java.lang.String pTableName)
This invalidates all of the caches whose entries depend on the specified table.

Specified by:
invalidateCachesByTableName in interface CacheInvalidationListener

invalidateCache

public void invalidateCache(java.lang.String pCacheName)
Invalidates all of the entries in the cache with the specified name. The cache name follows the form {rviewName}.{subviewName}.{call} (i.e., "Person.byId.select.all").

Specified by:
invalidateCache in interface CacheInvalidationListener

invalidateCacheEntry

public void invalidateCacheEntry(java.lang.String pCacheName,
                                 java.lang.Object[] pKey)
Invalidates an entry in the specified cache. The cache name follows the form {rviewName}.{subviewName}.{call} (i.e., "Person.byId.select.all"). The key indicates which entry is to be invalidated (the key is an array because a cache entry may have a multi-column key). The size of the key should be the same number and types as the cache's keyProperties.

Specified by:
invalidateCacheEntry in interface CacheInvalidationListener

invalidateCacheEntries

public void invalidateCacheEntries(java.lang.String pCacheName,
                                   java.lang.Object[][] pKeys)
Invalidates multiple entries in the specified cache. The cache name follows the form {rviewName}.{subviewName}.{call} (i.e., "Person.byId.select.all"). The keys indicate which entries are to be invalidated (each key is an array because a cache entry may have a multi-column key, and because this method can invalidate a number of entries, this array takes a double-dimensioned key). The size of the key should be the same number and types as the cache's keyProperties.

Specified by:
invalidateCacheEntries in interface CacheInvalidationListener

commit

public void commit()
            throws java.sql.SQLException

Commits any operations performed by this Thread since the last commit or rollback, releasing any Connection resources, and committing any cache invalidations that have occurred as a result of the committed operations.

If useDataSource is set to true, then this call is ignored (and generates a warning if isLoggingWarning is set to true). The standard JTA facilities should take care of committing.

Specified by:
commit in class RelationalViewManager
Throws:
java.sql.SQLException

rollback

public void rollback()
              throws java.sql.SQLException

Cancels any operations performed by this Thread since the last commit or rollback, releasing any Connection resources.

If useDataSource is set to true, then this call is equivalent to calling rollback on the JTA transaction.

Specified by:
rollback in class RelationalViewManager
Throws:
java.sql.SQLException

getRoot

public NameContext getRoot()
Searches up the tree until it finds the root NameContext


doStopService

public void doStopService()
                   throws ServiceException
This is called when a Service is required to shut down. The Service should respond by stopping any processes that it has started.

Throws:
ServiceException - if the Service had a problem shutting down

getServiceInfo

public java.lang.String getServiceInfo()
Returns the a descriptive string about this service


setServiceInfo

public void setServiceInfo(java.lang.String pServiceInfo)
Sets the a descriptive string about this service


addLogListener

public void addLogListener(LogListener pListener)
Adds a listener to the list of log listeners


removeLogListener

public void removeLogListener(LogListener pListener)
Removes a listener from the list of log listeners


getLogListeners

public LogListener[] getLogListeners()
Returns the list of log listeners as an array property.


getLogListenerCount

public int getLogListenerCount()
Returns the number of log listeners


sendLogEvent

public void sendLogEvent(LogEvent pLogEvent)
Sends a LogEvent to all of the listeners


resolveName

public java.lang.Object resolveName(java.lang.String pName,
                                    boolean pCreate)
Resolves the specified name, relative to this context's parent.

Parameters:
pName - the name to be resolved
pCreate - flag indicating whether Nucleus should attempt to create the object if it does not already exist in the naming hierarchy.
Returns:
the Object to which the name resolves, or null if the name could not be resolved. Any errors that occur are directed to listeners of the Nucleus.

resolveName

public java.lang.Object resolveName(java.lang.String pName)
Resolves the specified name, relative to this context's parent. This will attempt to create the service for the specified name if it does not already exist.

Parameters:
pName - the name to be resolved
Returns:
the Object to which the name resolves, or null if the name could not be resolved. Any errors that occur are directed to listeners of the Nucleus.

getAbsoluteName

public java.lang.String getAbsoluteName()
Returns the absolute name of this service, using Nucleus to get the absolute name.


nameContextElementBound

public void nameContextElementBound(NameContextBindingEvent pEvent)
This is called to notify this context that it is being bound into a NameContext.

Specified by:
nameContextElementBound in interface NameContextBindingListener

nameContextElementUnbound

public void nameContextElementUnbound(NameContextBindingEvent pEvent)
This is called to notify this context that it is being unbound from a NameContext.

Specified by:
nameContextElementUnbound in interface NameContextBindingListener

getNameContext

public NameContext getNameContext()
Returns the NameContext into which this element has been bound, or null if the element is not bound in a NameContext.

Specified by:
getNameContext in interface NameContextElement

getName

public java.lang.String getName()
Returns the name by which this element is know within its enclosing NameContext.

Specified by:
getName in interface NameContextElement

startService

public void startService(ServiceEvent pEvent)
                  throws ServiceException
Starts the service running. This will be called after the service has been placed into the naming hierarchy, and all of its properties have been set.

Specified by:
startService in interface ServiceListener
Parameters:
pEvent - the ServiceEvent encapsulating information about the Service's environment and configuration
Throws:
ServiceException - if an error occurred while attempting to start the service.

stopService

public void stopService()
                 throws ServiceException
Stops the service. This will be called when the Service is being shut down, either by explicit instructions from the administrator, or for various other reasons. A Service should clean up any resources it is using, but should be prepared to restart itself. When asked to restart, its properties may have changed.

Specified by:
stopService in interface ServiceListener
Throws:
ServiceException - if an error occurred while attempting to stop the service.

getNucleus

public Nucleus getNucleus()
Returns the Nucleus managing this Service

Specified by:
getNucleus in interface Service

getServiceConfiguration

public Configuration getServiceConfiguration()
Returns the Configuration that was used to create this Service, null if there was none.

Specified by:
getServiceConfiguration in interface Service

isRunning

public boolean isRunning()
Returns true if this Service is currently running.

Specified by:
isRunning in interface Service

isLoggingInfo

public boolean isLoggingInfo()
This method returns whether or not an info log event should be broadcast.

Specified by:
isLoggingInfo in interface ApplicationLogging
Returns:
boolean true if info log events should be logged
false if info log events should not be logged

setLoggingInfo

public void setLoggingInfo(boolean pLogging)
Sets whether or not info log events should be logged.

Specified by:
setLoggingInfo in interface ApplicationLogging

isLoggingWarning

public boolean isLoggingWarning()
This method returns whether or not an warning log event should be broadcast.

Specified by:
isLoggingWarning in interface ApplicationLogging
Returns:
boolean true if warning log events should be logged
false if warning log events should not be logged

setLoggingWarning

public void setLoggingWarning(boolean pLogging)
Sets whether or not warning log events should be logged.

Specified by:
setLoggingWarning in interface ApplicationLogging

isLoggingError

public boolean isLoggingError()
This method returns whether or not an error log event should be broadcast.

Specified by:
isLoggingError in interface ApplicationLogging
Returns:
boolean true if error log events should be logged
false if error log events should not be logged

setLoggingError

public void setLoggingError(boolean pLogging)
Sets whether or not error log events should be logged.

Specified by:
setLoggingError in interface ApplicationLogging

isLoggingDebug

public boolean isLoggingDebug()
This method returns whether or not an debug log event should be broadcast.

Specified by:
isLoggingDebug in interface ApplicationLogging
Returns:
boolean true if debug log events should be logged
false if debug log events should not be logged

setLoggingDebug

public void setLoggingDebug(boolean pLogging)
Sets whether or not error log events should be logged.

Specified by:
setLoggingDebug in interface ApplicationLogging

logInfo

public void logInfo(java.lang.String pMessage)
Logs an info event with the specified message

Specified by:
logInfo in interface ApplicationLogging

logInfo

public void logInfo(java.lang.Throwable pThrowable)
Logs an info event with the specified Throwable

Specified by:
logInfo in interface ApplicationLogging

logInfo

public void logInfo(java.lang.String pMessage,
                    java.lang.Throwable pThrowable)
Logs an info event with the specified message and Throwable

Specified by:
logInfo in interface ApplicationLogging

logWarning

public void logWarning(java.lang.String pMessage)
Logs an warning event with the specified message

Specified by:
logWarning in interface ApplicationLogging

logWarning

public void logWarning(java.lang.Throwable pThrowable)
Logs an warning event with the specified Throwable

Specified by:
logWarning in interface ApplicationLogging

logWarning

public void logWarning(java.lang.String pMessage,
                       java.lang.Throwable pThrowable)
Logs an warning event with the specified message and Throwable

Specified by:
logWarning in interface ApplicationLogging

logError

public void logError(java.lang.String pMessage)
Logs an error event with the specified message

Specified by:
logError in interface ApplicationLogging

logError

public void logError(java.lang.Throwable pThrowable)
Logs an error event with the specified Throwable

Specified by:
logError in interface ApplicationLogging

logError

public void logError(java.lang.String pMessage,
                     java.lang.Throwable pThrowable)
Logs an error event with the specified message and Throwable

Specified by:
logError in interface ApplicationLogging

logDebug

public void logDebug(java.lang.String pMessage)
Logs an debug event with the specified message

Specified by:
logDebug in interface ApplicationLogging

logDebug

public void logDebug(java.lang.Throwable pThrowable)
Logs an debug event with the specified Throwable

Specified by:
logDebug in interface ApplicationLogging

logDebug

public void logDebug(java.lang.String pMessage,
                     java.lang.Throwable pThrowable)
Logs an debug event with the specified message and Throwable

Specified by:
logDebug in interface ApplicationLogging

getAdminServlet

public javax.servlet.Servlet getAdminServlet()
Returns the Servlet that will handle requests directed at this service. This will first check to see if the servlet is already created, and if not it will create it by calling createAdminServlet.

Specified by:
getAdminServlet in interface AdminableService
See Also:
createAdminServlet()

createAdminServlet

protected javax.servlet.Servlet createAdminServlet()
Creates and returns a new Servlet that will administer this service. By default, this creates a ServiceAdminServlet, but subclasses may create their own servlets.


checkInternalIntegrity

public boolean checkInternalIntegrity()
This checks the integrity of the cache manager's internal structures, especially the LRU list of entries. Returns true if the integrity checks out, false if an integrity problem is found. Warning messages are printed to the RelationalViewManager's log displaying the details of the integrity check.


reportInternalIntegrity

public java.lang.String reportInternalIntegrity()
This checks the integrity of the cache manager's internal structures, especially the LRU list of entries. Returns a String report of the integrity and also logs warning messages to the RelationalViewManager's log. Useful from the component browser.