User: starksm
Date: 01/11/20 01:42:48
Modified: src/main/org/jboss/configuration Tag: Branch_2_4
ConfigurationService.java
Log:
Change to the unified log4j based org.jboss.logging.Logger class.
Revision Changes Path
No revision
No revision
1.30.2.4 +14 -15 jboss/src/main/org/jboss/configuration/ConfigurationService.java
Index: ConfigurationService.java
===================================================================
RCS file:
/cvsroot/jboss/jboss/src/main/org/jboss/configuration/ConfigurationService.java,v
retrieving revision 1.30.2.3
retrieving revision 1.30.2.4
diff -u -r1.30.2.3 -r1.30.2.4
--- ConfigurationService.java 2001/11/12 19:31:07 1.30.2.3
+++ ConfigurationService.java 2001/11/20 09:42:47 1.30.2.4
@@ -46,7 +46,7 @@
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
-import org.jboss.logging.Log;
+import org.jboss.logging.Logger;
import org.jboss.util.Service;
import org.jboss.util.ServiceFactory;
import org.jboss.util.ServiceMBeanSupport;
@@ -67,7 +67,7 @@
* @author Rickard �berg ([EMAIL PROTECTED])
* @author [EMAIL PROTECTED]
* @author Jason Dillon <a
href="mailto:[EMAIL PROTECTED]"><[EMAIL PROTECTED]></a>
- * @version $Revision: 1.30.2.3 $
+ * @version $Revision: 1.30.2.4 $
*/
public class ConfigurationService
extends ServiceMBeanSupport
@@ -108,11 +108,7 @@
serviceOpMap.put("destroy", new Integer(2));
serviceOpMap.put("stop", new Integer(3));
}
-
-
- /** Instance logger. */
- private final Log log = Log.createLog(getName());
-
+
/** The MBean server which this service is registered in. */
private MBeanServer server;
@@ -390,8 +386,7 @@
catch (FileNotFoundException e)
{
log.error("Configuration file " + confFile.getFile() +
- " must be available and writable.");
- log.exception(e);
+ " must be available and writable.", e);
}
finally
{
@@ -685,9 +680,8 @@
info = server.getMBeanInfo(instance.getObjectName());
} catch (Throwable ex)
{
- log.error("Could not create MBean " +
- objectName + "(" + code + ")");
- logException(ex);
+ logException("Could not create MBean " +
+ objectName + "(" + code + ")", ex);
// Ah what the heck.. skip it
continue;
@@ -813,7 +807,7 @@
server.invoke(serviceControl, "register", args, signature);
} catch (Exception e)
{
- logException(e);
+ logException("register failure", e);
}
}
}
@@ -861,6 +855,10 @@
*/
private void logException(Throwable e)
{
+ logException("Unexpected error", e);
+ }
+ private void logException(String msg, Throwable e)
+ {
if (e instanceof RuntimeErrorException)
{
e = ((RuntimeErrorException)e).getTargetError();
@@ -878,7 +876,7 @@
e = ((ReflectionException)e).getTargetException();
}
- log.exception(e);
+ log.error(msg, e);
}
/**
@@ -889,6 +887,7 @@
* matching operation is forwarded to the mbean by invoking the method
* through the MBeanServer object.
*/
+ static Logger proxyLog = Logger.getLogger(ServiceProxy.class);
private class ServiceProxy implements InvocationHandler
{
private boolean[] hasOp = { false, false, false, false };
@@ -931,7 +930,7 @@
// Log a warning if the mbean does not implement
// any Service methods
if (opCount == 0)
- log.warning(objectName + " does not implement any Service methods");
+ proxyLog.warn(objectName + " does not implement any Service methods");
}
/**
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development