jmx Configuration Object rmi Configuration Object

12-12 Oracle Complex Event Processing Administrators Guide For details see Section 12.2, Configuring JMX . 2. Write the http:java.sun.comjavasetechnologiescoremntr-mgmtjavama nagement Java code to configure the component using the appropriate MBean. Consider the following JMX programming hints. One of the first things you must do in your JMX program is to establish a connection to the JMX server running in the Oracle CEP server as Example 12–2 shows. Example 12–3 Establishing a Connection to the Oracle CEP JMX Server public static void initConnectionString hostname, int port, String username, char[] password throws IOException,MalformedURLException { MapString,Object env = makeSecureEnv; This is an OSGi necessity env.put JMXConnectorFactory.DEFAULT_CLASS_LOADER, com.bea.core.jmx.remote.provider.msarmi.ServerProvider.class.getClassLoader ; env.put JMXConnectorFactory.PROTOCOL_PROVIDER_CLASS_LOADER, com.bea.core.jmx.remote.provider.msarmi.ServerProvider.class.getClassLoader ; JMXServiceURL serviceUrl = new JMXServiceURL MSARMI,localhost,9002,jndijmxconnector ; System.out.printlnService: + serviceURL.toString; env.put JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES, com.bea.core.jmx.remote.provider ; System.setPropertymx4j.remote.resolver.pkgs, com.bea.core.jmx.remote.resolver; JMXConnector connector = JMXConnectorFactory.connecturl, env; connector.connect; MBeanServerConnection connection = connector.getMBeanServerConnection; ... } The JMXConnectorFactory.connect method’s second parameter is a Map object that sets up a secure environment using the makeSecureEnv method, which looks like the following: private static MapString,Object makeSecureEnv { MapString,Object env = new HashMapString,Object; String username = wlevs ; char[] password = { w,l,e,v,s }; env.putJMXConnector.CREDENTIALS, new Serializable[]{username,password}; env.putjmx.remote.authenticator, com.bea.core.jmx.server.CEAuthenticator; System.setPropertyjmx.remote.authenticator, com.bea.core.jmx.server.CEAuthenticator; return env; }