You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2009/03/04 07:00:09 UTC
svn commit: r749918 - in /camel/trunk/components/camel-jmxconnect/src:
main/java/org/apache/camel/jmxconnect/
main/java/org/apache/camel/jmxconnect/provider/activemq/
main/java/org/apache/camel/jmxconnect/provider/camel/
test/java/org/apache/camel/jmxc...
Author: ningjiang
Date: Wed Mar 4 06:00:09 2009
New Revision: 749918
URL: http://svn.apache.org/viewvc?rev=749918&view=rev
Log:
Fixed the CS errors of camel-jmxconnect
Modified:
camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/CamelJmxConnector.java
camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/CamelJmxConnectorServer.java
camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/CamelJmxConnectorSupport.java
camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/ListenerInfo.java
camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/MBeanCamelServerConnection.java
camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/MBeanCamelServerConnectionClient.java
camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/MBeanCamelServerConnectionImpl.java
camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/MBeanServerConnectionDelegate.java
camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/ServerListenerInfo.java
camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/provider/activemq/ActiveMQHelper.java
camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/provider/activemq/ClientProvider.java
camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/provider/activemq/ServerProvider.java
camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/provider/camel/ClientProvider.java
camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/provider/camel/ServerProvider.java
camel/trunk/components/camel-jmxconnect/src/test/java/org/apache/camel/jmxconnect/JmxActiveMQRemoteTest.java
camel/trunk/components/camel-jmxconnect/src/test/java/org/apache/camel/jmxconnect/JmxRemoteTest.java
camel/trunk/components/camel-jmxconnect/src/test/java/org/apache/camel/jmxconnect/SimpleService.java
camel/trunk/components/camel-jmxconnect/src/test/java/org/apache/camel/jmxconnect/SimpleServiceMBean.java
Modified: camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/CamelJmxConnector.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/CamelJmxConnector.java?rev=749918&r1=749917&r2=749918&view=diff
==============================================================================
--- camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/CamelJmxConnector.java (original)
+++ camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/CamelJmxConnector.java Wed Mar 4 06:00:09 2009
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -18,6 +17,24 @@
package org.apache.camel.jmxconnect;
+import java.io.IOException;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicLong;
+
+import javax.management.ListenerNotFoundException;
+import javax.management.MBeanServerConnection;
+import javax.management.NotificationBroadcaster;
+import javax.management.NotificationBroadcasterSupport;
+import javax.management.NotificationEmitter;
+import javax.management.NotificationFilter;
+import javax.management.NotificationListener;
+import javax.management.remote.JMXConnectionNotification;
+import javax.management.remote.JMXConnector;
+import javax.management.remote.JMXConnectorFactory;
+import javax.management.remote.JMXServerErrorException;
+import javax.management.remote.JMXServiceURL;
+import javax.security.auth.Subject;
+
import org.apache.camel.CamelContext;
import org.apache.camel.CamelContextAware;
import org.apache.camel.impl.DefaultCamelContext;
@@ -25,13 +42,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.management.*;
-import javax.management.remote.*;
-import javax.security.auth.Subject;
-import java.io.IOException;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicLong;
-
/**
* <p>
* The client end of a JMX API connector. An object of this type can be used to establish a connection to a connector
@@ -47,7 +57,7 @@
* @version $Revision$
*/
public class CamelJmxConnector implements JMXConnector, CamelContextAware {
- private static final Log log = LogFactory.getLog(JMXConnector.class);
+ private static final Log LOG = LogFactory.getLog(JMXConnector.class);
private NotificationBroadcasterSupport connectionNotifier = new NotificationBroadcasterSupport();
private AtomicLong notificationNumber = new AtomicLong();
private Map env;
@@ -122,7 +132,7 @@
sendConnectionNotificationOpened();
} catch (Exception e) {
- log.error("Failed to connect: " + e, e);
+ LOG.error("Failed to connect: " + e, e);
IOException ioe = new IOException(e.getMessage());
throw ioe;
}
@@ -215,7 +225,7 @@
sendConnectionNotificationClosed();
proxy.destroy();
} catch (Exception e) {
- log.error("Failed to destroy proxy: " + e, e);
+ LOG.error("Failed to destroy proxy: " + e, e);
throw new IOException(e.getMessage());
}
}
@@ -280,7 +290,7 @@
* @see NotificationEmitter#removeNotificationListener
*/
public void removeConnectionNotificationListener(NotificationListener l, NotificationFilter f, Object handback)
- throws ListenerNotFoundException {
+ throws ListenerNotFoundException {
connectionNotifier.removeNotificationListener(l, f, handback);
}
@@ -301,7 +311,7 @@
public CamelContext getCamelContext() {
if (camelContext == null) {
- log.warn("No CamelContext injected so creating a default implementation");
+ LOG.warn("No CamelContext injected so creating a default implementation");
// TODO should we barf or create a default one?
camelContext = new DefaultCamelContext();
}
Modified: camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/CamelJmxConnectorServer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/CamelJmxConnectorServer.java?rev=749918&r1=749917&r2=749918&view=diff
==============================================================================
--- camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/CamelJmxConnectorServer.java (original)
+++ camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/CamelJmxConnectorServer.java Wed Mar 4 06:00:09 2009
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,6 +16,15 @@
*/
package org.apache.camel.jmxconnect;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.Map;
+
+import javax.management.MBeanServer;
+import javax.management.remote.JMXConnectorFactory;
+import javax.management.remote.JMXConnectorServer;
+import javax.management.remote.JMXServiceURL;
+
import org.apache.camel.CamelContext;
import org.apache.camel.CamelContextAware;
import org.apache.camel.impl.DefaultCamelContext;
@@ -24,14 +32,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.management.MBeanServer;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXConnectorServer;
-import javax.management.remote.JMXServiceURL;
-import java.io.IOException;
-import java.util.Collections;
-import java.util.Map;
-
/**
* <p>The client end of a JMX API connector. An object of this type can
* be used to establish a connection to a connector server.</p>
@@ -46,7 +46,7 @@
*/
public class CamelJmxConnectorServer extends JMXConnectorServer implements CamelContextAware {
- private static final Log log = LogFactory.getLog(CamelJmxConnectorServer.class);
+ private static final Log LOG = LogFactory.getLog(CamelJmxConnectorServer.class);
private JMXServiceURL url;
private final Map env;
private volatile boolean stopped = true;
@@ -88,7 +88,7 @@
service.afterPropertiesSet();
stopped = false;
} catch (Exception e) {
- log.error("Failed to start ", e);
+ LOG.error("Failed to start ", e);
throw new IOException(e.toString());
}
@@ -106,7 +106,7 @@
service.destroy();
}
} catch (Exception e) {
- log.error("Failed to stop ", e);
+ LOG.error("Failed to stop ", e);
throw new IOException(e.toString());
}
@@ -127,7 +127,7 @@
public CamelContext getCamelContext() {
if (camelContext == null) {
- log.warn("No CamelContext injected so creating a default implementation");
+ LOG.warn("No CamelContext injected so creating a default implementation");
// TODO should we barf or create a default one?
camelContext = new DefaultCamelContext();
}
Modified: camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/CamelJmxConnectorSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/CamelJmxConnectorSupport.java?rev=749918&r1=749917&r2=749918&view=diff
==============================================================================
--- camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/CamelJmxConnectorSupport.java (original)
+++ camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/CamelJmxConnectorSupport.java Wed Mar 4 06:00:09 2009
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -18,17 +17,22 @@
package org.apache.camel.jmxconnect;
-import javax.management.remote.JMXServiceURL;
import java.io.IOException;
import java.net.MalformedURLException;
+import javax.management.remote.JMXServiceURL;
+
/**
* @version $Revision$
*/
-public class CamelJmxConnectorSupport {
+public final class CamelJmxConnectorSupport {
public static final String DEFAULT_DESTINATION_PREFIX = "org.apache.camel.jmxconnect.";
public static final String MBEAN_SERVER_NAME = "*";
public static final String MBEAN_GROUP_NAME = "*";
+
+ private CamelJmxConnectorSupport() {
+ // helper class
+ }
public static String getEndpointUri(JMXServiceURL serviceURL, String expectedProtocol) throws IOException {
String protocol = serviceURL.getProtocol();
Modified: camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/ListenerInfo.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/ListenerInfo.java?rev=749918&r1=749917&r2=749918&view=diff
==============================================================================
--- camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/ListenerInfo.java (original)
+++ camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/ListenerInfo.java Wed Mar 4 06:00:09 2009
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Modified: camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/MBeanCamelServerConnection.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/MBeanCamelServerConnection.java?rev=749918&r1=749917&r2=749918&view=diff
==============================================================================
--- camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/MBeanCamelServerConnection.java (original)
+++ camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/MBeanCamelServerConnection.java Wed Mar 4 06:00:09 2009
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,11 +16,11 @@
*/
package org.apache.camel.jmxconnect;
-import org.apache.camel.Endpoint;
-
import javax.management.MBeanServerConnection;
import javax.management.ObjectName;
+import org.apache.camel.Endpoint;
+
/**
* @version $Revision$
*/
@@ -34,13 +33,13 @@
* @param name
* @param replyToEndpoint
*/
- public void addNotificationListener(String listenerId, ObjectName name, Endpoint replyToEndpoint);
+ void addNotificationListener(String listenerId, ObjectName name, Endpoint replyToEndpoint);
/**
* Remove a Notification listener
*
* @param listenerId
*/
- public void removeNotificationListener(String listenerId);
+ void removeNotificationListener(String listenerId);
}
\ No newline at end of file
Modified: camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/MBeanCamelServerConnectionClient.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/MBeanCamelServerConnectionClient.java?rev=749918&r1=749917&r2=749918&view=diff
==============================================================================
--- camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/MBeanCamelServerConnectionClient.java (original)
+++ camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/MBeanCamelServerConnectionClient.java Wed Mar 4 06:00:09 2009
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,6 +16,17 @@
*/
package org.apache.camel.jmxconnect;
+import java.util.Iterator;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+import javax.management.ListenerNotFoundException;
+import javax.management.Notification;
+import javax.management.NotificationBroadcasterSupport;
+import javax.management.NotificationFilter;
+import javax.management.NotificationListener;
+import javax.management.ObjectName;
+
import org.apache.camel.Endpoint;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
@@ -24,16 +34,11 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.management.*;
-import java.util.Iterator;
-import java.util.List;
-import java.util.concurrent.CopyOnWriteArrayList;
-
/**
* @version $Revision$
*/
public class MBeanCamelServerConnectionClient extends MBeanServerConnectionDelegate implements Processor {
- private static final Log log = LogFactory.getLog(MBeanCamelServerConnectionClient.class);
+ private static final Log LOG = LogFactory.getLog(MBeanCamelServerConnectionClient.class);
private MBeanCamelServerConnection serverConnection;
private Endpoint replyToEndpoint;
private List listeners = new CopyOnWriteArrayList();
@@ -57,7 +62,7 @@
// TODO need to create an endpoint for replies!!!
if (replyToEndpoint == null) {
- log.error("no replyToDestination for replies to be received!");
+ LOG.error("no replyToDestination for replies to be received!");
}
serverConnection.addNotificationListener(id, name, replyToEndpoint);
}
@@ -70,7 +75,7 @@
* Remove a Notification Listener
*/
public void removeNotificationListener(ObjectName name, NotificationListener listener)
- throws ListenerNotFoundException {
+ throws ListenerNotFoundException {
for (Iterator i = listeners.iterator(); i.hasNext();) {
ListenerInfo li = (ListenerInfo) i.next();
if (li.getListener() == listener) {
@@ -103,7 +108,7 @@
if (notification != null) {
localNotifier.sendNotification(notification);
} else {
- log.warn("Received message which is not a Notification: " + exchange);
+ LOG.warn("Received message which is not a Notification: " + exchange);
}
}
}
\ No newline at end of file
Modified: camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/MBeanCamelServerConnectionImpl.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/MBeanCamelServerConnectionImpl.java?rev=749918&r1=749917&r2=749918&view=diff
==============================================================================
--- camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/MBeanCamelServerConnectionImpl.java (original)
+++ camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/MBeanCamelServerConnectionImpl.java Wed Mar 4 06:00:09 2009
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,21 +16,22 @@
*/
package org.apache.camel.jmxconnect;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+
import org.apache.camel.Endpoint;
import org.apache.camel.ProducerTemplate;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
/**
* @version $Revision$
*/
public class MBeanCamelServerConnectionImpl extends MBeanServerConnectionDelegate implements MBeanCamelServerConnection {
- private static final Log log = LogFactory.getLog(MBeanCamelServerConnectionImpl.class);
+ private static final Log LOG = LogFactory.getLog(MBeanCamelServerConnectionImpl.class);
private Map notificationListeners = new ConcurrentHashMap();
private final ProducerTemplate template;
@@ -53,7 +53,7 @@
notificationListeners.put(listenerId, info);
connection.addNotificationListener(name, info, null, null);
} catch (Exception e) {
- log.error("Failed to addNotificationListener ", e);
+ LOG.error("Failed to addNotificationListener ", e);
}
}
Modified: camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/MBeanServerConnectionDelegate.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/MBeanServerConnectionDelegate.java?rev=749918&r1=749917&r2=749918&view=diff
==============================================================================
--- camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/MBeanServerConnectionDelegate.java (original)
+++ camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/MBeanServerConnectionDelegate.java Wed Mar 4 06:00:09 2009
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,10 +16,29 @@
*/
package org.apache.camel.jmxconnect;
-import javax.management.*;
import java.io.IOException;
import java.util.Set;
+import javax.management.Attribute;
+import javax.management.AttributeList;
+import javax.management.AttributeNotFoundException;
+import javax.management.InstanceAlreadyExistsException;
+import javax.management.InstanceNotFoundException;
+import javax.management.IntrospectionException;
+import javax.management.InvalidAttributeValueException;
+import javax.management.ListenerNotFoundException;
+import javax.management.MBeanException;
+import javax.management.MBeanInfo;
+import javax.management.MBeanRegistrationException;
+import javax.management.MBeanServerConnection;
+import javax.management.NotCompliantMBeanException;
+import javax.management.NotificationFilter;
+import javax.management.NotificationListener;
+import javax.management.ObjectInstance;
+import javax.management.ObjectName;
+import javax.management.QueryExp;
+import javax.management.ReflectionException;
+
/**
* Acts as a delegate for the MBeanServerConnection
*
@@ -35,20 +53,33 @@
}
- public ObjectInstance createMBean(String className, ObjectName name) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, IOException {
+ public ObjectInstance createMBean(String className, ObjectName name)
+ throws ReflectionException, InstanceAlreadyExistsException,
+ MBeanRegistrationException, MBeanException, NotCompliantMBeanException,
+ IOException {
return connection.createMBean(className, name);
}
- public ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException, IOException {
+ public ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName)
+ throws ReflectionException, InstanceAlreadyExistsException,
+ MBeanRegistrationException, MBeanException, NotCompliantMBeanException,
+ InstanceNotFoundException, IOException {
+
return connection.createMBean(className, name, loaderName);
}
- public ObjectInstance createMBean(String className, ObjectName name, Object[] params, String[] signature) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, IOException {
+ public ObjectInstance createMBean(String className, ObjectName name, Object[] params, String[] signature)
+ throws ReflectionException, InstanceAlreadyExistsException,
+ MBeanRegistrationException, MBeanException, NotCompliantMBeanException,
+ IOException {
return connection.createMBean(className, name, params, signature);
}
- public ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName, Object[] params, String[] signature) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException, IOException {
+ public ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName, Object[] params, String[] signature)
+ throws ReflectionException, InstanceAlreadyExistsException,
+ MBeanRegistrationException, MBeanException, NotCompliantMBeanException,
+ InstanceNotFoundException, IOException {
return connection.createMBean(className, name, loaderName, params, signature);
}
@@ -85,7 +116,10 @@
return connection.getAttributes(name, attributes);
}
- public void setAttribute(ObjectName name, Attribute attribute) throws InstanceNotFoundException, AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException, IOException {
+ public void setAttribute(ObjectName name, Attribute attribute)
+ throws InstanceNotFoundException, AttributeNotFoundException,
+ InvalidAttributeValueException, MBeanException, ReflectionException,
+ IOException {
connection.setAttribute(name, attribute);
}
Modified: camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/ServerListenerInfo.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/ServerListenerInfo.java?rev=749918&r1=749917&r2=749918&view=diff
==============================================================================
--- camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/ServerListenerInfo.java (original)
+++ camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/ServerListenerInfo.java Wed Mar 4 06:00:09 2009
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -18,20 +17,21 @@
package org.apache.camel.jmxconnect;
+import java.util.Map;
+
+import javax.management.Notification;
+import javax.management.NotificationListener;
+
import org.apache.camel.Endpoint;
import org.apache.camel.ProducerTemplate;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.management.Notification;
-import javax.management.NotificationListener;
-import java.util.Map;
-
/**
* @version $Revision$
*/
class ServerListenerInfo implements NotificationListener {
- private static final Log log = LogFactory.getLog(ServerListenerInfo.class);
+ private static final Log LOG = LogFactory.getLog(ServerListenerInfo.class);
private final String id;
private final Map holder;
private final ProducerTemplate template;
@@ -53,7 +53,7 @@
public void handleNotification(Notification notification, Object handback) {
System.out.println("Should be sending notification: " + notification);
if (replyToEndpoint == null) {
- log.warn("No replyToDestination for replies to be received so cannot send notification: " + notification);
+ LOG.warn("No replyToDestination for replies to be received so cannot send notification: " + notification);
} else {
template.sendBody(replyToEndpoint, notification);
}
Modified: camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/provider/activemq/ActiveMQHelper.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/provider/activemq/ActiveMQHelper.java?rev=749918&r1=749917&r2=749918&view=diff
==============================================================================
--- camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/provider/activemq/ActiveMQHelper.java (original)
+++ camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/provider/activemq/ActiveMQHelper.java Wed Mar 4 06:00:09 2009
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,14 +16,17 @@
*/
package org.apache.camel.jmxconnect.provider.activemq;
-import org.apache.camel.jmxconnect.CamelJmxConnectorSupport;
-import org.apache.camel.CamelContext;
import org.apache.activemq.camel.component.ActiveMQComponent;
+import org.apache.camel.CamelContext;
+import org.apache.camel.jmxconnect.CamelJmxConnectorSupport;
/**
* @version $Revision$
*/
-public class ActiveMQHelper {
+public final class ActiveMQHelper {
+ private ActiveMQHelper() {
+ // helper class
+ }
public static String getDefaultEndpointUri() {
return "activemq:" + CamelJmxConnectorSupport.DEFAULT_DESTINATION_PREFIX;
}
Modified: camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/provider/activemq/ClientProvider.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/provider/activemq/ClientProvider.java?rev=749918&r1=749917&r2=749918&view=diff
==============================================================================
--- camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/provider/activemq/ClientProvider.java (original)
+++ camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/provider/activemq/ClientProvider.java Wed Mar 4 06:00:09 2009
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,15 +16,16 @@
*/
package org.apache.camel.jmxconnect.provider.activemq;
-import org.apache.camel.jmxconnect.CamelJmxConnector;
-import org.apache.camel.jmxconnect.CamelJmxConnectorSupport;
-import org.apache.camel.CamelContext;
+import java.io.IOException;
+import java.util.Map;
import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorProvider;
import javax.management.remote.JMXServiceURL;
-import java.io.IOException;
-import java.util.Map;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.jmxconnect.CamelJmxConnector;
+import org.apache.camel.jmxconnect.CamelJmxConnectorSupport;
/**
* @version $Revision$
Modified: camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/provider/activemq/ServerProvider.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/provider/activemq/ServerProvider.java?rev=749918&r1=749917&r2=749918&view=diff
==============================================================================
--- camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/provider/activemq/ServerProvider.java (original)
+++ camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/provider/activemq/ServerProvider.java Wed Mar 4 06:00:09 2009
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -18,17 +17,17 @@
package org.apache.camel.jmxconnect.provider.activemq;
-import org.apache.camel.jmxconnect.CamelJmxConnectorServer;
-import org.apache.camel.jmxconnect.CamelJmxConnectorSupport;
-import org.apache.camel.CamelContext;
+import java.io.IOException;
+import java.util.Map;
import javax.management.MBeanServer;
import javax.management.remote.JMXConnectorServer;
import javax.management.remote.JMXConnectorServerProvider;
import javax.management.remote.JMXServiceURL;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.util.Map;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.jmxconnect.CamelJmxConnectorServer;
+import org.apache.camel.jmxconnect.CamelJmxConnectorSupport;
/**
* @version $Revision$
Modified: camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/provider/camel/ClientProvider.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/provider/camel/ClientProvider.java?rev=749918&r1=749917&r2=749918&view=diff
==============================================================================
--- camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/provider/camel/ClientProvider.java (original)
+++ camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/provider/camel/ClientProvider.java Wed Mar 4 06:00:09 2009
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,14 +16,14 @@
*/
package org.apache.camel.jmxconnect.provider.camel;
-import org.apache.camel.jmxconnect.CamelJmxConnector;
+import java.io.IOException;
+import java.util.Map;
import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorProvider;
import javax.management.remote.JMXServiceURL;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.util.Map;
+
+import org.apache.camel.jmxconnect.CamelJmxConnector;
/**
* @version $Revision$
Modified: camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/provider/camel/ServerProvider.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/provider/camel/ServerProvider.java?rev=749918&r1=749917&r2=749918&view=diff
==============================================================================
--- camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/provider/camel/ServerProvider.java (original)
+++ camel/trunk/components/camel-jmxconnect/src/main/java/org/apache/camel/jmxconnect/provider/camel/ServerProvider.java Wed Mar 4 06:00:09 2009
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -18,15 +17,15 @@
package org.apache.camel.jmxconnect.provider.camel;
-import org.apache.camel.jmxconnect.CamelJmxConnectorServer;
+import java.io.IOException;
+import java.util.Map;
import javax.management.MBeanServer;
import javax.management.remote.JMXConnectorServer;
import javax.management.remote.JMXConnectorServerProvider;
import javax.management.remote.JMXServiceURL;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.util.Map;
+
+import org.apache.camel.jmxconnect.CamelJmxConnectorServer;
/**
* @version $Revision$
Modified: camel/trunk/components/camel-jmxconnect/src/test/java/org/apache/camel/jmxconnect/JmxActiveMQRemoteTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jmxconnect/src/test/java/org/apache/camel/jmxconnect/JmxActiveMQRemoteTest.java?rev=749918&r1=749917&r2=749918&view=diff
==============================================================================
--- camel/trunk/components/camel-jmxconnect/src/test/java/org/apache/camel/jmxconnect/JmxActiveMQRemoteTest.java (original)
+++ camel/trunk/components/camel-jmxconnect/src/test/java/org/apache/camel/jmxconnect/JmxActiveMQRemoteTest.java Wed Mar 4 06:00:09 2009
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Modified: camel/trunk/components/camel-jmxconnect/src/test/java/org/apache/camel/jmxconnect/JmxRemoteTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jmxconnect/src/test/java/org/apache/camel/jmxconnect/JmxRemoteTest.java?rev=749918&r1=749917&r2=749918&view=diff
==============================================================================
--- camel/trunk/components/camel-jmxconnect/src/test/java/org/apache/camel/jmxconnect/JmxRemoteTest.java (original)
+++ camel/trunk/components/camel-jmxconnect/src/test/java/org/apache/camel/jmxconnect/JmxRemoteTest.java Wed Mar 4 06:00:09 2009
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -18,33 +17,46 @@
package org.apache.camel.jmxconnect;
-import junit.framework.TestCase;
-import org.apache.activemq.broker.BrokerFactory;
-import org.apache.activemq.broker.BrokerService;
-
-import javax.management.*;
-import javax.management.monitor.GaugeMonitor;
-import javax.management.remote.*;
import java.net.URI;
+import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
-import java.util.Arrays;
import java.util.concurrent.atomic.AtomicBoolean;
+import javax.management.Attribute;
+import javax.management.MBeanInfo;
+import javax.management.MBeanServer;
+import javax.management.MBeanServerConnection;
+import javax.management.MBeanServerFactory;
+import javax.management.Notification;
+import javax.management.NotificationListener;
+import javax.management.ObjectName;
+import javax.management.monitor.GaugeMonitor;
+import javax.management.remote.JMXConnector;
+import javax.management.remote.JMXConnectorFactory;
+import javax.management.remote.JMXConnectorServer;
+import javax.management.remote.JMXConnectorServerFactory;
+import javax.management.remote.JMXServiceURL;
+
+import junit.framework.TestCase;
+import org.apache.activemq.broker.BrokerFactory;
+import org.apache.activemq.broker.BrokerService;
+
/**
* @version $Revision$
*/
public class JmxRemoteTest extends TestCase {
+ protected String serverServiceUrl = "service:jmx:camel:///activemq:foo";
+ protected String clientServiceUrl = "service:jmx:camel:///activemq:foo";
+ protected String brokerUrl = "broker:(tcp://localhost:61616)/localhost?persistent=false";
private MBeanServer server;
private BrokerService broker;
private JMXConnectorServer connectorServer;
private JMXConnector connector;
private ObjectName serviceName;
private SimpleService service;
- protected String serverServiceUrl = "service:jmx:camel:///activemq:foo";
- protected String clientServiceUrl = "service:jmx:camel:///activemq:foo";
- protected String brokerUrl = "broker:(tcp://localhost:61616)/localhost?persistent=false";
+
protected void setUp() throws Exception {
broker = BrokerFactory.createBroker(new URI(brokerUrl));
@@ -112,7 +124,7 @@
// TODO not implemented yet!
// need server side push, the client needs to register with a replyToEndpoint
- public void DISABLED_testNotificationsJmx() throws Exception {
+ public void xtestNotificationsJmx() throws Exception {
// Now let's register a Monitor
// We would like to know if we have peaks in activity, so we can use JMX's
Modified: camel/trunk/components/camel-jmxconnect/src/test/java/org/apache/camel/jmxconnect/SimpleService.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jmxconnect/src/test/java/org/apache/camel/jmxconnect/SimpleService.java?rev=749918&r1=749917&r2=749918&view=diff
==============================================================================
--- camel/trunk/components/camel-jmxconnect/src/test/java/org/apache/camel/jmxconnect/SimpleService.java (original)
+++ camel/trunk/components/camel-jmxconnect/src/test/java/org/apache/camel/jmxconnect/SimpleService.java Wed Mar 4 06:00:09 2009
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -24,8 +23,8 @@
*/
public class SimpleService implements Runnable, SimpleServiceMBean {
private boolean running;
- private int simpleCounter = 0;
- private int simpleValue = 0;
+ private int simpleCounter;
+ private int simpleValue;
public void start() {
if (!running) {
Modified: camel/trunk/components/camel-jmxconnect/src/test/java/org/apache/camel/jmxconnect/SimpleServiceMBean.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jmxconnect/src/test/java/org/apache/camel/jmxconnect/SimpleServiceMBean.java?rev=749918&r1=749917&r2=749918&view=diff
==============================================================================
--- camel/trunk/components/camel-jmxconnect/src/test/java/org/apache/camel/jmxconnect/SimpleServiceMBean.java (original)
+++ camel/trunk/components/camel-jmxconnect/src/test/java/org/apache/camel/jmxconnect/SimpleServiceMBean.java Wed Mar 4 06:00:09 2009
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,