Top Description Fields Constructors Methods
org.eclipse.persistence.services

public abstract Class RuntimeServices

extends Object
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.services.glassfish.GlassfishRuntimeServices, org.eclipse.persistence.services.jboss.JBossRuntimeServices, org.eclipse.persistence.services.mbean.MBeanRuntimeServices, org.eclipse.persistence.services.weblogic.WebLogicRuntimeServices, org.eclipse.persistence.services.websphere.WebSphereRuntimeServices, org.eclipse.persistence.services.wildfly.WildFlyRuntimeServices
Imports
java.util.ArrayList, .Collections, .Enumeration, .HashMap, .Iterator, .List, .Map, .StringTokenizer, .Vector, java.util.regex.PatternSyntaxException, javax.management.openmbean.CompositeData, .CompositeDataSupport, .CompositeType, .OpenDataException, .OpenType, .SimpleType, .TabularData, .TabularDataSupport, .TabularType, org.eclipse.persistence.descriptors.ClassDescriptor, org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor, .DatabasePlatform, .DatasourcePlatform, org.eclipse.persistence.internal.helper.ClassConstants, .Helper, org.eclipse.persistence.internal.identitymaps.CacheIdentityMap, .CacheKey, .FullIdentityMap, .HardCacheWeakIdentityMap, .IdentityMap, .NoIdentityMap, .SoftCacheWeakIdentityMap, .SoftIdentityMap, .WeakIdentityMap, org.eclipse.persistence.internal.sessions.AbstractSession, .DatabaseSessionImpl, org.eclipse.persistence.logging.AbstractSessionLog, .DefaultSessionLog, .JavaLog, .SessionLog, org.eclipse.persistence.platform.server.JMXEnabledPlatform, org.eclipse.persistence.sessions.DatabaseLogin, .DefaultConnector, .Session, org.eclipse.persistence.sessions.server.ConnectionPool, .ServerSession, org.eclipse.persistence.tools.profiler.PerformanceProfiler

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.

Field Summary

Modifier and TypeField and Description
private SessionLog
deployedSessionLog

This contains the session log from server startup time.

private int
deployedSessionProfileWeight

This is the profile weight at server startup time.

public String
protected static 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 Summary

AccessConstructor and Description
protected
RuntimeServices()

Default Constructor

protected
RuntimeServices(Session
the session to be used with these RuntimeServices
session
)

Constructor

Method Summary

Modifier and TypeMethod and Description
public void
addNewConnectionPool(String
the name of the new pool
poolName
,
int
the maximum number of connections in the pool
maxSize
,
int
the minimum number of connections in the pool
minSize
,
String
the fully qualified name of the EclipseLink platform to use with this pool.
platform
,
String
the fully qualified name of the JDBC driver class
driverClassName
,
String
the URL of the database to connect to
url
,
String
the user name to connect to the database with
userName
,
String
the password to connect to the database with
password
)

This method provides client with access to add a new connection pool to a EclipseLink ServerSession.

private TabularData
buildClassSummaryDetails()

INTERNAL: Provide an instance of TabularData containing information about all classes in the session.

private TabularData

Returns:

A TabularData of information for the class names that match the filter.
buildClassSummaryDetailsUsingFilter
(String
A comma separated list of strings to match against.
filter
)

INTERNAL: Provide an instance of TabularData containing information about the classes in the session whose class names match the provided filter.

private CompositeType

Returns:

javax.management.openmbean.CompositeType
buildCompositeTypeForClassSummaryDetails
()

INTERNAL: Answer the CompositeType describing the CompositeData that we return for each IdentityMap (or subclass).

private CompositeData

Returns:

javax.management.openmbean.CompositeData
buildDetailsFor
(String
fullyQualified class name of the class
mappedClassName
,
CompositeType
describes the format of the returned CompositeData
detailsType
)

INTERNAL: Answer the CompositeData containing the cache details for the given mappedClassName This uses a CompositeDataSupport, which implements CompositeData

private Map<String, String>

Returns:

HashMap
buildLowlevelDetailsFor
(String
fullyQualified class name of the class
mappedClassName
)

INTERNAL: Helper to build a HashMap to help in the construction of a CompositeData

private TabularType

Returns:

javax.management.openmbean.TabularType
buildTabularTypeForClassSummaryDetails
()

INTERNAL: Answer the TabularType describing the TabularData that we return from getCacheSummaryDetails() and getCacheSummaryDetails(String filter) This is mostly for the client side to see what kind of information is returned.

public synchronized void
clearStatementCache()

Used to clear the statement cache.

public String
getApplicationName()

getApplicationName(): Answer the name of the module (EAR name) that this session is associated with.

public List<E>

Returns:

java.util.List the available pools.
getAvailableConnectionPools
()

This method will return the available Connection pools within this Server Session

protected String
getCacheTypeFor(Class<?> identityMapClass)

INTERNAL: getCacheTypeFor: Give a more UI-friendly version of the cache type

public List<E>

Returns:

java.util.List contains all of the classes which have identity maps in the current session.
getClassesInSession
()

This method is used to return those Class Names that have identity Maps in the Session.

public Object[][]
getClassSummaryDetails()

PUBLIC: Provide an instance of 2 Dimensional Array simulating tabular format information about all classes in the session.

public List<ClassSummaryDetailBase>

Returns:

A List of instance of ClassSummaryDetail objects containing class information for the class names that match the filter.
getClassSummaryDetailsArray
()

Provide a list of instance of ClassSummaryDetail containing information about all classes in the session.

public Object[][]
getClassSummaryDetailsUsingFilter(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.

public List<ClassSummaryDetailBase>

Returns:

A ArrayList of instance of ClassSummaryDetail containing class information for the class names that match the filter.
getClassSummaryDetailsUsingFilterArray
(String
A comma separated list of strings to match against.
filter
)

Provide a list of instance of ClassSummaryDetail containing information about the classes in the session whose class names match the provided filter.

public synchronized String
getConnectionPoolType()

Return connection pool type.

public String
getCurrentEclipseLinkLogLevel()

PUBLIC: Answer the EclipseLink log level that is changeable.

public String

Returns:

String databasePlatform
getDatabasePlatform
()

Return the database platform used by the DatabaseSession.

public String
getDeployedEclipseLinkLogLevel()

PUBLIC: Answer the EclipseLink log level at deployment time.

public SessionLog
public int
public synchronized String
getDriver()

Return db driver class name.

public synchronized String
getJdbcConnectionDetails()

Return JDBCConnection detail information.

public String

Returns:

String logFilename
getLogFilename
()

Return the log filename.

public int

Returns:

the log level
getLogLevel
(String
the string representation of an EclipseLink category, e.g. "sql", "transaction" ...
category
)

Return the log level

private int

Returns:

int for OFF, SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST, ALL
getLogLevelForName
(String levelName)

INTERNAL: Answer the log level for the given name.

public String

Returns:

the log type
getLogType
()

Return the log type, either "EclipseLink", "Java" or the simple name of the logging class used.

private Vector<String>

Returns:

java.util.Vector
getMappedClassNames
()

INTERNAL: Answer the fully qualified names of the classes mapped in the session.

public Vector<String>

Returns:

A Vector of class names that match the filter.
getMappedClassNamesUsingFilter
(String
A comma separated list of strings to match against.
filter
)

INTERNAL: This method traverses the EclipseLink descriptors and returns a Vector of the descriptor's reference class names that match the provided filter.

public Integer

Returns:

Integer for the max size of the pool. Return -1 if pool doesn't exist.
getMaxSizeForPool
(String
the name of the pool to get the max size for
poolName
)

This method will retrieve the max size of a particular connection pool

public Integer

Returns:

Integer for the min size of the pool. Return -1 if pool doesn't exist.
getMinSizeForPool
(String
the name of the pool to get the min size for
poolName
)

This method will retrieve the min size of a particular connection pool

public String
getModuleName()

getModuleName(): Answer the name of the context-root of the application that this session is associated with.

private String

Returns:

String (one of OFF, SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST, ALL)
getNameForLogLevel
(int logLevel)

INTERNAL: Answer the name for the log level given.

public Integer
getNumberOfObjectsInAllIdentityMaps()

This method will SUM and return the number of objects in all Identity Maps in the session.

public Integer
getNumberOfObjectsInIdentityMap(String
the fully qualified name of the class to get number of instances of.
className
)

This method is used to return the number of objects in a particular Identity Map

public Integer
getNumberOfObjectsInIdentityMapSubCache(String
the fully qualified name of the class to get number of instances of.
className
)

This method is used to return the number of objects in a particular Identity Map's subcache.

public Integer
getNumberOfPersistentClasses()

This method will answer the number of persistent classes contained in the session.

public String
public List<E>
getObjectsInIdentityMap(String
the fully qualified classname of the class to the instances of
className
)

This method will return a collection of the objects in the Identity Map.

public List<E>
getObjectsInIdentityMapSubCacheAsMap(String
the fully qualified name of the class to get number of instances of.
className
)

This method is used to return a Map of the objects in a particular Identity Map's subcache.

public int
getProfileWeight()

Return the DMS sensor weight

public synchronized String
getProfilingType()

This method is used to get the type of profiling.

public int
getSequencePreallocationSize()

Method returns the value of the Sequence Preallocation size

protected AbstractSession
getSession()

INTERNAL:

public String
getSessionName()

Answer the name of the EclipseLink session this MBean represents.

public String
getSessionType()

Answer the type of the EclipseLink session this MBean represents.

public Boolean
getShouldBindAllParameters()

Method returns if all Parameters should be bound or not

public boolean
getShouldCacheAllStatements()

Returns if statements should be cached or not

public boolean
getShouldLogMessages()

This method is used to determine if logging is turned on

public boolean
getShouldLogPerformanceProfiler()

Method indicates if Performance profile should be logged

public boolean
getShouldProfilePerformance()

This method will return if profiling is turned on or not

public List<E>

Returns:

java.util.List a list containing two values. The first value is the Maximun size of the pool. The second value is the Minimum size of the pool.
getSizeForPool
(String
the name of the pool to get the size for
poolName
)

This method will retrieve the size of a particular connection pool

public int
getStatementCacheSize()

Returns the statement cache size.

public 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).

public Long
getTimeConnectionEstablished()

This method will return a long indicating the exact time in Milliseconds that the session connected to the database.

public Boolean
getUsesBatchWriting()

This method will return if batchWriting is in use or not.

public Boolean
getUsesByteArrayBinding()

Shows if Byte Array Binding is turned on or not

public Boolean
getUsesEclipseLinkProfiling()

This method answers true if EclipseLink Performance Profiling is on.

public Boolean
getUsesJDBCBatchWriting()

This method will return if batchWriting is in use or not.

public Boolean
getUsesNativeSQL()

Shows if native SQL is being used

public Boolean
getUsesStreamsForBinding()

This method indicates if streams are being used for binding

public Boolean
getUsesStringBinding()

This method indicates if Strings are being bound

public synchronized void
initializeAllIdentityMaps()

This method is used to initialize the identity maps in the session.

public synchronized void
initializeIdentityMap(String
the fully qualified classnames identifying the identity map to initialize
className
)

This method is used to initialize the identity maps specified by className.

public synchronized void
initializeIdentityMaps(String[]
String[] of fully qualified classnames identifying the identity maps to initialize
classNames
)

This method is used to initialize the identity maps specified by the Vector of classNames.

public synchronized void
invalidateAllIdentityMaps()

This method is used to invalidate the identity maps in the session.

public synchronized void
invalidateIdentityMap(String
the fully qualified classname identifying the identity map to invalidate
className
)

This method is used to invalidate the identity maps specified by className.

public synchronized void
invalidateIdentityMap(String
the fully qualified classname identifying the identity map to invalidate
className
,
Boolean
Boolean indicating if we want to invalidate the children identity maps too
recurse
)

This method is used to invalidate the identity maps specified by className.

public synchronized void
invalidateIdentityMaps(String[]
String[] of fully qualified classnames identifying the identity maps to invalidate
classNamesParam
,
Boolean
Boolean indicating if we want to invalidate the children identity maps too
recurse
)

This method is used to invalidate the identity maps specified by the String[] of classNames.

public boolean
isJPASession()

Return whether this session is an EclipseLink JPA session.

public void
printAllIdentityMapTypes()

This method will log the types of Identity Maps in the session.

public void
printAvailableConnectionPools()

This method will print the available Connection pools to the SessionLog.

public void
printClassesInSession()

This method is used to output those Class Names that have identity Maps in the Session.

public void
printIdentityMapLocks()

This method will log the instance level locks in all Identity Maps in the session.

public void
printIdentityMapLocks(String registeredClassName)

This method will log the instance level locks in the Identity Map for the given class in the session.

public void
printObjectsInIdentityMap(String
the fully qualified classname identifying the identity map
className
)

This method will log the objects in the Identity Map.

public void
printObjectsInIdentityMaps()

This method will log all objects in all Identity Maps in the session.

public void
printProfileSummary()

This method assumes EclipseLink Profiling (as opposed to Java profiling).

public void
printProfileSummaryByClass()

This method assumes EclipseLink Profiling (as opposed to Java profiling).

public void
printProfileSummaryByQuery()

This method assumes EclipseLink Profiling (as opposed to Java profiling).

public void
resetAllConnections()

This method is used to reset connections from the session to the database.

public synchronized void
setCurrentEclipseLinkLogLevel(String
new log level
newLevel
)

PUBLIC: Set the EclipseLink log level to be used at runtime.

public void
setLogLevel(int
the new log level
level
)

Set the log level

public void
setProfileWeight(int weight)

This method is used to change DMS sensor weight.

public synchronized void
setProfilingType(String profileType)

This method is used to select the type of profiling.

public void
setSequencePreallocationSize(int size)

This method provide access for setting the sequence pre-allocation size

protected void
setSession(AbstractSession
The session to be used with these RuntimeServices
newSession
)

INTERNAL: Define the session that this instance is providing runtime services for

public void
setShouldCacheAllStatements(boolean shouldCacheAllStatements)

Method used to set if statements should be cached.

public void
setShouldLogPerformanceProfiler(boolean shouldLogPerformanceProfiler)

This method is used to turn on Profile logging when using the Performance Profiler

public void
setShouldProfilePerformance(boolean shouldProfile)

This method is used to turn on Performance Profiling

public void
setStatementCacheSize(int size)

Used to set the statement cache size.

public void
setUseEclipseLinkProfiling()

This method is used to turn on EclipseLink Performance Profiling

public void
setUseNoProfiling()

This method is used to turn off all Performance Profiling, DMS or EclipseLink.

public boolean

Returns:

true if the given message level will be logged
shouldLog
(int
the log request level
Level
,
String
the string representation of an EclipseLink category
category
)

Check if a message of the given level would actually be logged.

private Object[][]

Returns:

a two-dimensional array
tabularDataTo2DArray
(TabularData
the TabularData to be converted
tdata
,
String[]
the order of the columns
names
)

INTERNAL: Convert the TabularData to a two-dimensional array

private String
trimProfileString(String originalProfileString)

INTERNAL: utility method to get rid of leading and trailing {}'s

protected void
updateDeploymentTimeData()

INTERNAL: Define the deployment time data associated with logging and profiling

public void
updatePoolSize(String
the name of the pool to be updated.
poolName
,
int
the new maximum number of connections
maxSize
,
int
the new minimum number of connections
minSize
)

This method allows the client to set the pool size for a particular pool, based on the pool name

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait