incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r940755 - /sling/trunk/bundles/jcr/jackrabbit-server/src/main/java/org/apache/sling/jcr/jackrabbit/server/impl/RmiRegistrationSupport.java
Date Tue, 04 May 2010 07:13:56 GMT
Author: fmeschbe
Date: Tue May  4 07:13:56 2010
New Revision: 940755

URL: http://svn.apache.org/viewvc?rev=940755&view=rev
Log:
SLING-1507 Allow the RMI port number property to be specified as a string (as in FileInstall
provided configurations)

Modified:
    sling/trunk/bundles/jcr/jackrabbit-server/src/main/java/org/apache/sling/jcr/jackrabbit/server/impl/RmiRegistrationSupport.java

Modified: sling/trunk/bundles/jcr/jackrabbit-server/src/main/java/org/apache/sling/jcr/jackrabbit/server/impl/RmiRegistrationSupport.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/jackrabbit-server/src/main/java/org/apache/sling/jcr/jackrabbit/server/impl/RmiRegistrationSupport.java?rev=940755&r1=940754&r2=940755&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/jackrabbit-server/src/main/java/org/apache/sling/jcr/jackrabbit/server/impl/RmiRegistrationSupport.java
(original)
+++ sling/trunk/bundles/jcr/jackrabbit-server/src/main/java/org/apache/sling/jcr/jackrabbit/server/impl/RmiRegistrationSupport.java
Tue May  4 07:13:56 2010
@@ -76,9 +76,15 @@ public class RmiRegistrationSupport exte
 
         Object portProp = this.getComponentContext().getProperties().get(
             PROP_REGISTRY_PORT);
-        this.registryPort = (portProp instanceof Number)
-                ? ((Number) portProp).intValue()
-                : 0;
+        if (portProp instanceof Number) {
+            this.registryPort = ((Number) portProp).intValue();
+        } else {
+            try {
+                this.registryPort = Integer.parseInt(String.valueOf(portProp));
+            } catch (NumberFormatException nfe) {
+                this.registryPort = 0;
+            }
+        }
 
         // ensure correct value
         if (this.registryPort < 0) {



Mime
View raw message