User: starksm
Date: 01/11/20 01:23:19
Modified: src/main/org/jboss/resource Tag: Branch_2_4
ConnectionFactoryLoader.java
ConnectionManagerFactoryLoader.java
JBossConnectionListenerImpl.java
JBossResourceSubjectFactory.java RARDeployer.java
RARMetaData.java
Log:
Change to the unified log4j based org.jboss.logging.Logger class.
Revision Changes Path
No revision
No revision
1.4.2.2 +47 -42 jbosscx/src/main/org/jboss/resource/ConnectionFactoryLoader.java
Index: ConnectionFactoryLoader.java
===================================================================
RCS file:
/cvsroot/jboss/jbosscx/src/main/org/jboss/resource/ConnectionFactoryLoader.java,v
retrieving revision 1.4.2.1
retrieving revision 1.4.2.2
diff -u -r1.4.2.1 -r1.4.2.2
--- ConnectionFactoryLoader.java 2001/09/30 22:44:26 1.4.2.1
+++ ConnectionFactoryLoader.java 2001/11/20 09:23:18 1.4.2.2
@@ -43,8 +43,8 @@
import javax.transaction.TransactionManager;
+import org.jboss.logging.Logger;
import org.jboss.logging.log4j.CategoryWriter;
-import org.jboss.logging.log4j.JBossCategory;
import org.jboss.resource.security.PrincipalMapping;
import org.jboss.util.ServiceMBeanSupport;
@@ -61,7 +61,7 @@
* @author <a href="[EMAIL PROTECTED]">Toby Allsopp</a>
* @author <a href="mailto:[EMAIL PROTECTED]">David Jencks</a>
* @see RARDeployer
- * @version $Revision: 1.4.2.1 $ <p>
+ * @version $Revision: 1.4.2.2 $ <p>
*
* <b>Revisions:</b> <p>
*
@@ -338,7 +338,7 @@
Hashtable environment)
{
// Return the connection factory with the requested name
- category.debug("ConnectionFactoryLoader.getObjectInstance, name = '" +
+ log.debug("ConnectionFactoryLoader.getObjectInstance, name = '" +
name + "'");
synchronized (cfs)
{
@@ -356,7 +356,7 @@
*/
public void handleNotification(Notification n, Object handback)
{
- category.debug("Received notification '" + n + "'");
+ log.debug("Received notification '" + n + "'");
// We know that this is relevent to us because of the filter
String type = n.getType();
@@ -372,12 +372,12 @@
}
else
{
- category.error("Unknown notification type: " + type);
+ log.error("Unknown notification type: " + type);
}
}
catch (Exception e)
{
- category.error("Problem loading or unloading connection factory", e);
+ log.error("Problem loading or unloading connection factory", e);
}
}
@@ -393,7 +393,7 @@
}
catch (MalformedObjectNameException mone)
{
- category.error("The name '" + nameStr + "' is malformed", mone);
+ log.error("The name '" + nameStr + "' is malformed", mone);
}
}
return name;
@@ -402,11 +402,12 @@
protected void initService()
throws Exception
{
- //add the factory name to the category:
- category = (JBossCategory)JBossCategory.getInstance(getClass().getName() +
"." + factoryName);
+ //add the factory name to the log:
+ String logName = getClass().getName() + "." + factoryName;
+ log = Logger.getLogger(logName);
rarDeployerObjectName = new ObjectName(rarDeployerName);
server.addNotificationListener(rarDeployerObjectName, this,
- new RAFilter(category), null);
+ new RAFilter(log), null);
}
protected void startService()
@@ -460,7 +461,7 @@
}
catch (Exception e)
{
- category.error("Problem stopping ConnectionFactoryLoader service:", e);
+ log.error("Problem stopping ConnectionFactoryLoader service:", e);
}
}
}
@@ -491,7 +492,7 @@
}
catch (NamingException ne)
{
- category.error("Unable to obtain initial context", ne);
+ log.error("Unable to obtain initial context", ne);
return;
}
@@ -512,7 +513,7 @@
}
catch (ClassNotFoundException cnfe)
{
- category.error("Unable to load managed connection factory class '" +
+ log.error("Unable to load managed connection factory class '" +
mcfClassName + "'", cnfe);
return;
}
@@ -522,7 +523,7 @@
}
catch (Exception e)
{
- category.error("Unable to instantiate manageed connection factory class '"
+
+ log.error("Unable to instantiate manageed connection factory class '" +
mcfClass + "'", e);
return;
}
@@ -538,7 +539,7 @@
catch (IOException ioe)
{
// This shouldn't happen, so we try to carry on as if it didn't
- category.error("Problem converting properties string '" + properties +
+ log.error("Problem converting properties string '" + properties +
"' to Properties", ioe);
}
@@ -553,10 +554,10 @@
{
if (ddProp.value == null)
{
- category.warn("Not setting config property '" + ddProp.name + "'");
+ log.warn("Not setting config property '" + ddProp.name + "'");
continue;
}
- category.warn("Using default value '" + ddProp.value + "' for " +
+ log.warn("Using default value '" + ddProp.value + "' for " +
"config property '" + ddProp.name + "'");
value = ddProp.value;
}
@@ -570,14 +571,14 @@
}
catch (ClassNotFoundException cnfe)
{
- category.warn("Unable to find class '" + ddProp.type + "' for " +
+ log.warn("Unable to find class '" + ddProp.type + "' for " +
"property '" + ddProp.name + "' - skipping property.");
continue;
}
PropertyEditor pe = PropertyEditorManager.findEditor(clazz);
if (pe == null)
{
- category.warn("Unable to find a PropertyEditor for class '" +
+ log.warn("Unable to find a PropertyEditor for class '" +
clazz + "' of property '" + ddProp.name + "' - " +
"skipping property");
continue;
@@ -588,7 +589,7 @@
}
catch (IllegalArgumentException iae)
{
- category.warn("Value '" + value + "' is not valid for property '" +
+ log.warn("Value '" + value + "' is not valid for property '" +
ddProp.name + "' of class '" + clazz + "' - skipping " +
"property");
continue;
@@ -601,7 +602,7 @@
}
catch (NoSuchMethodException nsme)
{
- category.warn("The class '" + mcfClass.toString() + "' has no " +
+ log.warn("The class '" + mcfClass.toString() + "' has no " +
"setter for config property '" + ddProp.name + "'");
continue;
}
@@ -611,23 +612,23 @@
}
catch (Exception e)
{
- category.warn("Unable to invoke setter method '" + setter + "' " +
+ log.warn("Unable to invoke setter method '" + setter + "' " +
"on object '" + mcf + "'", e);
}
}
// Give it somewhere to tell people things
- PrintWriter logWriter = new
CategoryWriter(JBossCategory.getInstance(mcf.getClass().getName() + "." +
factoryName));
+ PrintWriter logWriter = new CategoryWriter(log.getCategory());
try
{
mcf.setLogWriter(logWriter);
}
catch (ResourceException re)
{
- category.warn("Unable to set log writer '" + logWriter + "' on " +
+ log.warn("Unable to set log writer '" + logWriter + "' on " +
"managed connection factory", re);
- category.warn("Linked exception:", re.getLinkedException());
+ log.warn("Linked exception:", re.getLinkedException());
}
// Find the transaction manager
@@ -639,7 +640,7 @@
}
catch (NamingException ne)
{
- category.error("Unable to locate the transaction manager at '" + tmName +
+ log.error("Unable to locate the transaction manager at '" + tmName +
"'", ne);
}
@@ -653,7 +654,7 @@
}
catch (Exception e)
{
- category.error("Unable to instantiate principal mapping class '" +
+ log.error("Unable to instantiate principal mapping class '" +
princMapClass + "'", e);
return;
}
@@ -672,7 +673,7 @@
}
catch (Exception e)
{
- category.error("Unable to find connection manager factory at 'java:/" +
+ log.error("Unable to find connection manager factory at 'java:/" +
cmfName + "'", e);
return;
}
@@ -692,13 +693,17 @@
Properties cmProperties = new Properties();
try
{
- cmProperties.load(
- new ByteArrayInputStream(cmProps.getBytes("ISO-8859-1")));
+ if( cmProps != null )
+ {
+ byte[] bytes = cmProps.getBytes("ISO-8859-1");
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
+ cmProperties.load(bais);
+ }
cmConfig.properties = cmProperties;
}
catch (IOException ioe)
{
- category.error("Couldn't convert properties string '" + cmProps + "' to " +
+ log.error("Couldn't convert properties string '" + cmProps + "' to " +
"Properties", ioe);
}
@@ -708,7 +713,7 @@
}
catch (ResourceException re)
{
- category.error("Error initialising connection manager", re);
+ log.error("Error initialising connection manager", re);
return;
}
@@ -724,14 +729,14 @@
}
catch (ResourceException re)
{
- category.error("Unable to create connection factory", re);
+ log.error("Unable to create connection factory", re);
return;
}
// Bind it into JNDI
bindName = "java:/" + factoryName;
- category.debug("Binding object '" + cf + "' into JNDI at '" + bindName + "'");
+ log.debug("Binding object '" + cf + "' into JNDI at '" + bindName + "'");
synchronized (cfs)
{
cfs.put(factoryName, cf);
@@ -742,12 +747,12 @@
try
{
ctx.bind(bindName, cf);
- category.info("Bound connection factory for resource adapter '" +
+ log.info("Bound connection factory for resource adapter '" +
resourceAdapterName + "' to JNDI name '" + bindName + "'");
}
catch (NamingException ne)
{
- category.error("Unable to bind connection factory to JNDI name '" +
+ log.error("Unable to bind connection factory to JNDI name '" +
bindName + "'", ne);
}
}
@@ -763,7 +768,7 @@
cm.shutDown();
cfs.remove(factoryName);
- category.info("Connection factory '" + factoryName + "' shut down.");
+ log.info("Connection factory '" + factoryName + "' shut down.");
// Unbind from JNDI
@@ -773,7 +778,7 @@
}
catch (NamingException ne)
{
- category.error("Unable to unbind connection factory at JNDI location '" +
+ log.error("Unable to unbind connection factory at JNDI location '" +
bindName + "'", ne);
}
}
@@ -785,11 +790,11 @@
*/
private class RAFilter implements NotificationFilter
{
- private JBossCategory category;
+ private Logger log;
- private RAFilter(JBossCategory category)
+ private RAFilter(Logger log)
{
- this.category = category;
+ this.log = log;
}
/**
@@ -800,7 +805,7 @@
*/
public boolean isNotificationEnabled(Notification n)
{
- category.debug("Evaluating notification type='" + n.getType() + "', " +
+ log.debug("Evaluating notification type='" + n.getType() + "', " +
"message='" + n.getMessage() + "'");
return
n.getType().startsWith(DEPLOYMENT_NOTIFICATION) &&
1.2.2.2 +8 -7
jbosscx/src/main/org/jboss/resource/ConnectionManagerFactoryLoader.java
Index: ConnectionManagerFactoryLoader.java
===================================================================
RCS file:
/cvsroot/jboss/jbosscx/src/main/org/jboss/resource/ConnectionManagerFactoryLoader.java,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -u -r1.2.2.1 -r1.2.2.2
--- ConnectionManagerFactoryLoader.java 2001/09/30 22:44:26 1.2.2.1
+++ ConnectionManagerFactoryLoader.java 2001/11/20 09:23:18 1.2.2.2
@@ -27,7 +27,7 @@
import javax.transaction.TransactionManager;
-import org.jboss.logging.log4j.JBossCategory;
+import org.jboss.logging.Logger;
import org.jboss.util.ServiceMBeanSupport;
/**
@@ -36,7 +36,7 @@
*
* @author Toby Allsopp ([EMAIL PROTECTED])
* @author <a href="mailto:[EMAIL PROTECTED]">David Jencks</a>
- * @version $Revision: 1.2.2.1 $
+ * @version $Revision: 1.2.2.2 $
*/
public class ConnectionManagerFactoryLoader
extends ServiceMBeanSupport
@@ -188,7 +188,7 @@
Hashtable environment)
{
// Return the connection factory with the requested name
- category.debug("ConnectionManagerLoader.getObjectInstance, name = '" +
+ log.debug("ConnectionManagerLoader.getObjectInstance, name = '" +
name + "'");
synchronized (cmfs)
{
@@ -227,7 +227,7 @@
bind(ctx, "java:/" + factoryName,
new Reference(cmf.getClass().getName(), getClass().getName(), null));
- category.info("Connection manager factory '" + factoryName + " bound to " +
+ log.info("Connection manager factory '" + factoryName + " bound to " +
"'java:/" + factoryName + "'");
}
@@ -240,7 +240,7 @@
try
{
new InitialContext().unbind("java:/" + factoryName);
- category.info("Connection manager factory '" + factoryName +
+ log.info("Connection manager factory '" + factoryName +
"' removed from JNDI");
}
catch (NamingException e)
@@ -259,7 +259,7 @@
}
catch (MalformedObjectNameException mone)
{
- category.error("The name '" + nameStr + "' is malformed", mone);
+ log.error("The name '" + nameStr + "' is malformed", mone);
}
}
return name;
@@ -268,7 +268,8 @@
protected void initService()
throws Exception
{
- category = (JBossCategory)JBossCategory.getInstance(getClass().getName() +
"." + factoryName);
+ String logName = getClass().getName() + "." + factoryName;
+ log = Logger.getLogger(logName);
}
// Package protected ---------------------------------------------
1.1.1.1.4.3 +8 -8
jbosscx/src/main/org/jboss/resource/JBossConnectionListenerImpl.java
Index: JBossConnectionListenerImpl.java
===================================================================
RCS file:
/cvsroot/jboss/jbosscx/src/main/org/jboss/resource/JBossConnectionListenerImpl.java,v
retrieving revision 1.1.1.1.4.2
retrieving revision 1.1.1.1.4.3
diff -u -r1.1.1.1.4.2 -r1.1.1.1.4.3
--- JBossConnectionListenerImpl.java 2001/10/21 11:01:00 1.1.1.1.4.2
+++ JBossConnectionListenerImpl.java 2001/11/20 09:23:18 1.1.1.1.4.3
@@ -8,7 +8,7 @@
import javax.resource.spi.ManagedConnectionFactory;
-import org.jboss.logging.log4j.JBossCategory;
+import org.jboss.logging.Logger;
/**
* There exists one instance of this class for each connection factory. This
@@ -19,7 +19,7 @@
* @author Toby Allsopp ([EMAIL PROTECTED])
* @author <a href="mailto:[EMAIL PROTECTED]">David Jencks</a>
* @see ConnectionManagerFactory
- * @version $Revision: 1.1.1.1.4.2 $
+ * @version $Revision: 1.1.1.1.4.3 $
*/
public class JBossConnectionListenerImpl
implements JBossConnectionListener
@@ -30,7 +30,7 @@
private ManagedConnectionFactory mcf;
private JBossConnectionManager cm;
- private JBossCategory category;
+ private Logger log;
// Static --------------------------------------------------------
@@ -39,7 +39,7 @@
JBossConnectionListenerImpl(ManagedConnectionFactory mcf, String factoryName)
{
this.mcf = mcf;
- category = (JBossCategory)JBossCategory.getInstance(getClass().getName() +
"." + factoryName);
+ log = Logger.getLogger(getClass().getName() + "." + factoryName);
}
// Public --------------------------------------------------------
@@ -53,9 +53,9 @@
*/
public void connectionHandleIssued(Object connection)
{
- if( category.isTraceEnabled() )
+ if( log.isTraceEnabled() )
{
- category.trace("Connection handle '" + connection +
+ log.trace("Connection handle '" + connection +
"' issued by connection manager '" + cm + "' from mcf '" +
mcf + "'");
}
@@ -68,9 +68,9 @@
*/
public void connectionHandleClosed(Object connection)
{
- if( category.isTraceEnabled() )
+ if( log.isTraceEnabled() )
{
- category.debug("Connection handle '" + connection +
+ log.trace("Connection handle '" + connection +
"' closed from connection manager '" + cm + "' from mcf '" +
mcf + "'");
}
1.1.1.1.4.2 +5 -6
jbosscx/src/main/org/jboss/resource/JBossResourceSubjectFactory.java
Index: JBossResourceSubjectFactory.java
===================================================================
RCS file:
/cvsroot/jboss/jbosscx/src/main/org/jboss/resource/JBossResourceSubjectFactory.java,v
retrieving revision 1.1.1.1.4.1
retrieving revision 1.1.1.1.4.2
diff -u -r1.1.1.1.4.1 -r1.1.1.1.4.2
--- JBossResourceSubjectFactory.java 2001/09/30 22:44:26 1.1.1.1.4.1
+++ JBossResourceSubjectFactory.java 2001/11/20 09:23:18 1.1.1.1.4.2
@@ -13,8 +13,7 @@
import javax.security.auth.Subject;
-import org.jboss.logging.log4j.JBossCategory;
-
+import org.jboss.logging.Logger;
import org.jboss.resource.security.PrincipalMapping;
/**
@@ -25,7 +24,7 @@
*
* @author Toby Allsopp ([EMAIL PROTECTED])
* @author <a href="mailto:[EMAIL PROTECTED]">David Jencks</a>
- * @version $Revision: 1.1.1.1.4.1 $
+ * @version $Revision: 1.1.1.1.4.2 $
*/
public class JBossResourceSubjectFactory
implements ResourceSubjectFactory
@@ -33,7 +32,7 @@
// Static --------------------------------------------------------
- private static JBossCategory category =
(JBossCategory)JBossCategory.getInstance("org.jboss.resource.JBossResourceSubjectFactory");
+ private static Logger log = Logger.getLogger(JBossResourceSubjectFactory.class);
private static Method getPrincipalMethod;
private final static Object[] noArgs = new Object[0];
@@ -67,7 +66,7 @@
}
catch (Exception e)
{
- category.error("Could not GetPrincipalMethod", e);
+ log.error("Could not GetPrincipalMethod", e);
}
}
return getPrincipalMethod;
@@ -94,7 +93,7 @@
}
catch (Exception e)
{
- category.error("could not getSubject", e);
+ log.error("could not getSubject", e);
return null;
}
}
1.3.2.3 +3 -3 jbosscx/src/main/org/jboss/resource/RARDeployer.java
Index: RARDeployer.java
===================================================================
RCS file: /cvsroot/jboss/jbosscx/src/main/org/jboss/resource/RARDeployer.java,v
retrieving revision 1.3.2.2
retrieving revision 1.3.2.3
diff -u -r1.3.2.2 -r1.3.2.3
--- RARDeployer.java 2001/11/02 08:38:06 1.3.2.2
+++ RARDeployer.java 2001/11/20 09:23:19 1.3.2.3
@@ -32,7 +32,7 @@
import org.jboss.deployment.DeployerMBeanSupport;
import org.jboss.deployment.DeploymentException;
-import org.jboss.logging.log4j.JBossCategory;
+import org.jboss.logging.Logger;
import org.jboss.metadata.XmlFileLoader;
import org.w3c.dom.Document;
@@ -48,7 +48,7 @@
* @author Toby Allsopp ([EMAIL PROTECTED])
* @author <a href="mailto:[EMAIL PROTECTED]">David Jencks</a>
* @author [EMAIL PROTECTED]
- * @version $Revision: 1.3.2.2 $
+ * @version $Revision: 1.3.2.3 $
* @see org.jboss.resource.ConnectionFactoryLoader <p>
*
* <b>Revisions:</b> <p>
@@ -79,7 +79,7 @@
/*
* log4j Category for logging
*/
- private JBossCategory category =
(JBossCategory)JBossCategory.getInstance(RARDeployer.class);
+ private Logger category = Logger.getLogger(RARDeployer.class);
/**
* The directory that will contain local copies of deployed RARs
1.3.2.3 +9 -9 jbosscx/src/main/org/jboss/resource/RARMetaData.java
Index: RARMetaData.java
===================================================================
RCS file: /cvsroot/jboss/jbosscx/src/main/org/jboss/resource/RARMetaData.java,v
retrieving revision 1.3.2.2
retrieving revision 1.3.2.3
diff -u -r1.3.2.2 -r1.3.2.3
--- RARMetaData.java 2001/11/02 08:38:07 1.3.2.2
+++ RARMetaData.java 2001/11/20 09:23:19 1.3.2.3
@@ -13,7 +13,7 @@
import java.util.Map;
import org.jboss.deployment.DeploymentException;
-import org.jboss.logging.log4j.JBossCategory;
+import org.jboss.logging.Logger;
import org.jboss.metadata.MetaData;
import org.jboss.metadata.XmlLoadable;
import org.w3c.dom.Element;
@@ -25,7 +25,7 @@
*
* @author Toby Allsopp ([EMAIL PROTECTED])
* @see RARDeployer
- * @version $Revision: 1.3.2.2 $
+ * @version $Revision: 1.3.2.3 $
*/
public class RARMetaData
// extends Y
@@ -38,7 +38,7 @@
// Attributes ----------------------------------------------------
- private JBossCategory category =
(JBossCategory)JBossCategory.getInstance(RARMetaData.class);
+ private Logger log = Logger.getLogger(RARMetaData.class);
private ClassLoader classLoader;
@@ -306,19 +306,19 @@
new Boolean(getElementContent(requiredE).trim()).booleanValue();
if (required)
{
- category.info("Required license terms present. See deployment " +
+ log.info("Required license terms present. See deployment " +
"descriptor.");
}
else
{
- category.info("License terms present. See deployment descriptor.");
+ log.info("License terms present. See deployment descriptor.");
}
}
private void setDescription(Element element)
throws DeploymentException
{
- category.info("Loading " + getElementContent(element).trim());
+ log.info("Loading " + getElementContent(element).trim());
}
private void setAuthenticationMechanism(Element element)
@@ -367,7 +367,7 @@
Element permSpec = MetaData.getUniqueChild(element,
"security-permission-spec");
String spec = getElementContent(permSpec);
- category.debug("Ignoring security-permission("+spec+")");
+ log.debug("Ignoring security-permission("+spec+")");
}
private String getElementContent(Element element)
@@ -399,7 +399,7 @@
{
// We don't handle this element. Hope it wasn't
// important.
- category.warn("Element '" + child + "' not recognised.");
+ log.warn("Element '" + child + "' not recognised.");
continue;
}
@@ -453,7 +453,7 @@
methodName.append(toTitleCase(tag.substring(last_hyphen + 1)));
}
- category.debug("methodName = '" + methodName + "'");
+ log.debug("methodName = '" + methodName + "'");
try
{
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development