Hi all,
I am trying to expose a service endpoint via jmx to be able to interact with
it via jconsole.
So I apply what is described here :
http://cwiki.apache.org/confluence/display/CXF20DOC/JMX+Management How to
enable the CXF instrumentationManager 
It seems I never manage to register the enpoint, in the console, I only see
Bus under the org.apache.cxf (in the MBeans tab), in the provided link, I
should also be able to see Bus.Service.Endpoint, which obviously is not the
case.
Here is my cxf-config.xml file:
============================
<beans xmlns="http://www.springframework.org/schema/beans";
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        xmlns:jaxws="http://cxf.apache.org/jaxws";
        xsi:schemaLocation="
            http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
            http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd";>

        <import resource="classpath:META-INF/cxf/cxf.xml" />
        <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
        <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />

        <!-- implementation of the webservice -->
        <bean id="calculatorServiceEndpoint"
                class="org.dyndns.crouille.cxf.CalculatorImpl" />

        <!-- export the webservice using jaxws -->
        <jaxws:endpoint id="calculatorService"
                implementor="#calculatorServiceEndpoint" address="/calculator"
                endpointName="s:calculatorPort" 
serviceName="s:calculatorService"
                xmlns:s="http://cxf.apache.org"; />

        <!-- jmx configuration -->
        <bean id="org.apache.cxf.management.InstrumentationManager"
                
class="org.apache.cxf.management.jmx.InstrumentationManagerImpl">
                <property name="bus" ref="cxf" />
                <property name="enabled" value="true" />
                <property name="threaded" value="false" />
                <property name="daemon" value="false" />
                <property name="JMXServiceURL"
                        
value="service:jmx:rmi:///jndi/rmi://localhost:9914/jmxrmi" />
        </bean>
</beans>
===========================
Here is my annotated implementation of the service endpoint:
============================
package org.dyndns.crouille.cxf;

import javax.management.JMException;
import javax.management.ObjectName;

import org.apache.cxf.management.ManagedComponent;
import org.apache.cxf.management.annotation.ManagedNotification;
import org.apache.cxf.management.annotation.ManagedNotifications;
import org.apache.cxf.management.annotation.ManagedOperation;
import org.apache.cxf.management.annotation.ManagedResource;

@ManagedResource(componentName = "CalculatorImpl", description = "My Managed
Bean",
        persistPolicy = "OnUpdate", currencyTimeLimit = 15 ,
        log = false ,
        logFile = "jmx.log", persistPeriod = 200,
        persistLocation = "/local/work", persistName = "bar.jmx")
@ManagedNotifications([EMAIL PROTECTED](name = "My Notification",
                                   notificationTypes = {"type.foo",
"type.bar" }) })

public class CalculatorImpl implements CalculatorService, ManagedComponent {
        @ManagedOperation(description = "Add Two Numbers Together")
        public String add(String a, String b) {
                // TODO Auto-generated method stub
                return 
String.valueOf((Integer.parseInt(a)+Integer.parseInt(b)));
        }

        @ManagedOperation(description = "Multiply Two Numbers Together")
        public String multiply(String a, String b) {
                // TODO Auto-generated method stub
                return 
String.valueOf((Integer.parseInt(a)*Integer.parseInt(b)));
        }

        public ObjectName getObjectName() throws JMException {
                // TODO Auto-generated method stub
                return new ObjectName("org.apache.cxf:type=CalculatorImpl");

        }

}
==============================
I am wondering, since I started java first development, does have any direct
relation with what I encountering?, maybe this feature doesn't apply to all
type of services?
Thanks in advance for looking into my problem.
Ryadh.
-- 
View this message in context: 
http://www.nabble.com/CXF-and-JMX-tp18756410p18756410.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to