Top Description Fields Constructors Methods
org.eclipse.persistence.platform.server

public abstract Class JMXServerPlatformBase

extends ServerPlatformBase
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.platform.server.glassfish.GlassfishPlatform, org.eclipse.persistence.platform.server.was.WebSpherePlatform, org.eclipse.persistence.platform.server.wls.WebLogicPlatform, org.eclipse.persistence.platform.server.jboss.JBossPlatform, org.eclipse.persistence.platform.server.wildfly.WildFlyPlatform
Imports
java.lang.management.ManagementFactory, java.lang.reflect.Method, java.security.AccessController, .PrivilegedActionException, .PrivilegedExceptionAction, java.util.List, javax.management.InstanceAlreadyExistsException, .InstanceNotFoundException, .MBeanRegistrationException, .MBeanServer, .MBeanServerFactory, .MalformedObjectNameException, .ObjectInstance, .ObjectName, javax.naming.Context, .InitialContext, .NamingException, org.eclipse.persistence.internal.security.PrivilegedAccessHelper, .PrivilegedMethodInvoker, org.eclipse.persistence.internal.sessions.AbstractSession, org.eclipse.persistence.logging.SessionLog, org.eclipse.persistence.services.mbean.MBeanDevelopmentServices, .MBeanRuntimeServicesMBean, org.eclipse.persistence.sessions.DatabaseSession

PUBLIC: Subclass of org.eclipse.persistence.platform.server.ServerPlatformBase in support of the JMXEnabledPlatform interface

This is the abstract superclass of all platforms for all servers that contain a subclass that implements the JMXEnabledPlatform interface. Each DatabaseSession contains an instance of the receiver, to help the DatabaseSession determine:

Subclasses already exist to provide configurations for Oc4J, WebLogic, JBoss, NetWeaver, GlassFish and WebSphere.

If the versioned platform subclass is JMX enabled by EclipseLink (registers MBeans) then that server platform must implement the JMXEnabledPlatform interface To provide some different behavior than the provided ServerPlatform(s), we recommend subclassing org.eclipse.persistence.platform.server.JMXServerPlatformBase (or a subclass), and overriding:

for the desired behavior.
Since
EclipseLink 2.1.1
See Also
org.eclipse.persistence.platform.server.ServerPlatformBase

Field Summary

Modifier and TypeField and Description
protected static String
protected static String
protected static String
APP_SERVER_CLASSLOADER_MODULE_EJB_SEARCH_STRING_PREFIX

Override by subclass: Search String in application server session for ejb modules

protected static String
protected static String
APP_SERVER_CLASSLOADER_MODULE_WAR_SEARCH_STRING_PREFIX

Override by subclass: Search String in application server session for war modules

private static String
APP_SERVER_CLASSLOADER_OVERRIDE_DEFAULT

Override by subclass: Search String in application server ClassLoader for the application:persistence_unit name

private String
applicationName

applicationName determination is available during MBean registration only

private static final String
JMX_JNDI_RUNTIME_REGISTER

This JNDI address is for JMX MBean registration

private static final String
JMX_JNDI_RUNTIME_UNREGISTER

This JNDI address is for JMX MBean unregistration

public static final int
JMX_MBEANSERVER_INDEX_DEFAULT_FOR_MULTIPLE_SERVERS

The default indexed MBeanServer instance to use when multiple MBeanServer instances exist on the platform - usually only in JBoss

public static final String
JMX_REGISTRATION_PREFIX

This is the prefix for all MBeans that are registered with their specific session name appended

protected MBeanServer
mBeanServer

Cache the ServerPlatform MBeanServer for performance

private String
moduleName

moduleName determination is available during MBean registration only

protected static final String
OVERRIDE_JMX_APPLICATIONNAME_PROPERTY

This persistence.xml or sessions.xml property is used to override the applicationName

protected static final String
OVERRIDE_JMX_MODULENAME_PROPERTY

This persistence.xml or sessions.xml property is used to override the moduleName

private MBeanRuntimeServicesMBean
runtimeServicesMBean

cache the RuntimeServices MBean - during platform construction for JMXEnabledPlatform implementors

Inherited from org.eclipse.persistence.platform.server.ServerPlatformBase:
DEFAULT_SERVER_NAME_AND_VERSIONexternalTransactionControllerClassJMX_REGISTER_DEV_MBEAN_PROPERTYJMX_REGISTER_RUN_MBEAN_PROPERTYserverNameAndVersionshouldRegisterDevelopmentBeanshouldRegisterRuntimeBeanthreadPoolthreadPoolSize

Constructor Summary

AccessConstructor and Description
protected
JMXServerPlatformBase(DatabaseSession
The instance of DatabaseSession that I am helping.
newDatabaseSession
)

INTERNAL: Default Constructor: Initialize so that runtime services and JTA are enabled.

Method Summary

Modifier and TypeMethod and Description
protected AbstractSession
getAbstractSession()

Return the AbstractSession required to log to the non-platform EclipseLink log.

protected String
getApplicationName(boolean enableDefault)

INTERNAL: Lazy initialize the application name by first checking for a persistence.xml property override and then deferring to a default name in the absence of a platform override of this function

public String

Returns:

String applicationName
getApplicationName
()

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

public MBeanServer

Returns:

the JMX specification MBeanServer
getMBeanServer
()

INTERNAL: Return the MBeanServer to be used for MBean registration and deregistration.

protected String
getMBeanSessionName()

Remove JMX reserved characters from the session name

protected String
getModuleName(boolean enableDefault)

INTERNAL:

public String

Returns:

String moduleName
getModuleName
()

Overrides org.eclipse.persistence.platform.server.ServerPlatformBase.getModuleName.

Implements org.eclipse.persistence.platform.server.ServerPlatform.getModuleName.

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

INTERNAL: Return the cached server specific services MBean

protected void
initializeApplicationNameAndModuleName()

INTERNAL: Get the applicationName and moduleName from the application server.

public void
serverSpecificRegisterMBean()

Overrides org.eclipse.persistence.platform.server.ServerPlatformBase.serverSpecificRegisterMBean.

INTERNAL: serverSpecificRegisterMBean(): Server specific implementation of the creation and deployment of the JMX MBean to provide runtime services for my databaseSession.
public void
serverSpecificUnregisterMBean()

Overrides org.eclipse.persistence.platform.server.ServerPlatformBase.serverSpecificUnregisterMBean.

INTERNAL: serverSpecificUnregisterMBean(): Server specific implementation of the de-registration of the JMX MBean from its server during session logout.
public void
setApplicationName(String aName)

INTERNAL:

protected void
setModuleName(String aName)

INTERNAL;

protected void
setRuntimeServicesMBean(MBeanRuntimeServicesMBean runtimeServicesMBean)

INTERNAL: Set the cached server specific services MBean

Inherited from org.eclipse.persistence.platform.server.ServerPlatformBase:
clearStatementCacheconfigureProfilerdisableJTAdisableRuntimeServicesenableRuntimeServicesensureNotLoggedInexternalTransactionControllerNotNullWarninggetDatabaseSessiongetExternalTransactionControllerClassgetJNDIConnectorLookupTypegetNewTempClassLoadergetPartitionIDgetServerLoggetServerNameAndVersiongetThreadPoolgetThreadPoolSizeinitializeExternalTransactionControllerinitializeServerNameAndVersionisCMPisJTA11isJTAEnabledisRuntimeServicesEnabledisRuntimeServicesEnabledDefaultlaunchContainerRunnableregisterMBeansetExternalTransactionControllerClasssetIsCMPsetThreadPoolsetThreadPoolSizeshouldUseDriverManagershutdownunregisterMBeanunwrapConnectionusesPartitionswasFailureCommunicationBased

Field Detail

APP_SERVER_CLASSLOADER_APPLICATION_PU_SEARCH_STRING_POSTFIXback to summary
protected static String APP_SERVER_CLASSLOADER_APPLICATION_PU_SEARCH_STRING_POSTFIX
APP_SERVER_CLASSLOADER_APPLICATION_PU_SEARCH_STRING_PREFIXback to summary
protected static String APP_SERVER_CLASSLOADER_APPLICATION_PU_SEARCH_STRING_PREFIX
APP_SERVER_CLASSLOADER_MODULE_EJB_SEARCH_STRING_PREFIXback to summary
protected static String APP_SERVER_CLASSLOADER_MODULE_EJB_SEARCH_STRING_PREFIX

Override by subclass: Search String in application server session for ejb modules

APP_SERVER_CLASSLOADER_MODULE_EJB_WAR_SEARCH_STRING_POSTFIXback to summary
protected static String APP_SERVER_CLASSLOADER_MODULE_EJB_WAR_SEARCH_STRING_POSTFIX
APP_SERVER_CLASSLOADER_MODULE_WAR_SEARCH_STRING_PREFIXback to summary
protected static String APP_SERVER_CLASSLOADER_MODULE_WAR_SEARCH_STRING_PREFIX

Override by subclass: Search String in application server session for war modules

APP_SERVER_CLASSLOADER_OVERRIDE_DEFAULTback to summary
private static String APP_SERVER_CLASSLOADER_OVERRIDE_DEFAULT

Override by subclass: Search String in application server ClassLoader for the application:persistence_unit name

applicationNameback to summary
private String applicationName

applicationName determination is available during MBean registration only

JMX_JNDI_RUNTIME_REGISTERback to summary
private static final String JMX_JNDI_RUNTIME_REGISTER

This JNDI address is for JMX MBean registration

JMX_JNDI_RUNTIME_UNREGISTERback to summary
private static final String JMX_JNDI_RUNTIME_UNREGISTER

This JNDI address is for JMX MBean unregistration

JMX_MBEANSERVER_INDEX_DEFAULT_FOR_MULTIPLE_SERVERSback to summary
public static final int JMX_MBEANSERVER_INDEX_DEFAULT_FOR_MULTIPLE_SERVERS

The default indexed MBeanServer instance to use when multiple MBeanServer instances exist on the platform - usually only in JBoss

JMX_REGISTRATION_PREFIXback to summary
public static final String JMX_REGISTRATION_PREFIX

This is the prefix for all MBeans that are registered with their specific session name appended

mBeanServerback to summary
protected MBeanServer mBeanServer

Cache the ServerPlatform MBeanServer for performance

moduleNameback to summary
private String moduleName

moduleName determination is available during MBean registration only

OVERRIDE_JMX_APPLICATIONNAME_PROPERTYback to summary
protected static final String OVERRIDE_JMX_APPLICATIONNAME_PROPERTY

This persistence.xml or sessions.xml property is used to override the applicationName

OVERRIDE_JMX_MODULENAME_PROPERTYback to summary
protected static final String OVERRIDE_JMX_MODULENAME_PROPERTY

This persistence.xml or sessions.xml property is used to override the moduleName

runtimeServicesMBeanback to summary
private MBeanRuntimeServicesMBean runtimeServicesMBean

cache the RuntimeServices MBean - during platform construction for JMXEnabledPlatform implementors

Constructor Detail

JMXServerPlatformBaseback to summary
protected JMXServerPlatformBase(DatabaseSession newDatabaseSession)

INTERNAL: Default Constructor: Initialize so that runtime services and JTA are enabled.

Parameters
newDatabaseSession:DatabaseSession

The instance of DatabaseSession that I am helping.

Method Detail

getAbstractSessionback to summary
protected AbstractSession getAbstractSession()

Return the AbstractSession required to log to the non-platform EclipseLink log.

Note

The WeblogicEclipseLinkLog defined for the WebLogic platform currently only supports the following logging categories in the categoryMap HashMap {connection=DebugJpaJdbcJdbc, cache=DebugJpaDataCache, transaction=DebugJpaJdbcJdbc, weaver=DebugJpaEnhance, query=DebugJpaQuery, dms=DebugJpaProfile, sequencing=DebugJpaRuntime, properties=DebugJpaRuntime, ejb=DebugJpaRuntime, jpa_metamodel=DebugJpaMetaData, sql=DebugJpaJdbcSql, ejb_or_metadata=DebugJpaMetaData, event=DebugJpaRuntime, server=DebugJpaRuntime, propagation=DebugJpaDataCache}

getApplicationNameback to summary
protected String getApplicationName(boolean enableDefault)

INTERNAL: Lazy initialize the application name by first checking for a persistence.xml property override and then deferring to a default name in the absence of a platform override of this function

getApplicationNameback to summary
public String getApplicationName()

INTERNAL: getApplicationName(): Answer the name of the module (EAR name) that this session is associated with. Answer "unknown" if there is no application name available. Default behavior is to return "unknown" There are 4 levels of implementation. 1) use the property override weblogic.applicationName, or 2) perform a reflective weblogic.work.executeThreadRuntime.getApplicationName() call, or 3) extract the moduleName:persistence_unit from the application classloader string representation, or 3) defer to this superclass - usually return "unknown"

Returns:String

String applicationName

See Also
JMXEnabledPlatform
getMBeanServerback to summary
public MBeanServer getMBeanServer()

INTERNAL: Return the MBeanServer to be used for MBean registration and deregistration.
This MBeanServer reference is lazy loaded and cached on the platform.
There are multiple ways of getting the MBeanServer

1) MBeanServerFactory static function - working for 3 of 4 servers WebSphere, JBoss and Glassfish in a generic way
- JBoss returns 2 MBeanServers in the List - but one of them has a null domain - we don't use that one
- WebLogic may return 2 MBeanServers - in that case we want to register with the one containing the "com.bea" tree 2) ManagementFactory static function - what is the difference in using this one over the one returning a List of servers
3) JNDI lookup
4) Direct server specific native API

We are using method (1)
Returns:MBeanServer

the JMX specification MBeanServer

getMBeanSessionNameback to summary
protected String getMBeanSessionName()

Remove JMX reserved characters from the session name

getModuleNameback to summary
protected String getModuleName(boolean enableDefault)

INTERNAL:

getModuleNameback to summary
public String getModuleName()

Overrides org.eclipse.persistence.platform.server.ServerPlatformBase.getModuleName.

Implements org.eclipse.persistence.platform.server.ServerPlatform.getModuleName.

INTERNAL: getModuleName(): Answer the name of the context-root of the application that this session is associated with. Answer "unknown" if there is no module name available. Default behavior is to return "unknown" - we override this behavior here for JBoss. There are 4 levels of implementation. 1) use the property override jboss.moduleName, or 2) perform a reflective jboss.work.executeThreadRuntime.getModuleName() call, or 3) extract the moduleName:persistence_unit from the server specific classloader string representation, or 3) defer to superclass - usually return "unknown"

Returns:String

String moduleName

Annotations
@Override
getRuntimeServicesMBeanback to summary
protected MBeanRuntimeServicesMBean getRuntimeServicesMBean()

INTERNAL: Return the cached server specific services MBean

initializeApplicationNameAndModuleNameback to summary
protected void initializeApplicationNameAndModuleName()

INTERNAL: Get the applicationName and moduleName from the application server. This function does not use reflective API on the application server, instead it parses the database session name for the module name, and the classLoader (from the Platform.conversionManager) toString() for the application name.

serverSpecificRegisterMBeanback to summary
public void serverSpecificRegisterMBean()

Overrides org.eclipse.persistence.platform.server.ServerPlatformBase.serverSpecificRegisterMBean.

INTERNAL: serverSpecificRegisterMBean(): Server specific implementation of the creation and deployment of the JMX MBean to provide runtime services for my databaseSession. Default is to do nothing. This should be subclassed if required. For platform classes that override the JMXEnabledPlatform - the services MBean is created at platform construction for use during MBean registration here.

Annotations
@Override
See Also
isRuntimeServicesEnabled(), disableRuntimeServices(), registerMBean()
serverSpecificUnregisterMBeanback to summary
public void serverSpecificUnregisterMBean()

Overrides org.eclipse.persistence.platform.server.ServerPlatformBase.serverSpecificUnregisterMBean.

INTERNAL: serverSpecificUnregisterMBean(): Server specific implementation of the de-registration of the JMX MBean from its server during session logout.

Annotations
@Override
See Also
isRuntimeServicesEnabled(), disableRuntimeServices()
setApplicationNameback to summary
public void setApplicationName(String aName)

INTERNAL:

setModuleNameback to summary
protected void setModuleName(String aName)

INTERNAL;

setRuntimeServicesMBeanback to summary
protected void setRuntimeServicesMBean(MBeanRuntimeServicesMBean runtimeServicesMBean)

INTERNAL: Set the cached server specific services MBean