directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r752674 - in /directory/daemon/trunk/bootstrappers/src/main/java/org/apache/directory/daemon: AvailablePortFinder.java TanukiBootstrapper.java
Date Wed, 11 Mar 2009 22:47:26 GMT
Author: akarasulu
Date: Wed Mar 11 22:47:26 2009
New Revision: 752674

URL: http://svn.apache.org/viewvc?rev=752674&view=rev
Log:
more minor cleanup in bootstrapper

Modified:
    directory/daemon/trunk/bootstrappers/src/main/java/org/apache/directory/daemon/AvailablePortFinder.java
    directory/daemon/trunk/bootstrappers/src/main/java/org/apache/directory/daemon/TanukiBootstrapper.java

Modified: directory/daemon/trunk/bootstrappers/src/main/java/org/apache/directory/daemon/AvailablePortFinder.java
URL: http://svn.apache.org/viewvc/directory/daemon/trunk/bootstrappers/src/main/java/org/apache/directory/daemon/AvailablePortFinder.java?rev=752674&r1=752673&r2=752674&view=diff
==============================================================================
--- directory/daemon/trunk/bootstrappers/src/main/java/org/apache/directory/daemon/AvailablePortFinder.java
(original)
+++ directory/daemon/trunk/bootstrappers/src/main/java/org/apache/directory/daemon/AvailablePortFinder.java
Wed Mar 11 22:47:26 2009
@@ -63,7 +63,7 @@
      *
      * WARNING: this can take a very long time.
      */
-    public static Set getAvailablePorts()
+    public static Set<Integer> getAvailablePorts()
     {
         return getAvailablePorts( MIN_PORT_NUMBER, MAX_PORT_NUMBER );
     }
@@ -162,7 +162,7 @@
      * {@link #MIN_PORT_NUMBER} and {@link #MAX_PORT_NUMBER} or
      * <code>fromPort</code> if greater than <code>toPort</code>.
      */
-    public static Set getAvailablePorts( int fromPort, int toPort )
+    public static Set<Integer> getAvailablePorts( int fromPort, int toPort )
     {
         if ( ( fromPort < MIN_PORT_NUMBER ) || ( toPort > MAX_PORT_NUMBER ) || ( fromPort
> toPort ) )
         {

Modified: directory/daemon/trunk/bootstrappers/src/main/java/org/apache/directory/daemon/TanukiBootstrapper.java
URL: http://svn.apache.org/viewvc/directory/daemon/trunk/bootstrappers/src/main/java/org/apache/directory/daemon/TanukiBootstrapper.java?rev=752674&r1=752673&r2=752674&view=diff
==============================================================================
--- directory/daemon/trunk/bootstrappers/src/main/java/org/apache/directory/daemon/TanukiBootstrapper.java
(original)
+++ directory/daemon/trunk/bootstrappers/src/main/java/org/apache/directory/daemon/TanukiBootstrapper.java
Wed Mar 11 22:47:26 2009
@@ -17,7 +17,6 @@
  *  under the License.
  *
  */
-
 package org.apache.directory.daemon;
 
 import org.slf4j.Logger;
@@ -25,6 +24,7 @@
 import org.tanukisoftware.wrapper.WrapperListener;
 import org.tanukisoftware.wrapper.WrapperManager;
 
+
 /**
  * The bootstrapper used by Tanuki Wrapper.
  *
@@ -40,12 +40,15 @@
     {
     }
 
+    
     public static void main( String[] args )
     {
         WrapperManager.start( new TanukiBootstrapper(), args );
     }
 
-    public Integer start(String[] args) {
+    
+    public Integer start( String[] args ) 
+    {
         setInstallationLayout( args[0] );
         setParentLoader( Thread.currentThread().getContextClassLoader() );
         callInit( shift( args, 1 ) );
@@ -53,7 +56,9 @@
         return null;
     }
 
-    public int stop(int exitCode) {
+    
+    public int stop( int exitCode ) 
+    {
         log.info( "Attempting graceful shutdown of this server instance" );
 
         callStop( EMPTY_STRARRAY );
@@ -64,19 +69,23 @@
         return exitCode;
     }
 
-    public void controlEvent(int event) {
-        log.error("Recvd Event: " + event);
-        if (WrapperManager.isControlledByNativeWrapper()) {
+    
+    public void controlEvent( int event ) 
+    {
+        log.error( "Recvd Event: " + event );
+        if ( WrapperManager.isControlledByNativeWrapper() ) 
+        {
             // The Wrapper will take care of this event
-        } else {
+        } 
+        else 
+        {
             // We are not being controlled by the Wrapper, so
             //  handle the event ourselves.
-            if ((event == WrapperManager.WRAPPER_CTRL_C_EVENT) ||
-                    (event == WrapperManager.WRAPPER_CTRL_CLOSE_EVENT) ||
-                    (event == WrapperManager.WRAPPER_CTRL_SHUTDOWN_EVENT)){
-                WrapperManager.stop(0);
+            if ( ( event == WrapperManager.WRAPPER_CTRL_C_EVENT ) ||
+                 ( event == WrapperManager.WRAPPER_CTRL_CLOSE_EVENT ) ||
+                 ( event == WrapperManager.WRAPPER_CTRL_SHUTDOWN_EVENT ) ) {
+                WrapperManager.stop( 0 );
             }
         }
     }
-
 }



Mime
View raw message