Skip Headers
Oracle® Retail Integration Bus Operations Guide
Release 13.2
  Go To Table Of Contents
Contents

Previous
Previous
 
Next
Next
 

5 RIB and JMX

This section describes the RIB JMX infrastructure. JMX is a specification that provides capability for runtime management of java components. Each of the RIB's software components (PublisherEjb, SubscriberEjb, TafrEjb, HospitalRetryEjb, and so on) provides its own management facility by implementing management beans.

The RIB's MBean components use uniform registration, deployment, and communication mechanisms provided by the RIB JMX infrastructure.

RIB uses log4j to log business and system events in the RIB runtime system. The definitions of the loggers are statically defined and come from a configuration file (log4j.xml). As logging is an expensive process we need to provide capability to manage log levels dynamically. The RIB Administration UI Log Manager MBean registers itself through the standard RIB JMX registration process at application startup. It provides an API to access current RIB loggers and change the log levels.

The AlertPublisherFactory is a factory that allows the user to select what alerting mechanism they want. A new JMX alerting mechanism will be added to the system. The JmxAlertPublisher class extends NotificationBroadcasterSupport and provides JMX notification capability. The JMX alerting capability is only available when running inside a container. A message type attribute will be added to the Alert class to provide the message filtering capability.

Any third party JMX console compatible with the Java EE container can be used to manage RIB components. RDMT uses the JMX command line interface provided by this design.

RIB JMX Client

The RIB provides a command line interface to the RIB JMX system. The client is shipped as java classes in the jmx-cmd-line-ui.jar. The entry point is JmxClientMain and allows the user to either execute a single JMX command or run JMX commands in an interactive shell. There is a menu selection that invokes the interactive shell feature. See Chapter 9, "Diagnostic and Monitoring Tools," for examples of how to interface to this utility.

User Interface

JMXClient> help
Executing command : JmxCommand(help).
exit
Example: exit
 
info objectName
Example ==> OAS: info oc4j:j2eeType=JVM,name=single,J2EEServer=standalone
 
setattribs ObjectName attributeName1 attributeValue1 [attributeName2 attributeValue2]...
          setattribs will only work with attribute types that have 
          a constructor with java.lang.String argument.
Example ==> OAS: setattribs oc4j:j2eeType=JTAResource,name="oc4j-tm",J2EEServer=standalone transactionTimeout 31
 
getattribs ObjectName [attribute1] [attribute2]..
Example ==> OAS: getattribs oc4j:j2eeType=JVM,name=single,J2EEServer=standalone javaVersion freeMemory
Example ==> WLS: getattribs rib-rms:appName=rib-rms,name=ribLogManager CurrentLoggerNames
 
help [command]
 
invoke ObjectName methodName pramType1 paramValue1 [pramType2 paramValue2]...
 
Example ==> OAS: invoke oc4j:j2eeType=JNDINamespace,name=JNDINamespace,J2EEServer=standalone getAllBindingsAsXMLString
Example ==> OAS: invoke oc4j:j2eeType=JVM,name=single,J2EEServer=standalone getproperty java.lang.String java.library.path
Example ==> WLS: invoke rib-rms:appName=rib-rms,level=application startAll
list objectName
Example: list *:*
 
close
Example: close
 
connect jmxServiceUrl jmxUser jmxPassword jmxConnectionProtocolProviderPackage
Example ==> OAS: connect service:jmx:rmi://localhost:23791/oc4j oc4jadmin oc4jadmin oracle.oc4j.admin.jmx.remote
Example ==> WLS: connect service:jmx:t3://localhost:8001/jndi/weblogic.management.mbeanservers.runtime weblogic weblogic1 weblogic.management.remote
 
Previous command successful: JmxCommand(help).
      JMXClient>

For clients like RDMT that might issue "single" JMX commands from shell scripts, the JmxClientMain class provides a user interface that is similar to the JMX commands above, with additional connection options for each command.

Third Party JMX Client Example

This example is for Sun JConsole tool.

See: http://java.sun.com/developer/technicalArticles/J2SE/jconsole.htmlhttp://java.sun.com/j2se/1.5.0/docs/guide/management/jconsole.htm

  1. Copy the following files to the host where jconsole will run.

    wljmxclient.jar

  2. Create a startup file that sets the properties and classpath:

    jconsole
    -J
    -Djava.class.path=$JAVA_HOME/lib/jconsole.jar:$JAVA_HOME/lib/tools.jar:$WL_HOME/server/lib/wljmxclient.jar -J-Djmx.remote.protocol.provider.pkgs=weblogic.management.remote -debug
    
  3. Start the JConsole and log in to MBean server using a connect URL (for example, service:jmx:rmi:///jndi/iiop://localhost:18006/weblogic.management.mbeanservers.runtime).

    Surrounding text describes Chapter5-newconnection.png.
  4. Select and open any one of the MBean. It opens a window with four tabs: Attributes, Operations, Notifications, and Info.

    1. The Attributes tab provides information about the attributes of the MBean.

      Surrounding text describes Chapter5-attributes.png.
    2. The Operations tab gives the list of operations supported by that MBean.

      Surrounding text describes jconsole_operationstab.png.
    3. The Notifications tab gives the list of notifications captured on that MBean. (You must subscribe for capturing the notifications.) Subscribing, unsubscribing, and clearing of notifications can be done from this tab.

      Surrounding text describes jconsole_notificationstab.png.
    4. The Info tab provides details about the MBean.

      Info tab
    5. Once an MBean is subscribed for notifications, you can see the list of notifications that occurred for that MBean. The default is zero.

      Ntoifications tab
    6. When some operations of the subscribed MBean are executed/invoked, notifications are captured under the Notifications tab.

      Notifications tab