ws-wsrf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sc...@apache.org
Subject svn commit: r209616 - /webservices/wsrf/trunk/src/java/org/apache/ws/util/jndi/XmlBeanJndiUtils.java
Date Thu, 07 Jul 2005 17:15:19 GMT
Author: scamp
Date: Thu Jul  7 10:15:17 2005
New Revision: 209616

URL: http://svn.apache.org/viewcvs?rev=209616&view=rev
Log:
Modified to only set the Apache JNDI info if BOTH context pkgs and factory return null from
System....Otherwise simply use what is provided....

Modified:
    webservices/wsrf/trunk/src/java/org/apache/ws/util/jndi/XmlBeanJndiUtils.java

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/util/jndi/XmlBeanJndiUtils.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/util/jndi/XmlBeanJndiUtils.java?rev=209616&r1=209615&r2=209616&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/util/jndi/XmlBeanJndiUtils.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/util/jndi/XmlBeanJndiUtils.java Thu Jul
 7 10:15:17 2005
@@ -104,30 +104,14 @@
       Context compContext = null;
 
       // set up naming
-      String value    = APACHE_URL_PKG_PREFIX;
-      String oldValue = System.getProperty( Context.URL_PKG_PREFIXES );
-      if ( oldValue != null )
-      {
-         if ( oldValue.startsWith( value + ":" ) )
-         {
-            value = oldValue;
-         }
-         else
-         {
-            value = value + ":" + oldValue;
-         }
-      }
-
-      System.setProperty( Context.URL_PKG_PREFIXES, value );
+      String apacheUrlPrefix    = APACHE_URL_PKG_PREFIX;
+      String systemUrlPrefix = System.getProperty( Context.URL_PKG_PREFIXES );
+      String systemContextFactory = System.getProperty( Context.INITIAL_CONTEXT_FACTORY );
 
-      value = System.getProperty( Context.INITIAL_CONTEXT_FACTORY );
-      if ( value == null )
-      {
-         System.setProperty( Context.INITIAL_CONTEXT_FACTORY, APACHE_INITIAL_CONTEXT_FACTORY
);
-      }
-      else
+      if(systemContextFactory == null && systemUrlPrefix == null)
       {
-         LOG.debug( "initialContextFactorySet " + value );
+          System.setProperty( Context.URL_PKG_PREFIXES, apacheUrlPrefix );
+          System.setProperty( Context.INITIAL_CONTEXT_FACTORY, APACHE_INITIAL_CONTEXT_FACTORY
);
       }
 
       result = new InitialContext(  );
@@ -142,7 +126,7 @@
          compContext = result.createSubcontext( JndiConstants.CONTEXT_NAME_BASE );
          LOG.debug("Creating SubContext: " + JndiConstants.CONTEXT_SERVICES_BASE);
          compContext.createSubcontext( JndiConstants.CONTEXT_SERVICES_BASE );
-          LOG.debug("Creating SubContext: " + JndiConstants.CONTEXT_GLOBAL_BASE);
+         LOG.debug("Creating SubContext: " + JndiConstants.CONTEXT_GLOBAL_BASE);
          compContext.createSubcontext( JndiConstants.CONTEXT_GLOBAL_BASE );
       }
 



Mime
View raw message