Author: jim.ma
Date: 2009-10-28 04:59:44 -0400 (Wed, 28 Oct 2009)
New Revision: 11054
Added:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/management/
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/management/InstrumentationManagerExtImpl.java
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java
Log:
To Fix the build
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java 2009-10-27
16:10:55 UTC (rev 11053)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java 2009-10-28
08:59:44 UTC (rev 11054)
@@ -56,7 +56,7 @@
import org.jboss.wsf.spi.management.EndpointRegistry;
import org.jboss.wsf.spi.management.EndpointRegistryFactory;
import org.jboss.wsf.stack.cxf.client.configuration.JBossWSCXFConfigurer;
-import org.jbossws.wsf.stack.cxf.management.InstrumentationManagerExtImpl;
+import org.jboss.wsf.stack.cxf.management.InstrumentationManagerExtImpl;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.GenericApplicationContext;
Added:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/management/InstrumentationManagerExtImpl.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/management/InstrumentationManagerExtImpl.java
(rev 0)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/management/InstrumentationManagerExtImpl.java 2009-10-28
08:59:44 UTC (rev 11054)
@@ -0,0 +1,64 @@
+package org.jboss.wsf.stack.cxf.management;
+
+import java.util.Iterator;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.annotation.PostConstruct;
+import javax.management.JMException;
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+
+import org.apache.cxf.bus.ManagedBus;
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.management.jmx.InstrumentationManagerImpl;
+
+
+/**
+ * The InstrumentationManagerImpl extension class to set the JBoss MBeanServer.
+ * @author <a herf="mailto:ema@redhat.com> Jim Ma</a>
+ *
+ */
+
+public class InstrumentationManagerExtImpl extends InstrumentationManagerImpl
+{
+ private static final Logger LOG =
LogUtils.getL7dLogger(InstrumentationManagerExtImpl.class);
+ private MBeanServer mbeanServer = null;
+
+
+ /**
+ * TODO: to see if this can be moved to cxf code base
+ */
+ public void initMBeanServer()
+ {
+ this.setServer(this.getJBossMbeanServer());
+
+ ManagedBus mbus = new ManagedBus(this.getBus());
+ try
+ {
+ register(mbus);
+ }
+ catch (JMException e)
+ {
+ LOG.log(Level.SEVERE, "Register bus " + this.getBus() + " failure
:" + e.getMessage());
+ }
+
+ }
+
+ protected MBeanServer getJBossMbeanServer()
+ {
+
+ if (mbeanServer == null)
+ {
+ for (Iterator i = MBeanServerFactory.findMBeanServer(null).iterator();
i.hasNext();)
+ {
+ mbeanServer = (MBeanServer)i.next();
+ if (mbeanServer.getClass().getName().startsWith("org.jboss"))
+ {
+ break;
+ }
+ }
+ }
+ return mbeanServer;
+ }
+}
Show replies by date