User: ejort Date: 02/01/04 22:39:42 Modified: varia/src/main/org/jboss/jdo/castor CastorJDOImpl.java Log: Guarded debug logging Revision Changes Path 1.9 +25 -12 contrib/varia/src/main/org/jboss/jdo/castor/CastorJDOImpl.java Index: CastorJDOImpl.java =================================================================== RCS file: /cvsroot/jboss/contrib/varia/src/main/org/jboss/jdo/castor/CastorJDOImpl.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- CastorJDOImpl.java 2001/12/07 15:50:55 1.8 +++ CastorJDOImpl.java 2002/01/05 06:39:42 1.9 @@ -48,7 +48,7 @@ * Castor JDO support * * @author Oleg Nitz ([EMAIL PROTECTED]) - * @version $Revision: 1.8 $ + * @version $Revision: 1.9 $ */ public class CastorJDOImpl extends ServiceMBeanSupport implements DataObjects, ObjectFactory, Referenceable, Serializable, @@ -103,6 +103,8 @@ int pos; Method m; + boolean debug = log.isDebugEnabled(); + // Bind in JNDI bind(new InitialContext(), "java:/" + _jndiName, this); @@ -124,7 +126,8 @@ new Class[] {boolean.class}); m.invoke(_jdo, new Object[] {new Boolean(_autoStore)}); } catch (Exception ex) { - log.debug("couldn't invoke setAutoStore()"); + if (debug) + log.debug("couldn't invoke setAutoStore()"); } try { @@ -133,10 +136,12 @@ new Class[] {boolean.class}); m.invoke(_jdo, new Object[] {new Boolean(_dbPooling)}); } catch (Exception ex) { - log.debug("couldn't invoke setDatabasePooling()"); + if (debug) + log.debug("couldn't invoke setDatabasePooling()"); } _instances.put(_jndiName, this); - log.debug("DataObjects factory for " + _dataSourceName + " bound to " + _jndiName); + if (debug) + log.debug("DataObjects factory for " + _dataSourceName + " bound to " + _jndiName); } public void stopService() { @@ -281,43 +286,51 @@ // LogInterceptor implementation for Castor 0.8 ---------------------- public void loading(Class objClass, Object identity) { - log.debug( "Loading " + objClass.getName() + " (" + identity + ")" ); + if (log.isDebugEnabled()) + log.debug( "Loading " + objClass.getName() + " (" + identity + ")" ); } public void creating(Class objClass, Object identity) { - log.debug( "Creating " + objClass.getName() + " (" + identity + ")" ); + if (log.isDebugEnabled()) + log.debug( "Creating " + objClass.getName() + " (" + identity + ")" ); } public void removing(Class objClass, Object identity) { - log.debug( "Removing " + objClass.getName() + " (" + identity + ")" ); + if (log.isDebugEnabled()) + log.debug( "Removing " + objClass.getName() + " (" + identity + ")" ); } public void storing(Class objClass, Object identity) { - log.debug( "Storing " + objClass.getName() + " (" + identity + ")" ); + if (log.isDebugEnabled()) + log.debug( "Storing " + objClass.getName() + " (" + identity + ")" ); } // LogInterceptor implementation for Castor 0.9 ---------------------- public void loading(Object objClass, Object identity) { - log.debug( "Loading " + objClass + " (" + identity + ")" ); + if (log.isDebugEnabled()) + log.debug( "Loading " + objClass + " (" + identity + ")" ); } public void creating(Object objClass, Object identity) { - log.debug( "Creating " + objClass + " (" + identity + ")" ); + if (log.isDebugEnabled()) + log.debug( "Creating " + objClass + " (" + identity + ")" ); } public void removing(Object objClass, Object identity) { - log.debug( "Removing " + objClass + " (" + identity + ")" ); + if (log.isDebugEnabled()) + log.debug( "Removing " + objClass + " (" + identity + ")" ); } public void storing(Object objClass, Object identity) { - log.debug( "Storing " + objClass + " (" + identity + ")" ); + if (log.isDebugEnabled()) + log.debug( "Storing " + objClass + " (" + identity + ")" ); }
_______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development