public abstract class RuntimeServices
extends java.lang.Object
Purpose: Provide a dynamic interface into the EclipseLink Session.
Description: This class is meant to provide a framework for gaining access to configuration of the EclipseLink Session during runtime. It will provide the basis for development of a JMX service and possibly other frameworks.
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
EclipseLink_Product_Name |
java.lang.String |
objectName |
protected static java.lang.String |
PLATFORM_NAME
Short name for the server platform - Must override in subclass
|
protected Session |
session
stores access to the session object that we are controlling
|
Constructor and Description |
---|
RuntimeServices()
Default Constructor
|
RuntimeServices(Session session)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addNewConnectionPool(java.lang.String poolName,
int maxSize,
int minSize,
java.lang.String platform,
java.lang.String driverClassName,
java.lang.String url,
java.lang.String userName,
java.lang.String password)
This method provides client with access to add a new connection pool to a EclipseLink
ServerSession.
|
void |
clearStatementCache()
Used to clear the statement cache.
|
java.lang.String |
getApplicationName()
getApplicationName(): Answer the name of the module (EAR name) that this session is associated with.
|
java.util.List |
getAvailableConnectionPools()
This method will return the available Connection pools within this Server Session
|
protected java.lang.String |
getCacheTypeFor(java.lang.Class identityMapClass)
INTERNAL:
getCacheTypeFor: Give a more UI-friendly version of the cache type
|
java.util.List |
getClassesInSession()
This method is used to return those Class Names that have identity Maps in the Session.
|
java.lang.Object[][] |
getClassSummaryDetails()
PUBLIC: Provide an instance of 2 Dimensional Array simulating tabular format information about all
classes in the session.
|
java.util.List<ClassSummaryDetailBase> |
getClassSummaryDetailsArray()
Provide a list of instance of ClassSummaryDetail containing information about all
classes in the session.
|
java.lang.Object[][] |
getClassSummaryDetailsUsingFilter(java.lang.String filter)
Provide an instance of 2 Dimensional Array simulating tabular format information about all
classes in the session whose class names match the provided filter.
|
java.util.List<ClassSummaryDetailBase> |
getClassSummaryDetailsUsingFilterArray(java.lang.String filter)
Provide a list of instance of ClassSummaryDetail containing information about the
classes in the session whose class names match the provided filter.
|
java.lang.String |
getConnectionPoolType()
Return connection pool type.
|
java.lang.String |
getCurrentEclipseLinkLogLevel()
PUBLIC: Answer the EclipseLink log level that is changeable.
|
java.lang.String |
getDatabasePlatform()
Return the database platform used by the DatabaseSession.
|
java.lang.String |
getDeployedEclipseLinkLogLevel()
PUBLIC: Answer the EclipseLink log level at deployment time.
|
SessionLog |
getDeployedSessionLog() |
int |
getDeployedSessionProfileWeight() |
java.lang.String |
getDriver()
Return db driver class name.
|
java.lang.String |
getJdbcConnectionDetails()
Return JDBCConnection detail information.
|
java.lang.String |
getLogFilename()
Return the log filename.
|
int |
getLogLevel(java.lang.String category)
Return the log level
|
java.lang.String |
getLogType()
Return the log type, either "EclipseLink", "Java" or the simple name of the logging class used.
|
java.util.Vector |
getMappedClassNamesUsingFilter(java.lang.String filter)
INTERNAL:
This method traverses the EclipseLink descriptors and returns a Vector of the descriptor's
reference class names that match the provided filter.
|
java.lang.Integer |
getMaxSizeForPool(java.lang.String poolName)
This method will retrieve the max size of a particular connection pool
|
java.lang.Integer |
getMinSizeForPool(java.lang.String poolName)
This method will retrieve the min size of a particular connection pool
|
java.lang.String |
getModuleName()
getModuleName(): Answer the name of the context-root of the application that this session is associated with.
|
java.lang.Integer |
getNumberOfObjectsInAllIdentityMaps()
This method will SUM and return the number of objects in all Identity Maps in the session.
|
java.lang.Integer |
getNumberOfObjectsInIdentityMap(java.lang.String className)
This method is used to return the number of objects in a particular Identity Map
|
java.lang.Integer |
getNumberOfObjectsInIdentityMapSubCache(java.lang.String className)
This method is used to return the number of objects in a particular Identity Map's
subcache.
|
java.lang.Integer |
getNumberOfPersistentClasses()
This method will answer the number of persistent classes contained in the session.
|
java.lang.String |
getObjectName() |
java.util.List |
getObjectsInIdentityMap(java.lang.String className)
This method will return a collection of the objects in the Identity Map.
|
java.util.List |
getObjectsInIdentityMapSubCacheAsMap(java.lang.String className)
This method is used to return a Map of the objects in a particular Identity Map's
subcache.
|
int |
getProfileWeight()
Return the DMS sensor weight
|
java.lang.String |
getProfilingType()
This method is used to get the type of profiling.
|
int |
getSequencePreallocationSize()
Method returns the value of the Sequence Preallocation size
|
protected org.eclipse.persistence.internal.sessions.AbstractSession |
getSession()
INTERNAL:
|
java.lang.String |
getSessionName()
Answer the name of the EclipseLink session this MBean represents.
|
java.lang.String |
getSessionType()
Answer the type of the EclipseLink session this MBean represents.
|
java.lang.Boolean |
getShouldBindAllParameters()
Method returns if all Parameters should be bound or not
|
boolean |
getShouldCacheAllStatements()
Returns if statements should be cached or not
|
boolean |
getShouldLogMessages()
This method is used to determine if logging is turned on
|
boolean |
getShouldLogPerformanceProfiler()
Method indicates if Performance profile should be logged
|
boolean |
getShouldProfilePerformance()
This method will return if profiling is turned on or not
|
java.util.List |
getSizeForPool(java.lang.String poolName)
This method will retrieve the size of a particular connection pool
|
int |
getStatementCacheSize()
Returns the statement cache size.
|
java.lang.Integer |
getStringBindingSize()
Return the size of strings after which will be bound into the statement
If we are not using a DatabaseLogin, or we're not using string binding,
answer 0 (zero).
|
java.lang.Long |
getTimeConnectionEstablished()
This method will return a long indicating the exact time in Milliseconds that the
session connected to the database.
|
java.lang.Boolean |
getUsesBatchWriting()
This method will return if batchWriting is in use or not.
|
java.lang.Boolean |
getUsesByteArrayBinding()
Shows if Byte Array Binding is turned on or not
|
java.lang.Boolean |
getUsesEclipseLinkProfiling()
This method answers true if EclipseLink Performance Profiling is on.
|
java.lang.Boolean |
getUsesJDBCBatchWriting()
This method will return if batchWriting is in use or not.
|
java.lang.Boolean |
getUsesNativeSQL()
Shows if native SQL is being used
|
java.lang.Boolean |
getUsesStreamsForBinding()
This method indicates if streams are being used for binding
|
java.lang.Boolean |
getUsesStringBinding()
This method indicates if Strings are being bound
|
void |
initializeAllIdentityMaps()
This method is used to initialize the identity maps in the session.
|
void |
initializeIdentityMap(java.lang.String className)
This method is used to initialize the identity maps specified by className.
|
void |
initializeIdentityMaps(java.lang.String[] classNames)
This method is used to initialize the identity maps specified by the Vector of classNames.
|
void |
invalidateAllIdentityMaps()
This method is used to invalidate the identity maps in the session.
|
void |
invalidateIdentityMap(java.lang.String className)
This method is used to invalidate the identity maps specified by className.
|
void |
invalidateIdentityMap(java.lang.String className,
java.lang.Boolean recurse)
This method is used to invalidate the identity maps specified by className.
|
void |
invalidateIdentityMaps(java.lang.String[] classNamesParam,
java.lang.Boolean recurse)
This method is used to invalidate the identity maps specified by the String[] of classNames.
|
boolean |
isJPASession()
Return whether this session is an EclipseLink JPA session.
|
void |
printAllIdentityMapTypes()
This method will log the types of Identity Maps in the session.
|
void |
printAvailableConnectionPools()
This method will print the available Connection pools to the SessionLog.
|
void |
printClassesInSession()
This method is used to output those Class Names that have identity Maps in the Session.
|
void |
printIdentityMapLocks()
This method will log the instance level locks in all Identity Maps in the session.
|
void |
printIdentityMapLocks(java.lang.String registeredClassName)
This method will log the instance level locks in the Identity Map for the given class in the session.
|
void |
printObjectsInIdentityMap(java.lang.String className)
This method will log the objects in the Identity Map.
|
void |
printObjectsInIdentityMaps()
This method will log all objects in all Identity Maps in the session.
|
void |
printProfileSummary()
This method assumes EclipseLink Profiling (as opposed to Java profiling).
|
void |
printProfileSummaryByClass()
This method assumes EclipseLink Profiling (as opposed to Java profiling).
|
void |
printProfileSummaryByQuery()
This method assumes EclipseLink Profiling (as opposed to Java profiling).
|
void |
resetAllConnections()
This method is used to reset connections from the session to the database.
|
void |
setCurrentEclipseLinkLogLevel(java.lang.String newLevel)
PUBLIC: Set the EclipseLink log level to be used at runtime.
|
void |
setLogLevel(int level)
Set the log level
|
void |
setProfileWeight(int weight)
This method is used to change DMS sensor weight.
|
void |
setProfilingType(java.lang.String profileType)
This method is used to select the type of profiling.
|
void |
setSequencePreallocationSize(int size)
This method provide access for setting the sequence pre-allocation size
|
protected void |
setSession(org.eclipse.persistence.internal.sessions.AbstractSession newSession)
INTERNAL:
Define the session that this instance is providing runtime services for
|
void |
setShouldCacheAllStatements(boolean shouldCacheAllStatements)
Method used to set if statements should be cached.
|
void |
setShouldLogPerformanceProfiler(boolean shouldLogPerformanceProfiler)
This method is used to turn on Profile logging when using the Performance Profiler
|
void |
setShouldProfilePerformance(boolean shouldProfile)
This method is used to turn on Performance Profiling
|
void |
setStatementCacheSize(int size)
Used to set the statement cache size.
|
void |
setUseEclipseLinkProfiling()
This method is used to turn on EclipseLink Performance Profiling
|
void |
setUseNoProfiling()
This method is used to turn off all Performance Profiling, DMS or EclipseLink.
|
boolean |
shouldLog(int Level,
java.lang.String category)
Check if a message of the given level would actually be logged.
|
protected void |
updateDeploymentTimeData()
INTERNAL:
Define the deployment time data associated with logging and profiling
|
void |
updatePoolSize(java.lang.String poolName,
int maxSize,
int minSize)
This method allows the client to set the pool size for a particular pool, based on the pool name
|
protected Session session
public java.lang.String objectName
protected static final java.lang.String EclipseLink_Product_Name
protected static java.lang.String PLATFORM_NAME
public RuntimeServices()
public RuntimeServices(Session session)
session
- the session to be used with these RuntimeServicesprotected org.eclipse.persistence.internal.sessions.AbstractSession getSession()
public java.lang.String getSessionName()
public boolean getShouldLogMessages()
public void setShouldProfilePerformance(boolean shouldProfile)
public boolean getShouldProfilePerformance()
public void setShouldLogPerformanceProfiler(boolean shouldLogPerformanceProfiler)
public boolean getShouldLogPerformanceProfiler()
public void setShouldCacheAllStatements(boolean shouldCacheAllStatements)
public void setStatementCacheSize(int size)
public int getStatementCacheSize()
public void setSequencePreallocationSize(int size)
public int getSequencePreallocationSize()
public void updatePoolSize(java.lang.String poolName, int maxSize, int minSize)
poolName
- the name of the pool to be updated.maxSize
- the new maximum number of connectionsminSize
- the new minimum number of connectionspublic java.util.List getAvailableConnectionPools()
public java.util.List getSizeForPool(java.lang.String poolName)
poolName
- the name of the pool to get the size forpublic void addNewConnectionPool(java.lang.String poolName, int maxSize, int minSize, java.lang.String platform, java.lang.String driverClassName, java.lang.String url, java.lang.String userName, java.lang.String password) throws java.lang.ClassNotFoundException
poolName
- the name of the new poolmaxSize
- the maximum number of connections in the poolminSize
- the minimum number of connections in the poolplatform
- the fully qualified name of the EclipseLink platform to use with this pool.driverClassName
- the fully qualified name of the JDBC driver classurl
- the URL of the database to connect touserName
- the user name to connect to the database withpassword
- the password to connect to the database withjava.lang.ClassNotFoundException
- if any of the class names are misspelled.public void resetAllConnections()
public java.util.List getClassesInSession()
public java.util.List getObjectsInIdentityMap(java.lang.String className) throws java.lang.ClassNotFoundException
className
- the fully qualified classname of the class to the instances ofthrown
- then the IdentityMap for that class name could not be foundjava.lang.ClassNotFoundException
public java.lang.Integer getNumberOfObjectsInIdentityMap(java.lang.String className) throws java.lang.ClassNotFoundException
className
- the fully qualified name of the class to get number of instances of.thrown
- then the IdentityMap for that class name could not be foundjava.lang.ClassNotFoundException
public java.util.List getObjectsInIdentityMapSubCacheAsMap(java.lang.String className) throws java.lang.ClassNotFoundException
className
- the fully qualified name of the class to get number of instances of.thrown
- then the IdentityMap for that class name could not be foundjava.lang.ClassNotFoundException
public java.lang.Integer getNumberOfObjectsInIdentityMapSubCache(java.lang.String className) throws java.lang.ClassNotFoundException
className
- the fully qualified name of the class to get number of instances of.thrown
- then the IdentityMap for that class name could not be foundjava.lang.ClassNotFoundException
public int getLogLevel(java.lang.String category)
Return the log level
category
- the string representation of an EclipseLink category, e.g. "sql", "transaction" ...
public void setLogLevel(int level)
Set the log level
level
- the new log level
public boolean shouldLog(int Level, java.lang.String category)
Check if a message of the given level would actually be logged.
level
- the log request levelcategory
- the string representation of an EclipseLink category
public int getProfileWeight()
public void setProfileWeight(int weight)
public void initializeIdentityMap(java.lang.String className) throws java.lang.ClassNotFoundException
className
- the fully qualified classnames identifying the identity map to initializejava.lang.ClassNotFoundException
public void printIdentityMapLocks()
public void printIdentityMapLocks(java.lang.String registeredClassName)
public void printProfileSummary()
public void printProfileSummaryByClass()
public void printProfileSummaryByQuery()
public java.lang.String getProfilingType()
public void setProfilingType(java.lang.String profileType)
public void setUseEclipseLinkProfiling()
public void setUseNoProfiling()
public java.lang.Boolean getUsesEclipseLinkProfiling()
public java.lang.String getDeployedEclipseLinkLogLevel()
public java.lang.String getCurrentEclipseLinkLogLevel()
public void setCurrentEclipseLinkLogLevel(java.lang.String newLevel)
String
- newLevel: new log levelprotected void updateDeploymentTimeData()
public int getDeployedSessionProfileWeight()
public SessionLog getDeployedSessionLog()
public java.lang.String getObjectName()
public boolean isJPASession()
public java.lang.String getSessionType()
public java.lang.Object[][] getClassSummaryDetailsUsingFilter(java.lang.String filter)
public java.lang.Object[][] getClassSummaryDetails()
public java.util.Vector getMappedClassNamesUsingFilter(java.lang.String filter)
filter
- A comma separated list of strings to match against.protected java.lang.String getCacheTypeFor(java.lang.Class identityMapClass)
public java.lang.String getModuleName()
public java.lang.String getApplicationName()
public java.lang.Boolean getShouldBindAllParameters()
public java.lang.Integer getStringBindingSize()
public java.lang.Boolean getUsesBatchWriting()
public java.lang.Long getTimeConnectionEstablished()
public java.lang.Boolean getUsesJDBCBatchWriting()
public java.lang.Boolean getUsesByteArrayBinding()
public java.lang.Boolean getUsesNativeSQL()
public java.lang.Boolean getUsesStreamsForBinding()
public java.lang.Boolean getUsesStringBinding()
public boolean getShouldCacheAllStatements()
public void clearStatementCache()
public void printAvailableConnectionPools()
public java.lang.Integer getMaxSizeForPool(java.lang.String poolName)
poolName
- the name of the pool to get the max size forpublic java.lang.Integer getMinSizeForPool(java.lang.String poolName)
poolName
- the name of the pool to get the min size forpublic void printClassesInSession()
public void printObjectsInIdentityMap(java.lang.String className) throws java.lang.ClassNotFoundException
className
- the fully qualified classname identifying the identity mapthrown
- then the IdentityMap for that class name could not be foundjava.lang.ClassNotFoundException
public void printAllIdentityMapTypes()
public void printObjectsInIdentityMaps()
public java.lang.Integer getNumberOfObjectsInAllIdentityMaps()
public java.lang.Integer getNumberOfPersistentClasses()
public java.lang.String getLogType()
public java.lang.String getDatabasePlatform()
public java.lang.String getJdbcConnectionDetails()
public java.lang.String getConnectionPoolType()
public java.lang.String getDriver()
public java.lang.String getLogFilename()
public void initializeAllIdentityMaps()
public void initializeIdentityMaps(java.lang.String[] classNames) throws java.lang.ClassNotFoundException
classNames
- String[] of fully qualified classnames identifying the identity maps to initializejava.lang.ClassNotFoundException
public void invalidateAllIdentityMaps()
public void invalidateIdentityMaps(java.lang.String[] classNamesParam, java.lang.Boolean recurse) throws java.lang.ClassNotFoundException
classNames
- String[] of fully qualified classnames identifying the identity maps to invalidaterecurse
- Boolean indicating if we want to invalidate the children identity maps toojava.lang.ClassNotFoundException
public void invalidateIdentityMap(java.lang.String className) throws java.lang.ClassNotFoundException
className
- the fully qualified classname identifying the identity map to invalidatejava.lang.ClassNotFoundException
public void invalidateIdentityMap(java.lang.String className, java.lang.Boolean recurse) throws java.lang.ClassNotFoundException
className
- the fully qualified classname identifying the identity map to invalidaterecurse
- Boolean indicating if we want to invalidate the children identity maps toojava.lang.ClassNotFoundException
protected void setSession(org.eclipse.persistence.internal.sessions.AbstractSession newSession)
Session
- session The session to be used with these RuntimeServicespublic java.util.List<ClassSummaryDetailBase> getClassSummaryDetailsUsingFilterArray(java.lang.String filter)
filter
- A comma separated list of strings to match against.public java.util.List<ClassSummaryDetailBase> getClassSummaryDetailsArray()