You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsrf-commits@ws.apache.org by sc...@apache.org on 2005/07/07 19:15:19 UTC
svn commit: r209616 -
/webservices/wsrf/trunk/src/java/org/apache/ws/util/jndi/XmlBeanJndiUtils.java
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 );
}