Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 98554 invoked from network); 2 May 2007 14:16:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 May 2007 14:16:01 -0000 Received: (qmail 94190 invoked by uid 500); 2 May 2007 14:16:02 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 94152 invoked by uid 500); 2 May 2007 14:16:01 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 94123 invoked by uid 99); 2 May 2007 14:16:01 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 May 2007 07:16:01 -0700 X-ASF-Spam-Status: No, hits=-98.6 required=10.0 tests=ALL_TRUSTED,INFO_TLD,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 May 2007 07:15:53 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 22D9E1A9838; Wed, 2 May 2007 07:15:33 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r534470 - /directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java Date: Wed, 02 May 2007 14:15:32 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070502141533.22D9E1A9838@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: elecharny Date: Wed May 2 07:15:32 2007 New Revision: 534470 URL: http://svn.apache.org/viewvc?view=rev&rev=534470 Log: Adding some newlines (minor refactoring) Modified: directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java Modified: directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java?view=diff&rev=534470&r1=534469&r2=534470 ============================================================================== --- directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java (original) +++ directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java Wed May 2 07:15:32 2007 @@ -87,6 +87,7 @@ */ public class ServerContextFactory extends CoreContextFactory { + /** Logger for this class */ private static final Logger log = LoggerFactory.getLogger( ServerContextFactory.class.getName() ); private static final String LDIF_FILES_DN = "ou=loadedLdifFiles,ou=configuration,ou=system"; @@ -105,7 +106,12 @@ private static NtpServer udpNtpServer; private DirectoryService directoryService; - + /** + * Initialize the SocketAcceptor so that the server can accept + * incomming requests. + * + * We will start N threads, spreaded on the available CPUs. + */ public void beforeStartup( DirectoryService service ) { int maxThreads = service.getConfiguration().getStartupConfiguration().getMaxThreads(); @@ -141,60 +147,72 @@ if ( tcpKdcServer != null ) { tcpKdcServer.destroy(); + if ( log.isInfoEnabled() ) { log.info( "Unbind of KRB5 Service (TCP) complete: " + tcpKdcServer ); } + tcpKdcServer = null; } if ( udpKdcServer != null ) { udpKdcServer.destroy(); + if ( log.isInfoEnabled() ) { log.info( "Unbind of KRB5 Service (UDP) complete: " + udpKdcServer ); } + udpKdcServer = null; } if ( tcpChangePasswordServer != null ) { tcpChangePasswordServer.destroy(); + if ( log.isInfoEnabled() ) { log.info( "Unbind of Change Password Service (TCP) complete: " + tcpChangePasswordServer ); } + tcpChangePasswordServer = null; } if ( udpChangePasswordServer != null ) { udpChangePasswordServer.destroy(); + if ( log.isInfoEnabled() ) { log.info( "Unbind of Change Password Service (UDP) complete: " + udpChangePasswordServer ); } + udpChangePasswordServer = null; } if ( tcpNtpServer != null ) { tcpNtpServer.destroy(); + if ( log.isInfoEnabled() ) { log.info( "Unbind of NTP Service (TCP) complete: " + tcpNtpServer ); } + tcpNtpServer = null; } if ( udpNtpServer != null ) { udpNtpServer.destroy(); + if ( log.isInfoEnabled() ) { log.info( "Unbind of NTP Service complete: " + udpNtpServer ); } + udpNtpServer = null; } } @@ -224,6 +242,7 @@ Attributes entry = new AttributesImpl( SchemaConstants.OU_AT, "loadedLdifFiles", true ); entry.put( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC ); entry.get( SchemaConstants.OBJECT_CLASS_AT ).add( SchemaConstants.ORGANIZATIONAL_UNIT_OC ); + try { root.createSubcontext( LDIF_FILES_DN, entry ); @@ -284,6 +303,7 @@ private String getCanonical( File file ) { String canonical = null; + try { canonical = file.getCanonicalPath(); @@ -395,6 +415,7 @@ { // Skip if disabled int port = cfg.getLdapPort(); + if ( port < 0 ) { return; @@ -419,6 +440,7 @@ // We use the reflection API in case this is not running on JDK 1.5+. IoFilterChainBuilder chain; + try { chain = ( IoFilterChainBuilder ) Class.forName( "org.apache.directory.server.ssl.LdapsInitializer", true, @@ -596,6 +618,7 @@ // is not bound - this is ok because the GracefulShutdown has already // sent notices to to the existing active sessions List sessions = null; + try { sessions = new ArrayList( tcpAcceptor.getManagedSessions( new InetSocketAddress( port ) ) ); @@ -607,6 +630,7 @@ } tcpAcceptor.unbind( new InetSocketAddress( port ) ); + if ( log.isInfoEnabled() ) { log.info( "Unbind of an LDAP service (" + port + ") is complete." ); @@ -625,6 +649,7 @@ // And close the connections when the NoDs are sent. Iterator sessionIt = sessions.iterator(); + for ( Iterator i = writeFutures.iterator(); i.hasNext(); ) { WriteFuture future = ( WriteFuture ) i.next();