You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by tr...@apache.org on 2005/09/14 16:56:51 UTC
svn commit: r280870 - in
/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server: ./
authn/ enumeration/ interceptor/ jndi/ partition/ partition/impl/btree/gui/
partition/impl/btree/jdbm/ schema/ schema/bootstrap/
Author: trustin
Date: Wed Sep 14 07:56:35 2005
New Revision: 280870
URL: http://svn.apache.org/viewcvs?rev=280870&view=rev
Log:
Replaced calls to printStackTrace() with SLF4J calls. (Look at DIREVE-161)
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/AbstractTestCase.java
directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/authn/AuthenticationService.java
directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/enumeration/SearchResultFilteringEnumeration.java
directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/interceptor/InterceptorChain.java
directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/DefaultContextFactoryService.java
directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/partition/DefaultContextPartitionNexus.java
directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/partition/impl/btree/gui/ASTNode.java
directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/partition/impl/btree/jdbm/JdbmContextPartition.java
directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/AttributeTypeRegistryMonitorAdapter.java
directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/ComparatorRegistryMonitorAdapter.java
directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/DITContentRuleRegistryMonitorAdapter.java
directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/DITStructureRuleRegistryMonitorAdapter.java
directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/MatchingRuleRegistryMonitorAdapter.java
directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/MatchingRuleUseRegistryMonitorAdapter.java
directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/NameFormRegistryMonitorAdapter.java
directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/NormalizerRegistryMonitorAdapter.java
directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/ObjectClassRegistryMonitorAdapter.java
directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/OidRegistryMonitorAdapter.java
directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/SerializableComparator.java
directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/SyntaxCheckerRegistryMonitorAdapter.java
directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/SyntaxRegistryMonitorAdapter.java
directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/BootstrapSchemaLoader.java
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/AbstractTestCase.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/AbstractTestCase.java?rev=280870&r1=280869&r2=280870&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/AbstractTestCase.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/AbstractTestCase.java Wed Sep 14 07:56:35 2005
@@ -156,8 +156,6 @@
}
catch ( NamingException e )
{
- e.printStackTrace();
-
throw new NestableRuntimeException( e );
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/authn/AuthenticationService.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/authn/AuthenticationService.java?rev=280870&r1=280869&r2=280870&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/authn/AuthenticationService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/authn/AuthenticationService.java Wed Sep 14 07:56:35 2005
@@ -153,7 +153,7 @@
}
catch( Throwable t )
{
- t.printStackTrace();
+ log.warn( "Failed to destroy an authenticator.", t );
}
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/enumeration/SearchResultFilteringEnumeration.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/enumeration/SearchResultFilteringEnumeration.java?rev=280870&r1=280869&r2=280870&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/enumeration/SearchResultFilteringEnumeration.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/enumeration/SearchResultFilteringEnumeration.java Wed Sep 14 07:56:35 2005
@@ -27,6 +27,9 @@
import javax.naming.directory.SearchResult;
import javax.naming.ldap.LdapContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* A enumeration decorator which filters database search results as they are
@@ -38,6 +41,8 @@
*/
public class SearchResultFilteringEnumeration implements NamingEnumeration
{
+ private static final Logger log = LoggerFactory.getLogger( SearchResultFilteringEnumeration.class );
+
/** the list of filters to be applied */
private final List filters;
/** the underlying decorated enumeration */
@@ -212,7 +217,7 @@
}
catch ( NamingException e )
{
- e.printStackTrace();
+ throw new RuntimeException( "Failed to prefetch.", e );
}
return retVal;
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/interceptor/InterceptorChain.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/interceptor/InterceptorChain.java?rev=280870&r1=280869&r2=280870&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/interceptor/InterceptorChain.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/interceptor/InterceptorChain.java Wed Sep 14 07:56:35 2005
@@ -38,6 +38,8 @@
import org.apache.ldap.server.configuration.MutableInterceptorConfiguration;
import org.apache.ldap.server.jndi.ContextFactoryConfiguration;
import org.apache.ldap.server.partition.ContextPartitionNexus;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
@@ -48,6 +50,8 @@
*/
public class InterceptorChain
{
+ private static final Logger log = LoggerFactory.getLogger( InterceptorChain.class );
+
private final Interceptor FINAL_INTERCEPTOR = new Interceptor()
{
private ContextPartitionNexus nexus;
@@ -264,7 +268,8 @@
}
catch ( Throwable t )
{
- t.printStackTrace();
+ log.warn( "Failed to deregister an interceptor: " +
+ e.configuration.getName(), t );
}
}
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/DefaultContextFactoryService.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/DefaultContextFactoryService.java?rev=280870&r1=280869&r2=280870&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/DefaultContextFactoryService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/DefaultContextFactoryService.java Wed Sep 14 07:56:35 2005
@@ -29,9 +29,9 @@
import org.apache.ldap.common.exception.LdapAuthenticationNotSupportedException;
import org.apache.ldap.common.exception.LdapConfigurationException;
import org.apache.ldap.common.exception.LdapNoPermissionException;
+import org.apache.ldap.common.message.LockableAttributeImpl;
import org.apache.ldap.common.message.LockableAttributesImpl;
import org.apache.ldap.common.message.ResultCodeEnum;
-import org.apache.ldap.common.message.LockableAttributeImpl;
import org.apache.ldap.common.name.DnParser;
import org.apache.ldap.common.name.LdapName;
import org.apache.ldap.common.name.NameComponentNormalizer;
@@ -47,6 +47,8 @@
import org.apache.ldap.server.schema.GlobalRegistries;
import org.apache.ldap.server.schema.bootstrap.BootstrapRegistries;
import org.apache.ldap.server.schema.bootstrap.BootstrapSchemaLoader;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
@@ -57,6 +59,8 @@
*/
class DefaultContextFactoryService extends ContextFactoryService
{
+ private static final Logger log = LoggerFactory.getLogger( DefaultContextFactoryService.class );
+
private final String instanceId;
private final ContextFactoryConfiguration configuration = new DefaultContextFactoryConfiguration( this );
@@ -111,10 +115,12 @@
}
catch( NamingException e )
{
- e.printStackTrace();
+ log.warn(
+ "Failed to shut down ContextFactoryService: " +
+ DefaultContextFactoryService.this.instanceId, e );
}
}
- }, "ApacheDS Shutdown Hook" ) );
+ }, "ApacheDS Shutdown Hook (" + instanceId + ')' ) );
}
// ------------------------------------------------------------------------
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/partition/DefaultContextPartitionNexus.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/partition/DefaultContextPartitionNexus.java?rev=280870&r1=280869&r2=280870&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/partition/DefaultContextPartitionNexus.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/partition/DefaultContextPartitionNexus.java Wed Sep 14 07:56:35 2005
@@ -56,6 +56,8 @@
import org.apache.ldap.server.configuration.MutableContextPartitionConfiguration;
import org.apache.ldap.server.jndi.ContextFactoryConfiguration;
import org.apache.ldap.server.partition.impl.btree.jdbm.JdbmContextPartition;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
@@ -67,6 +69,8 @@
*/
public class DefaultContextPartitionNexus extends ContextPartitionNexus
{
+ private static final Logger log = LoggerFactory.getLogger( DefaultContextPartitionNexus.class );
+
/** the vendorName string proudly set to: Apache Software Foundation*/
private static final String ASF = "Apache Software Foundation";
@@ -146,9 +150,8 @@
this.factoryCfg = factoryCfg;
- List initializedPartitions = new ArrayList();
- initializeSystemPartition();
- initializedPartitions.add( system );
+ List initializedPartitionCfgs = new ArrayList();
+ initializedPartitionCfgs.add( initializeSystemPartition() );
Iterator i = factoryCfg.getStartupConfiguration().getContextPartitionConfigurations().iterator();
try
@@ -157,7 +160,7 @@
{
ContextPartitionConfiguration c = ( ContextPartitionConfiguration ) i.next();
addContextPartition( c );
- initializedPartitions.add( 0, c.getContextPartition() );
+ initializedPartitionCfgs.add( 0, c );
}
initialized = true;
}
@@ -165,10 +168,12 @@
{
if( !initialized )
{
- i = initializedPartitions.iterator();
+ i = initializedPartitionCfgs.iterator();
while( i.hasNext() )
{
- ContextPartition partition = ( ContextPartition ) i.next();
+ ContextPartitionConfiguration partitionCfg =
+ ( ContextPartitionConfiguration ) i.next();
+ ContextPartition partition = partitionCfg.getContextPartition();
i.remove();
try
{
@@ -176,7 +181,9 @@
}
catch( Exception e )
{
- e.printStackTrace();
+ log.warn(
+ "Failed to destroy a partition: " +
+ partitionCfg.getSuffix(), e );
}
finally
{
@@ -188,7 +195,7 @@
}
- private void initializeSystemPartition() throws NamingException
+ private ContextPartitionConfiguration initializeSystemPartition() throws NamingException
{
// initialize system partition first
MutableContextPartitionConfiguration systemCfg = new MutableContextPartitionConfiguration();
@@ -231,6 +238,8 @@
Attribute namingContexts = rootDSE.get( NAMINGCTXS_ATTR );
namingContexts.add( system.getSuffix( false ).toString() );
+
+ return systemCfg;
}
@@ -247,8 +256,6 @@
return;
}
- MultiException error = null;
-
Iterator suffixes = new HashSet( this.partitions.keySet() ).iterator();
// make sure this loop is not fail fast so all backing stores can
@@ -262,29 +269,11 @@
}
catch ( NamingException e )
{
- e.printStackTrace();
-
- if ( error == null )
- {
- error = new MultiException( "Grouping many exceptions on root nexus close()" );
- }
-
- // @todo really need to send this info to a monitor
- error.addThrowable( e );
+ log.warn( "Failed to destroy a partition: " + suffix, e );
}
}
initialized = false;
-
- if ( error != null )
- {
- String msg = "Encountered failures while performing a close() operation on backing stores";
-
- NamingException total = new NamingException( msg );
-
- total.setRootCause( error );
- total.printStackTrace();
- }
}
@@ -299,15 +288,15 @@
while ( list.hasNext() )
{
- ContextPartition store = ( ContextPartition ) list.next();
+ ContextPartition partition = ( ContextPartition ) list.next();
try
{
- store.sync();
+ partition.sync();
}
catch ( NamingException e )
{
- e.printStackTrace();
+ log.warn( "Failed to flush partition data out.", e );
if ( error == null )
{
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/partition/impl/btree/gui/ASTNode.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/partition/impl/btree/gui/ASTNode.java?rev=280870&r1=280869&r2=280870&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/partition/impl/btree/gui/ASTNode.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/partition/impl/btree/gui/ASTNode.java Wed Sep 14 07:56:35 2005
@@ -25,6 +25,8 @@
import org.apache.ldap.common.filter.BranchNode;
import org.apache.ldap.common.filter.ExprNode;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
@@ -35,6 +37,8 @@
*/
public class ASTNode implements TreeNode
{
+ private static final Logger log = LoggerFactory.getLogger( ASTNode.class );
+
private final ASTNode parent;
private final ExprNode exprNode;
private final ArrayList children;
@@ -71,7 +75,8 @@
}
catch( Exception e )
{
- e.printStackTrace();
+ // FIXME What exception could be thrown here?
+ log.warn( "Unexpected exception: parent=" + parent + ", exprNode=" + exprNode, e );
}
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/partition/impl/btree/jdbm/JdbmContextPartition.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/partition/impl/btree/jdbm/JdbmContextPartition.java?rev=280870&r1=280869&r2=280870&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/partition/impl/btree/jdbm/JdbmContextPartition.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/partition/impl/btree/jdbm/JdbmContextPartition.java Wed Sep 14 07:56:35 2005
@@ -38,12 +38,11 @@
import jdbm.recman.BaseRecordManager;
import jdbm.recman.CacheRecordManager;
-import org.apache.ldap.common.MultiException;
import org.apache.ldap.common.exception.LdapNameNotFoundException;
import org.apache.ldap.common.exception.LdapSchemaViolationException;
+import org.apache.ldap.common.message.LockableAttributeImpl;
import org.apache.ldap.common.message.LockableAttributesImpl;
import org.apache.ldap.common.message.ResultCodeEnum;
-import org.apache.ldap.common.message.LockableAttributeImpl;
import org.apache.ldap.common.name.LdapName;
import org.apache.ldap.common.schema.AttributeType;
import org.apache.ldap.common.schema.Normalizer;
@@ -57,6 +56,8 @@
import org.apache.ldap.server.partition.impl.btree.IndexAssertionEnumeration;
import org.apache.ldap.server.partition.impl.btree.IndexNotFoundException;
import org.apache.ldap.server.partition.impl.btree.IndexRecord;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
@@ -68,6 +69,8 @@
*/
public class JdbmContextPartition extends BTreeContextPartition
{
+ private static final Logger log = LoggerFactory.getLogger( JdbmContextPartition.class );
+
/** the JDBM record manager used by this database */
private RecordManager recMan;
/** the user provided suffix of this backend database */
@@ -197,7 +200,6 @@
}
Iterator list = array.iterator();
- MultiException rootCause = null;
while ( list.hasNext() )
{
@@ -209,12 +211,7 @@
}
catch ( Throwable t )
{
- if ( null == rootCause )
- {
- rootCause = new MultiException();
- }
-
- rootCause.addThrowable( t );
+ log.error( "Failed to close an index.", t );
}
}
@@ -224,12 +221,7 @@
}
catch ( Throwable t )
{
- if ( null == rootCause )
- {
- rootCause = new MultiException();
- }
-
- rootCause.addThrowable( t );
+ log.error( "Failed to close the master.", t );
}
try
@@ -238,22 +230,10 @@
}
catch ( Throwable t )
{
- if ( null == rootCause )
- {
- rootCause = new MultiException();
- }
-
- rootCause.addThrowable( t );
+ log.error( "Failed to close the record manager", t );
}
initialized = false;
-
- if ( null != rootCause )
- {
- NamingException ne = new NamingException( "Failed to close all" );
- ne.setRootCause( rootCause );
- ne.printStackTrace();
- }
}
@@ -281,50 +261,25 @@
array.add( existanceIdx );
Iterator list = array.iterator();
- MultiException rootCause = null;
// Sync all user defined indices
while ( list.hasNext() )
{
Index idx = ( Index ) list.next();
- try
- {
- idx.sync();
- }
- catch ( Throwable t )
- {
- t.printStackTrace();
- if ( null == rootCause )
- {
- rootCause = new MultiException();
- }
-
- rootCause.addThrowable( t );
- }
+ idx.sync();
}
+ master.sync();
+
try
{
- master.sync();
recMan.commit();
}
catch ( Throwable t )
{
- t.printStackTrace();
- if ( null == rootCause )
- {
- rootCause = new MultiException();
- }
-
- rootCause.addThrowable( t );
- }
-
- if ( null != rootCause )
- {
- NamingException ne = new NamingException( "Failed to sync all" );
- ne.setRootCause( rootCause );
- throw ne;
+ throw ( NamingException ) new NamingException(
+ "Failed to commit changes to the record manager." ).initCause( t );
}
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/AttributeTypeRegistryMonitorAdapter.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/AttributeTypeRegistryMonitorAdapter.java?rev=280870&r1=280869&r2=280870&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/AttributeTypeRegistryMonitorAdapter.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/AttributeTypeRegistryMonitorAdapter.java Wed Sep 14 07:56:35 2005
@@ -18,6 +18,8 @@
import org.apache.ldap.common.schema.AttributeType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
@@ -30,6 +32,8 @@
public class AttributeTypeRegistryMonitorAdapter
implements AttributeTypeRegistryMonitor
{
+ private static final Logger log = LoggerFactory.getLogger(AttributeTypeRegistryMonitorAdapter.class );
+
public void registered( AttributeType attributeType )
{
}
@@ -44,7 +48,7 @@
{
if ( fault != null )
{
- fault.printStackTrace();
+ log.warn( "Failed to look up the attribute type registry:" + oid, fault );
}
}
@@ -53,7 +57,7 @@
{
if ( fault != null )
{
- fault.printStackTrace();
+ log.warn( "Failed to register an attribute type to the attribute type registry: " + attributeType, fault );
}
}
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/ComparatorRegistryMonitorAdapter.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/ComparatorRegistryMonitorAdapter.java?rev=280870&r1=280869&r2=280870&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/ComparatorRegistryMonitorAdapter.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/ComparatorRegistryMonitorAdapter.java Wed Sep 14 07:56:35 2005
@@ -21,6 +21,9 @@
import javax.naming.NamingException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* An adapter for the ComparatorRegistry's monitor.
@@ -31,6 +34,8 @@
public class ComparatorRegistryMonitorAdapter
implements ComparatorRegistryMonitor
{
+ private static final Logger log = LoggerFactory.getLogger( ComparatorRegistryMonitorAdapter.class );
+
/* (non-Javadoc)
* @see org.apache.ldap.server.schema.ComparatorRegistryMonitor#registered(
* org.apache.eve.schema.Comparator)
@@ -57,7 +62,7 @@
{
if ( fault != null )
{
- fault.printStackTrace();
+ log.warn( "Failed to look up the comparator registry: " + oid, fault );
}
}
@@ -70,7 +75,7 @@
{
if ( fault != null )
{
- fault.printStackTrace();
+ log.warn( "Failed to register a comparator for oid '" + oid + "'.", fault );
}
}
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/DITContentRuleRegistryMonitorAdapter.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/DITContentRuleRegistryMonitorAdapter.java?rev=280870&r1=280869&r2=280870&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/DITContentRuleRegistryMonitorAdapter.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/DITContentRuleRegistryMonitorAdapter.java Wed Sep 14 07:56:35 2005
@@ -18,6 +18,8 @@
import org.apache.ldap.common.schema.DITContentRule;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
@@ -30,6 +32,8 @@
public class DITContentRuleRegistryMonitorAdapter
implements DITContentRuleRegistryMonitor
{
+ private static final Logger log = LoggerFactory.getLogger( DITContentRuleRegistryMonitorAdapter.class );
+
public void registered( DITContentRule dITContentRule )
{
}
@@ -44,16 +48,16 @@
{
if ( fault != null )
{
- fault.printStackTrace();
+ log.warn( "Failed to look up the DIT content rule: " + oid, fault );
}
}
- public void registerFailed( DITContentRule dITContentRule, Throwable fault )
+ public void registerFailed( DITContentRule ditContentRule, Throwable fault )
{
if ( fault != null )
{
- fault.printStackTrace();
+ log.warn( "Failed to register a DIT content rule: " + ditContentRule, fault );
}
}
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/DITStructureRuleRegistryMonitorAdapter.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/DITStructureRuleRegistryMonitorAdapter.java?rev=280870&r1=280869&r2=280870&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/DITStructureRuleRegistryMonitorAdapter.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/DITStructureRuleRegistryMonitorAdapter.java Wed Sep 14 07:56:35 2005
@@ -18,6 +18,8 @@
import org.apache.ldap.common.schema.DITStructureRule;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
@@ -30,6 +32,8 @@
public class DITStructureRuleRegistryMonitorAdapter
implements DITStructureRuleRegistryMonitor
{
+ private static final Logger log = LoggerFactory.getLogger( DITStructureRuleRegistryMonitorAdapter.class );
+
public void registered( DITStructureRule dITStructureRule )
{
}
@@ -44,16 +48,16 @@
{
if ( fault != null )
{
- fault.printStackTrace();
+ log.warn( "Failed to look up the DIT structure rule: " + oid, fault );
}
}
- public void registerFailed( DITStructureRule dITStructureRule, Throwable fault )
+ public void registerFailed( DITStructureRule ditStructureRule, Throwable fault )
{
if ( fault != null )
{
- fault.printStackTrace();
+ log.warn( "Failed to register a DIT structure rule: " + ditStructureRule, fault );
}
}
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/MatchingRuleRegistryMonitorAdapter.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/MatchingRuleRegistryMonitorAdapter.java?rev=280870&r1=280869&r2=280870&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/MatchingRuleRegistryMonitorAdapter.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/MatchingRuleRegistryMonitorAdapter.java Wed Sep 14 07:56:35 2005
@@ -20,6 +20,8 @@
import javax.naming.NamingException;
import org.apache.ldap.common.schema.MatchingRule;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
@@ -31,6 +33,8 @@
public class MatchingRuleRegistryMonitorAdapter
implements MatchingRuleRegistryMonitor
{
+ private static final Logger log = LoggerFactory.getLogger( MatchingRuleRegistryMonitorAdapter.class );
+
/**
* @see org.apache.ldap.server.schema.MatchingRuleRegistryMonitor#registered(
* org.apache.ldap.common.schema.MatchingRule)
@@ -57,7 +61,7 @@
{
if ( fault != null )
{
- fault.printStackTrace();
+ log.warn( "Failed to look up the matching rule: " + oid, fault );
}
}
@@ -70,7 +74,7 @@
{
if ( fault != null )
{
- fault.printStackTrace();
+ log.warn( "Failed to register a matching rule: " + rule, fault );
}
}
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/MatchingRuleUseRegistryMonitorAdapter.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/MatchingRuleUseRegistryMonitorAdapter.java?rev=280870&r1=280869&r2=280870&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/MatchingRuleUseRegistryMonitorAdapter.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/MatchingRuleUseRegistryMonitorAdapter.java Wed Sep 14 07:56:35 2005
@@ -18,6 +18,8 @@
import org.apache.ldap.common.schema.MatchingRuleUse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
@@ -30,6 +32,8 @@
public class MatchingRuleUseRegistryMonitorAdapter
implements MatchingRuleUseRegistryMonitor
{
+ private static final Logger log = LoggerFactory.getLogger( MatchingRuleUseRegistryMonitorAdapter.class );
+
public void registered( MatchingRuleUse matchingRuleUse )
{
}
@@ -44,7 +48,7 @@
{
if ( fault != null )
{
- fault.printStackTrace();
+ log.warn( "Failed to look up the matching rule use: " + oid, fault );
}
}
@@ -53,7 +57,7 @@
{
if ( fault != null )
{
- fault.printStackTrace();
+ log.warn( "Failed to register a matching rule use: " + matchingRuleUse, fault );
}
}
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/NameFormRegistryMonitorAdapter.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/NameFormRegistryMonitorAdapter.java?rev=280870&r1=280869&r2=280870&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/NameFormRegistryMonitorAdapter.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/NameFormRegistryMonitorAdapter.java Wed Sep 14 07:56:35 2005
@@ -18,6 +18,8 @@
import org.apache.ldap.common.schema.NameForm;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
@@ -29,6 +31,8 @@
*/
public class NameFormRegistryMonitorAdapter implements NameFormRegistryMonitor
{
+ private static final Logger log = LoggerFactory.getLogger( NameFormRegistryMonitorAdapter.class );
+
public void registered( NameForm nameForm )
{
}
@@ -43,7 +47,7 @@
{
if ( fault != null )
{
- fault.printStackTrace();
+ log.warn( "Failed to lokk up the name form: " + oid, fault );
}
}
@@ -52,7 +56,7 @@
{
if ( fault != null )
{
- fault.printStackTrace();
+ log.warn( "Failed to register a name form: " + nameForm, fault );
}
}
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/NormalizerRegistryMonitorAdapter.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/NormalizerRegistryMonitorAdapter.java?rev=280870&r1=280869&r2=280870&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/NormalizerRegistryMonitorAdapter.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/NormalizerRegistryMonitorAdapter.java Wed Sep 14 07:56:35 2005
@@ -20,6 +20,8 @@
import javax.naming.NamingException;
import org.apache.ldap.common.schema.Normalizer;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
@@ -31,6 +33,8 @@
public class NormalizerRegistryMonitorAdapter
implements NormalizerRegistryMonitor
{
+ private static final Logger log = LoggerFactory.getLogger( NormalizerRegistryMonitorAdapter.class );
+
/* (non-Javadoc)
* @see org.apache.ldap.server.schema.NormalizerRegistryMonitor#registered(
* org.apache.eve.schema.Normalizer)
@@ -57,7 +61,7 @@
{
if ( fault != null )
{
- fault.printStackTrace();
+ log.warn( "Failed to look up the normalizer: " + oid , fault );
}
}
@@ -70,7 +74,7 @@
{
if ( fault != null )
{
- fault.printStackTrace();
+ log.warn( "Failed to register a normalizer: " + oid, fault );
}
}
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/ObjectClassRegistryMonitorAdapter.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/ObjectClassRegistryMonitorAdapter.java?rev=280870&r1=280869&r2=280870&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/ObjectClassRegistryMonitorAdapter.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/ObjectClassRegistryMonitorAdapter.java Wed Sep 14 07:56:35 2005
@@ -18,6 +18,8 @@
import org.apache.ldap.common.schema.ObjectClass;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
@@ -29,6 +31,8 @@
*/
public class ObjectClassRegistryMonitorAdapter implements ObjectClassRegistryMonitor
{
+ private static final Logger log = LoggerFactory.getLogger( ObjectClassRegistryMonitorAdapter.class );
+
public void registered( ObjectClass objectClass )
{
}
@@ -43,7 +47,7 @@
{
if ( fault != null )
{
- fault.printStackTrace();
+ log.warn( "Failed to look up the object class: " + oid, fault );
}
}
@@ -52,7 +56,7 @@
{
if ( fault != null )
{
- fault.printStackTrace();
+ log.warn( "Failed to register an object class: " + objectClass, fault );
}
}
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/OidRegistryMonitorAdapter.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/OidRegistryMonitorAdapter.java?rev=280870&r1=280869&r2=280870&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/OidRegistryMonitorAdapter.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/OidRegistryMonitorAdapter.java Wed Sep 14 07:56:35 2005
@@ -20,6 +20,9 @@
import javax.naming.NamingException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* An adapter for an OidRegistryMonitor.
@@ -29,6 +32,7 @@
*/
public class OidRegistryMonitorAdapter implements OidRegistryMonitor
{
+ private static final Logger log = LoggerFactory.getLogger( OidRegistryMonitorAdapter.class );
/* (non-Javadoc)
* @see org.apache.ldap.server.schema.OidRegistryMonitor#getOidWithOid(
@@ -65,7 +69,7 @@
{
if ( fault != null )
{
- fault.printStackTrace();
+ log.warn( "Failed to resolve OID: " + name, fault );
}
}
@@ -78,7 +82,7 @@
{
if ( fault != null )
{
- fault.printStackTrace();
+ log.warn( "OID doesn't exist: " + oid, fault );
}
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/SerializableComparator.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/SerializableComparator.java?rev=280870&r1=280869&r2=280870&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/SerializableComparator.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/SerializableComparator.java Wed Sep 14 07:56:35 2005
@@ -88,7 +88,7 @@
}
catch ( NamingException e )
{
- e.printStackTrace();
+ throw new RuntimeException( "Matching rule not found: " + matchingRuleOid );
}
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/SyntaxCheckerRegistryMonitorAdapter.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/SyntaxCheckerRegistryMonitorAdapter.java?rev=280870&r1=280869&r2=280870&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/SyntaxCheckerRegistryMonitorAdapter.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/SyntaxCheckerRegistryMonitorAdapter.java Wed Sep 14 07:56:35 2005
@@ -20,6 +20,8 @@
import javax.naming.NamingException;
import org.apache.ldap.common.schema.SyntaxChecker;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
@@ -31,6 +33,8 @@
public class SyntaxCheckerRegistryMonitorAdapter
implements SyntaxCheckerRegistryMonitor
{
+ private static final Logger log = LoggerFactory.getLogger( SyntaxCheckerRegistryMonitorAdapter.class );
+
/* (non-Javadoc)
* @see org.apache.ldap.server.schema.SyntaxCheckerRegistryMonitor#registered(
* org.apache.eve.schema.SyntaxChecker)
@@ -57,7 +61,7 @@
{
if ( fault != null )
{
- fault.printStackTrace();
+ log.warn( "Failed to look up the syntax checker: " + oid, fault );
}
}
@@ -71,7 +75,7 @@
{
if ( fault != null )
{
- fault.printStackTrace();
+ log.warn( "Failed to register a syntax checker: " + oid, fault );
}
}
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/SyntaxRegistryMonitorAdapter.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/SyntaxRegistryMonitorAdapter.java?rev=280870&r1=280869&r2=280870&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/SyntaxRegistryMonitorAdapter.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/SyntaxRegistryMonitorAdapter.java Wed Sep 14 07:56:35 2005
@@ -20,6 +20,8 @@
import javax.naming.NamingException;
import org.apache.ldap.common.schema.Syntax;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
@@ -30,6 +32,8 @@
*/
public class SyntaxRegistryMonitorAdapter implements SyntaxRegistryMonitor
{
+ private static final Logger log = LoggerFactory.getLogger( SyntaxRegistryMonitorAdapter.class );
+
/* (non-Javadoc)
* @see org.apache.ldap.server.schema.SyntaxRegistryMonitor#registered(
* org.apache.eve.schema.Syntax)
@@ -56,7 +60,7 @@
{
if ( fault != null )
{
- fault.printStackTrace();
+ log.warn( "Failed to look up the syntax: " + oid, fault );
}
}
@@ -69,7 +73,7 @@
{
if ( fault != null )
{
- fault.printStackTrace();
+ log.warn( "Failed to register a syntax: " + syntax, fault );
}
}
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/BootstrapSchemaLoader.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/BootstrapSchemaLoader.java?rev=280870&r1=280869&r2=280870&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/BootstrapSchemaLoader.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/BootstrapSchemaLoader.java Wed Sep 14 07:56:35 2005
@@ -51,6 +51,8 @@
import org.apache.ldap.server.schema.StateFactoryRegistry;
import org.apache.ldap.server.schema.SyntaxCheckerRegistry;
import org.apache.ldap.server.schema.SyntaxRegistry;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
@@ -61,6 +63,8 @@
*/
public class BootstrapSchemaLoader
{
+ private static final Logger log = LoggerFactory.getLogger( BootstrapSchemaLoader.class );
+
/** stores schemas of producers for callback access */
private ThreadLocal schemas;
/** stores registries associated with producers for callback access */
@@ -341,8 +345,7 @@
catch ( ClassNotFoundException e )
{
failedTargetLoad = true;
- // @todo instead of trace report target class load failure to monitor
- e.printStackTrace();
+ log.debug( "Failed to load '" + targetClassName + "'. Trying the alternative.", e );
}
if ( failedTargetLoad )