You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by er...@apache.org on 2005/09/08 00:30:17 UTC

svn commit: r279444 - in /directory/standalone/trunk/osgi/ntp: project.xml src/main/java/org/apache/ntp/NtpConfig.java src/main/java/org/apache/ntp/NtpServerFactory.java

Author: erodriguez
Date: Wed Sep  7 15:30:13 2005
New Revision: 279444

URL: http://svn.apache.org/viewcvs?rev=279444&view=rev
Log:
Updates to NTP OSGi bundle:
o  moved servicebinder dep to parent POM
o  minor refactoring

Modified:
    directory/standalone/trunk/osgi/ntp/project.xml
    directory/standalone/trunk/osgi/ntp/src/main/java/org/apache/ntp/NtpConfig.java
    directory/standalone/trunk/osgi/ntp/src/main/java/org/apache/ntp/NtpServerFactory.java

Modified: directory/standalone/trunk/osgi/ntp/project.xml
URL: http://svn.apache.org/viewcvs/directory/standalone/trunk/osgi/ntp/project.xml?rev=279444&r1=279443&r2=279444&view=diff
==============================================================================
--- directory/standalone/trunk/osgi/ntp/project.xml (original)
+++ directory/standalone/trunk/osgi/ntp/project.xml Wed Sep  7 15:30:13 2005
@@ -21,10 +21,5 @@
         <osgi.jar.bundle>true</osgi.jar.bundle>
       </properties>
     </dependency>
-    <dependency>
-      <groupId>org.ungoverned</groupId>
-      <artifactId>servicebinder</artifactId>
-      <version>1.1.2</version>
-    </dependency>
   </dependencies>
 </project>

Modified: directory/standalone/trunk/osgi/ntp/src/main/java/org/apache/ntp/NtpConfig.java
URL: http://svn.apache.org/viewcvs/directory/standalone/trunk/osgi/ntp/src/main/java/org/apache/ntp/NtpConfig.java?rev=279444&r1=279443&r2=279444&view=diff
==============================================================================
--- directory/standalone/trunk/osgi/ntp/src/main/java/org/apache/ntp/NtpConfig.java (original)
+++ directory/standalone/trunk/osgi/ntp/src/main/java/org/apache/ntp/NtpConfig.java Wed Sep  7 15:30:13 2005
@@ -43,7 +43,7 @@
 
         if ( port < 1 || port > 0xFFFF )
         {
-            throw new ConfigurationException( NtpConfig.NTP_PORT_KEY, "invalid value=" + port );
+            throw new ConfigurationException( NTP_PORT_KEY, "invalid value=" + port );
         }
     }
 

Modified: directory/standalone/trunk/osgi/ntp/src/main/java/org/apache/ntp/NtpServerFactory.java
URL: http://svn.apache.org/viewcvs/directory/standalone/trunk/osgi/ntp/src/main/java/org/apache/ntp/NtpServerFactory.java?rev=279444&r1=279443&r2=279444&view=diff
==============================================================================
--- directory/standalone/trunk/osgi/ntp/src/main/java/org/apache/ntp/NtpServerFactory.java (original)
+++ directory/standalone/trunk/osgi/ntp/src/main/java/org/apache/ntp/NtpServerFactory.java Wed Sep  7 15:30:13 2005
@@ -67,15 +67,8 @@
             NtpServer ntpServer = (NtpServer) servers.get( pid );
 
             // If we don't have the service, create it with the config.
-            if ( ntpServer == null )
-            {
-                ntpServer = new NtpServer( ntpConfig, registry );
-                servers.put( pid, ntpServer );
-                return;
-            }
-
-            // If we do have the service, re-create it if the config is different.
-            if ( ntpServer.isDifferent( config ) )
+            // Or, if we do have the service, re-create it if the config is different.
+            if ( ntpServer == null || ntpServer.isDifferent( config ) )
             {
                 deleted( pid );
                 ntpServer = new NtpServer( ntpConfig, registry );