org.eclipse.persistence.platform.server
Class JMXServerPlatformBase

java.lang.Object
  extended by org.eclipse.persistence.platform.server.ServerPlatformBase
      extended by org.eclipse.persistence.platform.server.JMXServerPlatformBase
All Implemented Interfaces:
ServerPlatform
Direct Known Subclasses:
JBossPlatform, SunAS9ServerPlatform, WebLogicPlatform, WebSpherePlatform

public abstract class JMXServerPlatformBase
extends ServerPlatformBase

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:
ServerPlatformBase

Field Summary
static 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
static String JMX_REGISTRATION_PREFIX
          This is the prefix for all MBeans that are registered with their specific session name appended
 
Fields inherited from class org.eclipse.persistence.platform.server.ServerPlatformBase
DEFAULT_SERVER_NAME_AND_VERSION, JMX_REGISTER_DEV_MBEAN_PROPERTY, JMX_REGISTER_RUN_MBEAN_PROPERTY
 
Constructor Summary
JMXServerPlatformBase(DatabaseSession newDatabaseSession)
          INTERNAL: Default Constructor: Initialize so that runtime services and JTA are enabled.
 
Method Summary
 String getApplicationName()
          INTERNAL: getApplicationName(): Answer the name of the module (EAR name) that this session is associated with.
 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
 String getModuleName()
          INTERNAL: getModuleName(): Answer the name of the context-root of the application that this session is associated with.
 void serverSpecificRegisterMBean()
          INTERNAL: serverSpecificRegisterMBean(): Server specific implementation of the creation and deployment of the JMX MBean to provide runtime services for my databaseSession.
 void serverSpecificUnregisterMBean()
          INTERNAL: serverSpecificUnregisterMBean(): Server specific implementation of the de-registration of the JMX MBean from its server during session logout.
 void setApplicationName(String aName)
          INTERNAL:
 
Methods inherited from class org.eclipse.persistence.platform.server.ServerPlatformBase
clearStatementCache, configureProfiler, disableJTA, disableRuntimeServices, enableRuntimeServices, getDatabaseSession, getExternalTransactionControllerClass, getNewTempClassLoader, getServerLog, getServerNameAndVersion, initializeExternalTransactionController, isCMP, isJTAEnabled, isRuntimeServicesEnabled, isRuntimeServicesEnabledDefault, launchContainerRunnable, registerMBean, setExternalTransactionControllerClass, setIsCMP, shouldUseDriverManager, unregisterMBean, unwrapConnection, wasFailureCommunicationBased
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JMX_REGISTRATION_PREFIX

public static final String JMX_REGISTRATION_PREFIX
This is the prefix for all MBeans that are registered with their specific session name appended

See Also:
Constant Field Values

JMX_MBEANSERVER_INDEX_DEFAULT_FOR_MULTIPLE_SERVERS

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

See Also:
Constant Field Values
Constructor Detail

JMXServerPlatformBase

public JMXServerPlatformBase(DatabaseSession newDatabaseSession)
INTERNAL: Default Constructor: Initialize so that runtime services and JTA are enabled.

Method Detail

getMBeanServer

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:
the JMX specification MBeanServer

serverSpecificRegisterMBean

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

Overrides:
serverSpecificRegisterMBean in class ServerPlatformBase
See Also:
ServerPlatformBase.isRuntimeServicesEnabled(), ServerPlatformBase.disableRuntimeServices(), ServerPlatformBase.registerMBean()

serverSpecificUnregisterMBean

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

Overrides:
serverSpecificUnregisterMBean in class ServerPlatformBase
See Also:
ServerPlatformBase.isRuntimeServicesEnabled(), ServerPlatformBase.disableRuntimeServices()

getModuleName

public String 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"

Specified by:
getModuleName in interface ServerPlatform
Overrides:
getModuleName in class ServerPlatformBase
Returns:
String moduleName

getApplicationName

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 applicationName
See Also:
JMXEnabledPlatform

setApplicationName

public void setApplicationName(String aName)
INTERNAL:

Parameters:
aName -