How to Programmatically Connect to the Oracle CEP JMX Server From a Non-Oracle CEP Client

12-14 Oracle Complex Event Processing Administrators Guide For details see Section 12.3.1, How to Programmatically Connect to the Oracle CEP JMX Server From a Non-Oracle CEP Client . 2. Acquire an instance of a MonitorRuntimeMBean for the component you want to monitor as Example 12–5 shows. Example 12–5 Acquiring an Instance of a MonitorRuntimeMBean m_processorInbound = ObjectName.getInstance com.bea.wlevs:Name=myprocessor, Type=EPLProcessor, Application=myapplication, Direction=INBOUND ; Be sure you specify whether you want to monitor incoming events INBOUND or outgoing events OUTBOUND. For example: 3. Use the MonitorRuntimeMBean to acquire an instance of ProbeRuntimeMBean for the type of statistic you want as Example 12–6 shows. Example 12–6 Acquiring an Instance of ProbeRuntimeMBean ProbeRuntimeMBean probeON = m_testBean.getMonitorRuntimeMBean.monitorAvgThroughput m_processorInbound, 1000, 1000 ; The MonitorRuntimeMBean has methods for each type of statistic you can gather. For example, you execute monitorAvgLatency if you want to monitor the average latency, monitorAvgThroughput to monitor the average throughput, and so on. These methods all return ProbeRuntimeMBean. 4. Use the ProbeRuntimeMbean instance to get the actual runtime metrics in one of the following ways: a. Use the ProbeRuntimeMBean method getMetric to pull the information. b. Use javax.management.NotificationBroadcaster.addNotificationLi stener to have the information pushed to you every time there is a change in the metrics. 5. When you are finished gathering monitoring information, unregister the MBean from the MBean server as Example 12–7 shows. Example 12–7 Unregistering the MBean probON.terminate; For additional details about these MBean interfaces and how to use them to monitor throughput and latency, see the com.bea.wlevs.monitor.management package in the Oracle Fusion Middleware Java API Reference for Oracle Complex Event Processing. Configuring JMX for Oracle CEP 12-15 12.3.5 How to Connect to a Local or Remote Oracle CEP JMX Server Using JConsole With Security Enabled You can use the wlevsjconsole script to connect to an Oracle CEP JMX server running on your local host or on a remote host to browse and manage Oracle CEP MBeans with the JDK jconsole. This procedure describes how to use JConsole when the Oracle CEP server has security enabled. This is the default configuration and is recommended for production servers. Alternatively, you can connect to the JMX server with security disabled see Section 12.3.6, How to Connect to a Local or Remote Oracle CEP JMX Server Using JConsole With Security Disabled . For more information, see Section 12.1.2.1, Accessing the Oracle CEP JMX Server . To connect to a local or remote Oracle CEP JMX server using JConsole with security enabled: 1. Ensure that the local or remote Oracle CEP server is running. 2. Open a command window and set your environment as described in Setting Your Development Environment in the Oracle Complex Event Processing Getting Started. 3. Launch jconsole using the wlevsjconsole.cmd or wlevsjconsole.sh script located in the ORACLE_CEP_HOMEocep_11.1bin directory, where ORACLE_CEP_HOME refers to the directory in which you installed Oracle CEP such as oracle_home. a. To connect to a local Oracle CEP server, enter: prompt wlevsjconsole.cmd b. To connect to a remote Oracle CEP server, enter: prompt wlevsjconsole.cmd HOST-NAME:PORT Where HOST-NAME is the name of the remote host and PORT is the NetIO port as configured in the remote host’s ORACLE_CEP_HOMEuser_ projectsdomainsDOMAIN-NAMEdefaultserverconfigconfig.x ml file. The jconsole browser attempts to log into the JMX server and initially fails as Figure 12–3 shows. Note: When using JConsole, you must start it with the Oracle CEP wlevsjconsole.cmd or wlevsjconsole.sh script. You cannot start jconsole directly.