Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "EclipseLink/DesignDocs/235168"

m (Design Specification: JMX MBean Support)
m (Design Specification: JMX MBean Support)
Line 42: Line 42:
  
 
== Design / Functionality ==
 
== Design / Functionality ==
 +
===Design Issue 1: Obsolete/deprecated code===
 +
 +
Some functions in the original generic MBean code use code that is no longer in Eclipse or was refactored - listed below
 +
*public void setChangeSetPropagationShouldBeAsynchronous(boolean isAsynchronous)
 +
*public boolean getChangeSetPropagationShouldBeAsynchronous()
 +
*public void setShouldRemoveConnectionOnError(boolean shouldRemoveConnection)
 +
*public boolean getShouldRemoveConnectionOnError()
 +
*public void updateSynchronizationDiscoveryMulticastGroup(String multicastIP, int multicastPort)
 +
*public void initializeCacheSynchronizationServices() throws SynchronizationException
 +
 
===Included MBean Functions/Attributes===
 
===Included MBean Functions/Attributes===
 
The following functions are supported in EclipseLink 1.0
 
The following functions are supported in EclipseLink 1.0
Line 143: Line 153:
 
</weblogic-application>
 
</weblogic-application>
 
</source>
 
</source>
 +
 +
===Design Issue 2: Session names in WebLogic 10.+
 +
We can not use the session name as-is as part of the MBean registration name because the characters ":" and "'" are reserved in JMX.
 +
The session name will be undergo character replacement of ":," into "_"
 +
<pre>
 +
EclipseLink_Domain:Name=Development_file_/C_/opt/wls103/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/_appsdir_weblogicEAR7_ear/jmidq0/weblogicEJB.jar-unifiedWebLogicEL7,Type=Configuration
 +
</pre>
 +
 +
===Design Issue 3: Initial state of MBean registration===
 +
We will default to "No registration" for the WebLogic platform.
  
 
== Testing ==
 
== Testing ==

Revision as of 10:05, 24 June 2008

Design Specification: JMX MBean Support

Bug# 235168 JMX MBean Tutorial for WebLogic

Document History

Date Author Version Description & Notes
2008-06-23 Michael O 0.1 Starting Draft

Project overview

This enhancement will add JMX MBean support to EclipseLink 1.0 by exposing select runtime and development attributes and methods to custom JMX client code or JConsole.

Concepts

Based on JMX 1.2 and JMX Remote API 1.0

References

ELUG Documentation JMX MBeans in WebLogic 10

Requirements

  • R1: Enable JMX MBean Support for WebLogic
  • R2: Enable JMX MBean support for generic J2EE servers
  • R3: MBeans have a 1:1 relationship with their session (multiple EARs=multiple beans)
  • R4: Clients can disable post login MBean registration (via SessionCustomizer)
  • R5: Clients can manage their own registration of EclipseLink MBeans (via ApplicationLifecycleListener)

Design Constraints

  • C1: MBeans are not available until the first login of a server application (lazy-loaded)
  • C2: Functions marked OBSOLETE will not be implemented if there is no suitable replacement

Use Cases

  • UC1: EclipseLink managed MBean registration
  • UC2: Application managed MBean registration
  • UC3: No MBean registration

Design / Functionality

Design Issue 1: Obsolete/deprecated code

Some functions in the original generic MBean code use code that is no longer in Eclipse or was refactored - listed below

  • public void setChangeSetPropagationShouldBeAsynchronous(boolean isAsynchronous)
  • public boolean getChangeSetPropagationShouldBeAsynchronous()
  • public void setShouldRemoveConnectionOnError(boolean shouldRemoveConnection)
  • public boolean getShouldRemoveConnectionOnError()
  • public void updateSynchronizationDiscoveryMulticastGroup(String multicastIP, int multicastPort)
  • public void initializeCacheSynchronizationServices() throws SynchronizationException

Included MBean Functions/Attributes

The following functions are supported in EclipseLink 1.0

Runtime Services MBean

  • 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 boolean getShouldCacheAllStatements()
  • public void setStatementCacheSize(int size)
  • public int getStatementCacheSize()
  • public void updatePoolSize(String poolName, int maxSize, int minSize)
  • public List getAvailableConnectionPools()
  • public List getSizeForPool(String poolName)
  • public void addNewConnectionPool(String poolName, int maxSize, int minSize, String platform, String driverClassName, String url, String userName, String password) throws ClassNotFoundException
  • public void resetAllConnections()
  • public List getClassesInSession()
  • public List getObjectsInIdentityMap(String className) throws ClassNotFoundException
  • public Integer getNumberOfObjectsInIdentityMap(String className) throws ClassNotFoundException
  • public List getObjectsInIdentityMapSubCacheAsMap(String className) throws ClassNotFoundException
  • public Integer getNumberOfObjectsInIdentityMapSubCache(String className) throws ClassNotFoundException
  • public int getLogLevel(String category)
  • public void setLogLevel(int level)
  • public boolean shouldLog(int Level, String category)
  • public void setProfileWeight(int weight)
  • public boolean getUsesBatchWriting()
  • public void setUsesJDBCBatchWriting(boolean usesJDBCBatchWriting)
  • public boolean getUsesJDBCBatchWriting()
  • public void setUsesByteArrayBinding(boolean usesByteArrayBinding)
  • public boolean getUsesByteArrayBinding()
  • public void setUsesNativeSQL(boolean usesNativeSQL)
  • public boolean getUsesNativeSQL()
  • public void setUsesStreamsForBinding(boolean usesStreamsForBinding)
  • public boolean getUsesStreamsForBinding()
  • public void setUsesStringBinding(boolean usesStringBinding)
  • public boolean getUsesStringBinding()

Development Services MBean

  • public void initializeIdentityMap(String className) throws ClassNotFoundException
  • public void initializeAllIdentityMaps()
  • public void setIdentityMapForClass(String className, String identityMapClassType, int maxSize) throws ClassNotFoundException
  • public void refreshProject(String projectFilePath)
  • public void updateCacheSize(String className, int newSize) throws ClassNotFoundException
  • public void setShouldBindAllParameters(boolean shouldBindAllParameters)
  • public boolean getShouldBindAllParameters()
  • public void setStringBindingSize(int size)
  • public int getStringBindingSize()
  • public void setUsesBatchWriting(boolean usesBatchWriting)


Obsolete MBean Functions/Attributes

The following functions are obsolete or deprecated and will not be included.

Runtime Services MBean

  • public void setSequencePreallocationSize(int size)
  • public int getSequencePreallocationSize()
  • public void setShouldLogMessages(boolean shouldLogMessages) // Replaced by setLogLevel(int level)
  • public void setShouldLogDebug(boolean shouldLogDebug) // Replaced by setLogLevel(int level)
  • public boolean getShouldLogDebug() // Replaced by getLogLevel(String category)
  • public void setShouldLogExceptions(boolean shouldLogExceptions) // Replaced by setLogLevel(int level)
  • public boolean getShouldLogExceptions() // replaced by getLogLevel(String category)
  • public void setShouldLogExceptionStackTrace(boolean shouldLogExceptionStackTrace)
  • public boolean getShouldLogExceptionStackTrace()
  • public void setShouldPrintDate(boolean shouldPrintDate)
  • public boolean getShouldPrintDate()
  • public void setShouldPrintSession(boolean shouldPrintSession)
  • public boolean getShouldPrintSession()
  • public void setShouldPrintThread(boolean shouldPrintThread)
  • public boolean getShouldPrintThread()
  • public void setShouldPrintConnection(boolean shouldPrintConnection)
  • public boolean getShouldPrintConnection()
  • public void addNewConnectionPool(String poolName, int maxSize, int minSize, String platform, String driverClassName, String url, String userName, String password, String licencePath) throws ClassNotFoundException
  • public List getObjectsInIdentityMapSubCache(String className) throws ClassNotFoundException // replaced by getObjectsInIdentityMapSubCacheAsMap(String className)

Development Services MBean

  • public void setChangeSetPropagationShouldBeAsynchronous(boolean isAsynchronous)
  • public boolean getChangeSetPropagationShouldBeAsynchronous()
  • public void setShouldRemoveConnectionOnError(boolean shouldRemoveConnection)
  • public boolean getShouldRemoveConnectionOnError()
  • public void updateSynchronizationDiscoveryMulticastGroup(String multicastIP, int multicastPort)
  • public void initializeCacheSynchronizationServices() throws SynchronizationException

EclipseLink Managed Lazy Registration

By default MBean registration is enabled for WebLogic. This registration occurs as a post step during the first login to the session.

Application Managed Lazy Registration

Disabling MBean Registration

If MBean registration is not required, or the application will be handling registration then you may disable automatic registration at the first login by setting up the following.

WebLogic ApplicationLifecycleListener Example

Here the application can manage registration/deregistration of the MBeans by using a SessionCustomizer in conjunction with a listener on either a servlet or session bean within the JEE application.

  • SessionCustomizer
  • Listener

You must configure the EclipseLink Mbeans in the EAR/meta-inf via a weblogic-application.xml descriptor entry.

<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"  "http://java.sun.com/dtd/application_1_3.dtd">
<weblogic-application xmlns="http://www.bea.com/ns/weblogic/10">
    <listener>
       <listener-class>org.eclipse.persistence.example.unified.integration.ApplicationLifecycleListenerImpl</listener-class>
    </listener>
</weblogic-application>

===Design Issue 2: Session names in WebLogic 10.+ We can not use the session name as-is as part of the MBean registration name because the characters ":" and "'" are reserved in JMX. The session name will be undergo character replacement of ":," into "_"

EclipseLink_Domain:Name=Development_file_/C_/opt/wls103/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/_appsdir_weblogicEAR7_ear/jmidq0/weblogicEJB.jar-unifiedWebLogicEL7,Type=Configuration

Design Issue 3: Initial state of MBean registration

We will default to "No registration" for the WebLogic platform.

Testing

A formal JMX J2SE client test suite is required.

Manual Testing Results

Action: Runtime | resetAllConnections

[EL Config]: 2008.06.24 09:34:32.072--ServerSession(31078592)--Connection(4360542)--Thread(Thread[RMI TCP Connection(2)-10.156.52.98,5,RMI Runtime])--Connected: jdbc:bea:oracle://127.0.0.1:1521;CATALOGOPTIONS=2;CONNECTIONRETRYDELAY=1;SUPPORTLINKS=false;MAXPOOLEDSTATEMENTS=0;KEYSTORE=;ENABLECANCELTIMEOUT=false;TRUSTSTOREPASSWORD=;VALIDATESERVERCERTIFICATE=true;CODEPAGEOVERRIDE=;REFCURSORSUPPORT=true;KEYSTOREPASSWORD=;CONNECTIONRETRYCOUNT=5;SENDFLOATPARAMETERSASSTRING=false;COMMITBEHAVIOR=serverDefault;TNSSERVERNAME=;BATCHPERFORMANCEWORKAROUND=false;INITIALIZATIONSTRING=;RESULTSETMETADATAOPTIONS=0;QUERYTIMEOUT=0;HOSTNAMEINCERTIFICATE=;WIREPROTOCOLMODE=1;CATALOGINCLUDESSYNONYMS=true;JAVADOUBLETOSTRING=false;LOADLIBRARYPATH=;IMPORTSTATEMENTPOOL=;ALTERNATESERVERS=;KEYPASSWORD=;ENCRYPTIONMETHOD=noEncryption;CONVERTNULL=1;TRUSTSTORE=;TNSNAMESFILE=;AUTHENTICATIONMETHOD=auto;SERVICENAME=;SERVERTYPE=;LOADBALANCING=false;SID=orcl;WORKAROUNDS=0;INSENSITIVERESULTSETBUFFERSIZE=2048;SYSLOGINROLE=;FETCHTSWTZASTIMESTAMP=false

Action: DevelopmentServices | initializeIdentityMap p1=org.eclipse.persistence.example.unified.business.StatLabel

[EL Finer]: 2008.06.24 08:58:13.722--ServerSession(32676101)--Thread(Thread[RMI TCP Connection(16)-10.156.52.98,5,RMI Runtime])--
initialize identitymaps
[EL Finer]: 2008.06.24 08:59:04.004--ServerSession(32676101)--Thread(Thread[RMI TCP Connection(18)-10.156.52.98,5,RMI Runtime])--
initialize identitymap: class org.eclipse.persistence.example.unified.business.StatLabel

Extended Manual Testing

We need access to a cluster and need to setup multiple connection pools.

API

GUI

<JAVA_HOME>/bin/JConsole client

You should see the following EclipseLink MBeans off the root of the JNDI tree. In this example there are 2 separate EARs deployed to WebLogic - each with its own set of MBeans based on the login session.

Eclipselink jmx mbeans in jconsole.jpg

Config files

Documentation

http://wiki.eclipse.org/Integrating_EclipseLink_with_an_Application_Server_(ELUG)#How_to_Integrate_JMX - move and rewrite for WebLogic http://wiki.eclipse.org/Configuring_a_Session_%28ELUG%29#Configuring_the_Server_Platform - WebLogic replaces OC4J in "Check this field to configure the EclipseLink runtime to enable the deployment of a JMX MBean that allows monitoring of the EclipseLink session. Currently, this is only supported for OC4J."

Open Issues

Issue # Owner Description / Notes

Decisions

Issue # Description / Notes Decision

Future Considerations

During the research for this project the following items were identified as out of scope but are captured here as potential future enhancements. If agreed upon during the review process these should be logged in the bug system.

  • OC4J, WebSphere, JBoss, Geronimo specific MBean support

Back to the top