User: starksm
Date: 01/09/11 11:35:02
Modified: src/main/org/jboss/jmx/server JMXAdaptorImpl.java
JMXAdaptorService.java RMIConnectorImpl.java
RMIConnectorService.java XMLAdaptorService.java
XMLTestService.java
Log:
Convert all logging to org.jboss.logging.Logger which is a subclass of
org.apache.log4j.Category.
Revision Changes Path
1.7 +1 -2 jboss/src/main/org/jboss/jmx/server/JMXAdaptorImpl.java
Index: JMXAdaptorImpl.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/jmx/server/JMXAdaptorImpl.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- JMXAdaptorImpl.java 2001/08/30 03:18:14 1.6
+++ JMXAdaptorImpl.java 2001/09/11 18:35:02 1.7
@@ -25,7 +25,6 @@
import javax.management.MBeanServer;
import javax.naming.InitialContext;
-import org.jboss.logging.Log;
import org.jboss.system.ServiceMBeanSupport;
import org.jboss.jmx.interfaces.JMXAdaptor;
@@ -35,7 +34,7 @@
*
* @see <related>
* @author <a href="mailto:[EMAIL PROTECTED]">Rickard �berg</a>
-* @version $Revision: 1.6 $
+* @version $Revision: 1.7 $
*/
public class JMXAdaptorImpl
extends UnicastRemoteObject
1.7 +2 -2 jboss/src/main/org/jboss/jmx/server/JMXAdaptorService.java
Index: JMXAdaptorService.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/jmx/server/JMXAdaptorService.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- JMXAdaptorService.java 2001/09/01 19:50:32 1.6
+++ JMXAdaptorService.java 2001/09/11 18:35:02 1.7
@@ -34,7 +34,7 @@
*
* @see <related>
* @author <a href="mailto:[EMAIL PROTECTED]">Rickard �berg</a>
- * @version $Revision: 1.6 $
+ * @version $Revision: 1.7 $
*/
public class JMXAdaptorService
extends ServiceMBeanSupport
@@ -84,7 +84,7 @@
new InitialContext().unbind(JNDI_NAME);
} catch (Exception e)
{
- log.exception(e);
+ log.error("unbind failed", e);
}
}
}
1.7 +0 -1 jboss/src/main/org/jboss/jmx/server/RMIConnectorImpl.java
Index: RMIConnectorImpl.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/jmx/server/RMIConnectorImpl.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- RMIConnectorImpl.java 2001/08/30 03:18:14 1.6
+++ RMIConnectorImpl.java 2001/09/11 18:35:02 1.7
@@ -43,7 +43,6 @@
import javax.naming.InitialContext;
-import org.jboss.logging.Log;
import org.jboss.system.ServiceMBeanSupport;
import org.jboss.jmx.interfaces.RMIConnector;
1.8 +85 -76 jboss/src/main/org/jboss/jmx/server/RMIConnectorService.java
Index: RMIConnectorService.java
===================================================================
RCS file:
/cvsroot/jboss/jboss/src/main/org/jboss/jmx/server/RMIConnectorService.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- RMIConnectorService.java 2001/08/30 03:18:14 1.7
+++ RMIConnectorService.java 2001/09/11 18:35:02 1.8
@@ -28,85 +28,94 @@
import javax.management.MBeanServer;
import javax.naming.InitialContext;
-import org.jboss.logging.Log;
import org.jboss.system.ServiceMBeanSupport;
/**
-* <description>
-*
-* @author <a href="mailto:[EMAIL PROTECTED]">Rickard �berg</a>
-* @author <A href="mailto:[EMAIL PROTECTED]">Andreas "Mad"
Schaefer</A>
-**/
+ * <description>
+ *
+ * @author <a href="mailto:[EMAIL PROTECTED]">Rickard �berg</a>
+ * @author <A href="mailto:[EMAIL PROTECTED]">Andreas "Mad"
Schaefer</A>
+ **/
public class RMIConnectorService
- extends ServiceMBeanSupport
- implements RMIConnectorServiceMBean
+extends ServiceMBeanSupport
+implements RMIConnectorServiceMBean
{
- // Constants -----------------------------------------------------
- //AS I am not quite sure if this works but somehow the protocol should become
- //AS part of the JNDI name because there could be more than one protcol
- public static String JNDI_NAME = "jmx:rmi";
- public static String JMX_NAME = "jmx";
- public static String PROTOCOL_NAME = "rmi";
-
- // Attributes ----------------------------------------------------
- private MBeanServer server;
- private RMIConnectorImpl adaptor;
- private String mHost;
- private String mName;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
- public RMIConnectorService() {
- mName = null;
- }
-
- public RMIConnectorService(
- String name
- ) {
- mName = name;
- }
-
- // Public --------------------------------------------------------
- public ObjectName getObjectName(
- MBeanServer server,
- ObjectName name
- ) throws javax.management.MalformedObjectNameException {
- this.server = server;
- return new ObjectName( OBJECT_NAME );
- }
-
- public String getName() {
- return "JMX RMI Connector";
- }
-
- public String getJNDIName() {
- if (mName != null)
- {
- return JMX_NAME + ":" + mHost + ":" + PROTOCOL_NAME + ":" + mName;
- }
- else
- {
- return JMX_NAME + ":" + mHost + ":" + PROTOCOL_NAME;
- }
- }
-
- // Protected -----------------------------------------------------
- protected void initService() throws Exception {
- mHost = InetAddress.getLocalHost().getHostName();
- adaptor = new RMIConnectorImpl( server );
- }
-
- protected void startService() throws Exception {
- new InitialContext().bind( getJNDIName(), adaptor );
- }
-
- protected void stopService() {
- try {
- new InitialContext().unbind( getJNDIName() );
- }
- catch( Exception e ) {
- log.exception( e );
- }
- }
+ // Constants -----------------------------------------------------
+ //AS I am not quite sure if this works but somehow the protocol should become
+ //AS part of the JNDI name because there could be more than one protcol
+ public static String JNDI_NAME = "jmx:rmi";
+ public static String JMX_NAME = "jmx";
+ public static String PROTOCOL_NAME = "rmi";
+
+ // Attributes ----------------------------------------------------
+ private MBeanServer server;
+ private RMIConnectorImpl adaptor;
+ private String mHost;
+ private String mName;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+ public RMIConnectorService()
+ {
+ mName = null;
+ }
+
+ public RMIConnectorService(
+ String name
+ )
+ {
+ mName = name;
+ }
+
+ // Public --------------------------------------------------------
+ public ObjectName getObjectName(
+ MBeanServer server,
+ ObjectName name
+ ) throws javax.management.MalformedObjectNameException
+ {
+ this.server = server;
+ return new ObjectName( OBJECT_NAME );
+ }
+
+ public String getName()
+ {
+ return "JMX RMI Connector";
+ }
+
+ public String getJNDIName()
+ {
+ if (mName != null)
+ {
+ return JMX_NAME + ":" + mHost + ":" + PROTOCOL_NAME + ":" + mName;
+ }
+ else
+ {
+ return JMX_NAME + ":" + mHost + ":" + PROTOCOL_NAME;
+ }
+ }
+
+ // Protected -----------------------------------------------------
+ protected void initService() throws Exception
+ {
+ mHost = InetAddress.getLocalHost().getHostName();
+ adaptor = new RMIConnectorImpl( server );
+ }
+
+ protected void startService() throws Exception
+ {
+ new InitialContext().bind( getJNDIName(), adaptor );
+ }
+
+ protected void stopService()
+ {
+ try
+ {
+ new InitialContext().unbind( getJNDIName() );
+ }
+ catch( Exception e )
+ {
+ log.error("unbind failed", e );
+ }
+ }
}
1.4 +112 -108 jboss/src/main/org/jboss/jmx/server/XMLAdaptorService.java
Index: XMLAdaptorService.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/jmx/server/XMLAdaptorService.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XMLAdaptorService.java 2001/08/30 03:18:14 1.3
+++ XMLAdaptorService.java 2001/09/11 18:35:02 1.4
@@ -1,9 +1,9 @@
/*
-* JBoss, the OpenSource J2EE webOS
-*
-* Distributable under LGPL license.
-* See terms of license at gnu.org.
-*/
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
package org.jboss.jmx.server;
import javax.management.MBeanServer;
@@ -25,115 +25,119 @@
import org.w3c.dom.Element;
/**
-* MBean Wrapper for the XML Adaptor.
-*
-* @author Andreas Schaefer ([EMAIL PROTECTED])
-* @created June 22, 2001
-* @version $Revision: 1.3 $
-*/
+ * MBean Wrapper for the XML Adaptor.
+ *
+ * @author Andreas Schaefer ([EMAIL PROTECTED])
+ * @created June 22, 2001
+ * @version $Revision: 1.4 $
+ */
public class XMLAdaptorService
- extends ServiceMBeanSupport
- implements XMLAdaptorServiceMBean
+extends ServiceMBeanSupport
+implements XMLAdaptorServiceMBean
{
- // Attributes ----------------------------------------------------
- XMLAdaptorImpl mAdaptor;
-
- // Constants -----------------------------------------------------
- public static String JNDI_NAME = "jmx:xml";
-
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- // Public --------------------------------------------------------
-
- public Object[] invokeXML( Document pJmxOperations ) {
- return mAdaptor.invokeXML( pJmxOperations );
- }
-
- public Object invokeXML( Element pJmxOperation ) {
- return mAdaptor.invokeXML( pJmxOperation );
- }
-
- public ObjectName getObjectName( MBeanServer pServer, ObjectName pName )
- throws
- javax.management.MalformedObjectNameException
- {
- return pName;
- }
-
- public String getName() {
- return "JMX XML-Adaptor";
- }
-
- // Protected -----------------------------------------------------
- protected void initService()
- throws
- Exception
- {
- mAdaptor = new XMLAdaptorImpl( getServer() );
- }
-
- protected void startService()
- throws
- Exception
- {
- bind( mAdaptor );
- }
-
- protected void stopService() {
- try
- {
- unbind();
- }
- catch( Exception e )
- {
- log.exception( e );
- }
- }
- private void bind( XMLAdaptorImpl pImplementation )
- throws
- NamingException
+ // Attributes ----------------------------------------------------
+ XMLAdaptorImpl mAdaptor;
+
+ // Constants -----------------------------------------------------
+ public static String JNDI_NAME = "jmx:xml";
+
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ // Public --------------------------------------------------------
+
+ public Object[] invokeXML( Document pJmxOperations )
{
- Context lContext = new InitialContext();
-
- // Ah ! JBoss Server isn't serializable, so we use a helper class
- NonSerializableFactory.bind( JNDI_NAME, pImplementation );
-
+ return mAdaptor.invokeXML( pJmxOperations );
+ }
+
+ public Object invokeXML( Element pJmxOperation )
+ {
+ return mAdaptor.invokeXML( pJmxOperation );
+ }
+
+ public ObjectName getObjectName( MBeanServer pServer, ObjectName pName )
+ throws
+ javax.management.MalformedObjectNameException
+ {
+ return pName;
+ }
+
+ public String getName()
+ {
+ return "JMX XML-Adaptor";
+ }
+
+ // Protected -----------------------------------------------------
+ protected void initService()
+ throws Exception
+ {
+ mAdaptor = new XMLAdaptorImpl( getServer() );
+ }
+
+ protected void startService()
+ throws Exception
+ {
+ bind( mAdaptor );
+ }
+
+ protected void stopService()
+ {
+ try
+ {
+ unbind();
+ }
+ catch( Exception e )
+ {
+ log.error("unbind failed", e );
+ }
+ }
+ private void bind( XMLAdaptorImpl pImplementation )
+ throws NamingException
+ {
+ Context lContext = new InitialContext();
+
+ // Ah ! JBoss Server isn't serializable, so we use a helper class
+ NonSerializableFactory.bind( JNDI_NAME, pImplementation );
+
//AS Don't ask me what I am doing here
- Name lName = lContext.getNameParser("").parse( JNDI_NAME );
- while( lName.size() > 1 ) {
- String lContextName = lName.get( 0 );
- try {
- lContext = (Context) lContext.lookup(lContextName);
- }
- catch( NameNotFoundException e ) {
- lContext = lContext.createSubcontext(lContextName);
- }
- lName = lName.getSuffix( 1 );
- }
-
- // The helper class NonSerializableFactory uses address type nns, we
go on to
- // use the helper class to bind the javax.mail.Session object in JNDI
- StringRefAddr lAddress = new StringRefAddr( "nns", JNDI_NAME );
- Reference lReference = new Reference(
- XMLAdaptorImpl.class.getName(),
- lAddress,
- NonSerializableFactory.class.getName(),
- null
+ Name lName = lContext.getNameParser("").parse( JNDI_NAME );
+ while( lName.size() > 1 )
+ {
+ String lContextName = lName.get( 0 );
+ try
+ {
+ lContext = (Context) lContext.lookup(lContextName);
+ }
+ catch( NameNotFoundException e )
+ {
+ lContext = lContext.createSubcontext(lContextName);
+ }
+ lName = lName.getSuffix( 1 );
+ }
+
+ // The helper class NonSerializableFactory uses address type nns, we go on to
+ // use the helper class to bind the javax.mail.Session object in JNDI
+ StringRefAddr lAddress = new StringRefAddr( "nns", JNDI_NAME );
+ Reference lReference = new Reference(
+ XMLAdaptorImpl.class.getName(),
+ lAddress,
+ NonSerializableFactory.class.getName(),
+ null
);
- lContext.bind( lName.get( 0 ), lReference );
-
- log.log( "JBoss XML Adaptor Service '" + JNDI_NAME + "' bound to " +
JNDI_NAME );
- }
-
- private void unbind() throws NamingException
- {
+ lContext.bind( lName.get( 0 ), lReference );
+
+ log.info( "JBoss XML Adaptor Service '" + JNDI_NAME + "' bound to " +
JNDI_NAME );
+ }
+
+ private void unbind() throws NamingException
+ {
new InitialContext().unbind( JNDI_NAME );
NonSerializableFactory.unbind( JNDI_NAME );
- log.log("JBoss XML Adaptor service '" + JNDI_NAME + "' removed from JNDI" );
- }
-
+ log.info("JBoss XML Adaptor service '" + JNDI_NAME + "' removed from JNDI" );
+ }
+
}
1.6 +2 -2 jboss/src/main/org/jboss/jmx/server/XMLTestService.java
Index: XMLTestService.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/jmx/server/XMLTestService.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XMLTestService.java 2001/08/30 03:18:14 1.5
+++ XMLTestService.java 2001/09/11 18:35:02 1.6
@@ -24,7 +24,7 @@
*
* @author Andreas Schaefer ([EMAIL PROTECTED])
* @created June 22, 2001
-* @version $Revision: 1.5 $
+* @version $Revision: 1.6 $
*/
public class XMLTestService
extends ServiceMBeanSupport
@@ -113,7 +113,7 @@
}
catch( Exception e )
{
- log.exception( e );
+ log.error("unbind failed", e );
}
}
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development