|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectatg.rview.RelationalViewManager
atg.rview.RelationalViewManagerImpl
public class RelationalViewManagerImpl
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 |
|---|
public static final java.lang.String CLASS_VERSION
public static final java.lang.String SERVICE_INFO_KEY
public static final java.lang.String JOIN_STYLE_DB2
public static final java.lang.String JOIN_STYLE_INFORMIX
public static final java.lang.String JOIN_STYLE_ORACLE
public static final java.lang.String JOIN_STYLE_SYBASE
public static final java.lang.String JOIN_STYLE_MICROSOFT
public static final java.lang.String JOIN_STYLE_ANSI
public static final java.lang.String JOIN_STYLE_NONE
| Constructor Detail |
|---|
public RelationalViewManagerImpl()
| Method Detail |
|---|
public javax.transaction.Transaction getTransaction()
public void setTransaction(javax.transaction.Transaction pTransaction)
public java.io.File[] getDescriptionFiles()
public void setDescriptionFiles(java.io.File[] pDescriptionFiles)
public java.lang.String[] getDescriptionResourceFiles()
public void setDescriptionResourceFiles(java.lang.String[] pDescriptionResourceFiles)
public java.sql.Connection getJDBCConnection()
public void setJDBCConnection(java.sql.Connection pJDBCConnection)
public JDBCConnectionPool getConnectionPool()
public void setConnectionPool(JDBCConnectionPool pConnectionPool)
public javax.transaction.TransactionManager getTransactionManager()
public void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
public javax.sql.DataSource getDataSource()
public void setDataSource(javax.sql.DataSource pDataSource)
public boolean getUseDataSource()
public void setUseDataSource(boolean pUseDataSource)
public int getCacheSize()
public void setCacheSize(int pCacheSize)
public long getMaximumEntryLifetime()
public void setMaximumEntryLifetime(long pMaximumEntryLifetime)
public boolean getVerifyDefinitionFiles()
public void setVerifyDefinitionFiles(boolean pVerifyDefinitionFiles)
public boolean getUseSetObject()
public void setUseSetObject(boolean pUseSetObject)
public boolean getUseSetBinaryStream()
public void setUseSetBinaryStream(boolean pUseSetBinaryStream)
public boolean getUseSetAsciiStream()
public void setUseSetAsciiStream(boolean pUseSetAsciiStream)
public boolean getUseSetUnicodeStream()
public void setUseSetUnicodeStream(boolean pUseSetUnicodeStream)
public boolean getUseSetCharacterStream()
public void setUseSetCharacterStream(boolean pUseSetCharacterStream)
public boolean getUseCallableStatement()
public void setUseCallableStatement(boolean pUseCallableStatement)
public java.lang.String getJoinStyle()
public void setJoinStyle(java.lang.String pJoinStyle)
public boolean isDB2JoinStyle()
public boolean isInformixJoinStyle()
public boolean isOracleJoinStyle()
public boolean isSybaseJoinStyle()
public boolean isAnsiJoinStyle()
public boolean isNoneJoinStyle()
public InvalidationRelay getInvalidationRelay()
public void setInvalidationRelay(InvalidationRelay pInvalidationRelay)
public java.lang.String getRelayRegisterName()
public void setRelayRegisterName(java.lang.String pRelayRegisterName)
public boolean getEnforceMemoryAsynchronously()
public void setEnforceMemoryAsynchronously(boolean pEnforceMemoryAsynchronously)
public Schedule getEnforceMemorySchedule()
public void setEnforceMemorySchedule(Schedule pEnforceMemorySchedule)
public int getEnforceMemoryMaximumRemove()
public void setEnforceMemoryMaximumRemove(int pEnforceMemoryMaximumRemove)
public Scheduler getScheduler()
public void setScheduler(Scheduler pScheduler)
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.
getConnection in class RelationalViewManagerjava.sql.SQLException
public void performScheduledTask(Scheduler pScheduler,
ScheduledJob pJob)
performScheduledTask in interface SchedulablepScheduler - calling the jobpJob - the ScheduledJob
public void doStartService()
throws ServiceException
ServiceException
public void initialize(java.io.File[] pFiles)
throws RelationalViewException
RelationalViewException
public void initialize(java.lang.String[] pResourceFiles)
throws RelationalViewException
RelationalViewException
public void initialize(DefinitionFile pParsedFile)
throws RelationalViewException
RelationalViewException
public void initialize(java.io.InputStream pIn)
throws RelationalViewException
RelationalViewExceptionpublic atg.rview.Rowmap getRowmap(java.lang.String pRowmapName)
public DefinitionFile getDefinitionFile()
getDefinitionFile in class RelationalViewManagerpublic RelationalView getRelationalView(java.lang.String pRelationalViewName)
getRelationalView in class RelationalViewManagerpublic ResultSetProcessor getResultSetProcessor(java.lang.String pResultSetProcessorName)
getResultSetProcessor in class RelationalViewManagerpublic CacheInfo getCacheInfo()
getCacheInfo in class RelationalViewManagerpublic void invalidateAllCaches()
invalidateAllCaches in interface CacheInvalidationListenerpublic void invalidateCachesByTableName(java.lang.String pTableName)
invalidateCachesByTableName in interface CacheInvalidationListenerpublic void invalidateCache(java.lang.String pCacheName)
invalidateCache in interface CacheInvalidationListener
public void invalidateCacheEntry(java.lang.String pCacheName,
java.lang.Object[] pKey)
invalidateCacheEntry in interface CacheInvalidationListener
public void invalidateCacheEntries(java.lang.String pCacheName,
java.lang.Object[][] pKeys)
invalidateCacheEntries in interface CacheInvalidationListener
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.
commit in class RelationalViewManagerjava.sql.SQLException
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.
rollback in class RelationalViewManagerjava.sql.SQLExceptionpublic NameContext getRoot()
public void doStopService()
throws ServiceException
ServiceException - if the Service had a problem shutting downpublic java.lang.String getServiceInfo()
public void setServiceInfo(java.lang.String pServiceInfo)
public void addLogListener(LogListener pListener)
public void removeLogListener(LogListener pListener)
public LogListener[] getLogListeners()
public int getLogListenerCount()
public void sendLogEvent(LogEvent pLogEvent)
public java.lang.Object resolveName(java.lang.String pName,
boolean pCreate)
pName - the name to be resolvedpCreate - flag indicating whether Nucleus should attempt to
create the object if it does not already exist in the naming
hierarchy.
public java.lang.Object resolveName(java.lang.String pName)
pName - the name to be resolved
public java.lang.String getAbsoluteName()
public void nameContextElementBound(NameContextBindingEvent pEvent)
nameContextElementBound in interface NameContextBindingListenerpublic void nameContextElementUnbound(NameContextBindingEvent pEvent)
nameContextElementUnbound in interface NameContextBindingListenerpublic NameContext getNameContext()
getNameContext in interface NameContextElementpublic java.lang.String getName()
getName in interface NameContextElement
public void startService(ServiceEvent pEvent)
throws ServiceException
startService in interface ServiceListenerpEvent - the ServiceEvent encapsulating information about
the Service's environment and configuration
ServiceException - if an error occurred while attempting
to start the service.
public void stopService()
throws ServiceException
stopService in interface ServiceListenerServiceException - if an error occurred while attempting
to stop the service.public Nucleus getNucleus()
getNucleus in interface Servicepublic Configuration getServiceConfiguration()
getServiceConfiguration in interface Servicepublic boolean isRunning()
isRunning in interface Servicepublic boolean isLoggingInfo()
isLoggingInfo in interface ApplicationLoggingpublic void setLoggingInfo(boolean pLogging)
setLoggingInfo in interface ApplicationLoggingpublic boolean isLoggingWarning()
isLoggingWarning in interface ApplicationLoggingpublic void setLoggingWarning(boolean pLogging)
setLoggingWarning in interface ApplicationLoggingpublic boolean isLoggingError()
isLoggingError in interface ApplicationLoggingpublic void setLoggingError(boolean pLogging)
setLoggingError in interface ApplicationLoggingpublic boolean isLoggingDebug()
isLoggingDebug in interface ApplicationLoggingpublic void setLoggingDebug(boolean pLogging)
setLoggingDebug in interface ApplicationLoggingpublic void logInfo(java.lang.String pMessage)
logInfo in interface ApplicationLoggingpublic void logInfo(java.lang.Throwable pThrowable)
logInfo in interface ApplicationLogging
public void logInfo(java.lang.String pMessage,
java.lang.Throwable pThrowable)
logInfo in interface ApplicationLoggingpublic void logWarning(java.lang.String pMessage)
logWarning in interface ApplicationLoggingpublic void logWarning(java.lang.Throwable pThrowable)
logWarning in interface ApplicationLogging
public void logWarning(java.lang.String pMessage,
java.lang.Throwable pThrowable)
logWarning in interface ApplicationLoggingpublic void logError(java.lang.String pMessage)
logError in interface ApplicationLoggingpublic void logError(java.lang.Throwable pThrowable)
logError in interface ApplicationLogging
public void logError(java.lang.String pMessage,
java.lang.Throwable pThrowable)
logError in interface ApplicationLoggingpublic void logDebug(java.lang.String pMessage)
logDebug in interface ApplicationLoggingpublic void logDebug(java.lang.Throwable pThrowable)
logDebug in interface ApplicationLogging
public void logDebug(java.lang.String pMessage,
java.lang.Throwable pThrowable)
logDebug in interface ApplicationLoggingpublic javax.servlet.Servlet getAdminServlet()
getAdminServlet in interface AdminableServicecreateAdminServlet()protected javax.servlet.Servlet createAdminServlet()
public boolean checkInternalIntegrity()
public java.lang.String reportInternalIntegrity()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||