lunes, 14 de marzo de 2011

Oracle ALBPM Performance Monitoring

Currently I'm working at credit suisse as a BPM Consultant and I will like to create a tool to monitor the performance of the engine. This must show :
  1. DB usage
  2. JMS usage
  3. Prepare statement pool
In order to implement this I will try to connect with JMX to the Weblogic server. Let see if I can...
Links :
First item: Connect to the JMX weblogic Server

  • My First approach was to use an external (Failed)
The external resource of bpm is too old and does not allow me to connect to Weblogic 10
  • Second approach Is to create my Java Library and catalog it as a Java Component (Succedded)

I can not connect to the server using JMX from outside , for security reasons, but I do can connect using the local connection. That is why I use

private MBeanServer getMBeanServer() throws NamingException {
MBeanServer server;
InitialContext ctx = new InitialContext();
server = (MBeanServer) ctx.lookup("java:comp/env/jmx/runtime");
return server;
}


So this is how I will get my connection to the Weblogic MBeanServer access. Things I need to take care of :
  1. This method need to be runs on server since I like to monitor the engine I need to get the MBeanServer from the engine not PAPI
So in order to finish this I create my library with only one class and catalog it

import javax.management.MBeanServer;
import javax.management.ObjectName;
import javax.naming.InitialContext;
import javax.naming.NamingException;

public class JMXMonitor {


public static void main(String[] args) throws Exception {


}

public Object invokeMBeanMethod(String mBeanName, String methodName, Object[] args, String[] signature) throws Exception {
MBeanServer mBeanServer = getMBeanServer();
ObjectName name = new ObjectName(mBeanName);
return mBeanServer.invoke(name, methodName, args, signature);
}

public Object getMBeanAttributeValue(String mBeanName, String attributeName) throws Exception {
MBeanServer server = getMBeanServer();
ObjectName name = new ObjectName(mBeanName);
return server.getAttribute(name, attributeName);
}

private MBeanServer getMBeanServer() throws NamingException {
MBeanServer server;
InitialContext ctx = new InitialContext();
server = (MBeanServer) ctx.lookup("java:comp/env/jmx/runtime");
return server;
}
}


So once I can get the this done I have 50% of the problem resolved.

No hay comentarios:

Publicar un comentario