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 ip...@apache.org on 2005/07/27 20:33:21 UTC
svn commit: r225565 - in /webservices/wsrf/trunk/src/java/org/apache/ws:
resource/properties/query/impl/QueryEngineImpl.java
util/jndi/JNDIUtils.java util/jndi/XmlBeanJndiUtils.java
Author: ips
Date: Wed Jul 27 11:33:18 2005
New Revision: 225565
URL: http://svn.apache.org/viewcvs?rev=225565&view=rev
Log:
JNDI fix - 2nd attempt
Modified:
webservices/wsrf/trunk/src/java/org/apache/ws/resource/properties/query/impl/QueryEngineImpl.java
webservices/wsrf/trunk/src/java/org/apache/ws/util/jndi/JNDIUtils.java
webservices/wsrf/trunk/src/java/org/apache/ws/util/jndi/XmlBeanJndiUtils.java
Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/properties/query/impl/QueryEngineImpl.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/properties/query/impl/QueryEngineImpl.java?rev=225565&r1=225564&r2=225565&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/properties/query/impl/QueryEngineImpl.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/properties/query/impl/QueryEngineImpl.java Wed Jul 27 11:33:18 2005
@@ -31,7 +31,7 @@
import org.apache.ws.resource.properties.query.UnknownQueryExpressionDialectException;
import org.apache.ws.resource.properties.query.xpath.impl.XalanXPathExpressionEvaluator;
import org.apache.ws.util.i18n.Messages;
-import org.apache.ws.util.jndi.XmlBeanJndiUtils;
+import org.apache.ws.util.jndi.JNDIUtils;
import javax.naming.Context;
import javax.naming.InitialContext;
@@ -144,7 +144,7 @@
{
NameClassPair pair = (NameClassPair) list.next();
ExpressionEvaluator evaluator =
- (ExpressionEvaluator) XmlBeanJndiUtils.lookup( initialContext,
+ (ExpressionEvaluator) JNDIUtils.lookup( initialContext,
QUERY_EVALUATOR_CONTEXT + "/" + pair.getName(),
ExpressionEvaluator.class );
registerEvaluator( evaluator );
Modified: webservices/wsrf/trunk/src/java/org/apache/ws/util/jndi/JNDIUtils.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/util/jndi/JNDIUtils.java?rev=225565&r1=225564&r2=225565&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/util/jndi/JNDIUtils.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/util/jndi/JNDIUtils.java Wed Jul 27 11:33:18 2005
@@ -357,9 +357,10 @@
throw new IllegalArgumentException( "initial context was null." );
}
+ XmlBeanJndiUtils.
Context envContext = (Context) initContext.lookup( "java:comp/env" );
Digester digester = new Digester();
-
+
digester.setNamespaceAware( true );
digester.setValidating( false ); // Don't do any validation for now
digester.addRuleSet( new JNDIConfigRuleSet( "jndiConfig/" ) );
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=225565&r1=225564&r2=225565&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 Wed Jul 27 11:33:18 2005
@@ -18,6 +18,7 @@
import org.apache.axis.AxisEngine;
import org.apache.axis.components.logger.LogFactory;
import org.apache.commons.logging.Log;
+import org.apache.commons.digester.Digester;
import org.apache.ws.resource.JndiConstants;
import org.apache.ws.util.jndi.tools.ConfigContext;
import org.apache.ws.util.jndi.tools.Environment;
@@ -25,6 +26,7 @@
import org.apache.ws.util.jndi.tools.Resource;
import org.apache.ws.util.jndi.tools.ResourceLink;
import org.apache.ws.util.jndi.tools.ResourceParameters;
+import org.apache.ws.util.jndi.tools.JNDIConfigRuleSet;
import org.apache.wsfx.wsrf.jndi.config.EnvironmentDocument;
import org.apache.wsfx.wsrf.jndi.config.GlobalDocument;
import org.apache.wsfx.wsrf.jndi.config.JndiConfigDocument;
@@ -103,18 +105,18 @@
return new InitialContext();
}
- private static void initWsrfContext()
+ private static Context initWsrfContext()
throws NamingException
{
- LOG.debug("Initializing WSRF JNDI context...");
Context wsrfContext;
InitialContext initialContext = new InitialContext();
try
{
- wsrfContext = (Context) initialContext.lookup(JndiConstants.CONTEXT_NAME_SERVICES);
+ wsrfContext = (Context) initialContext.lookup(JndiConstants.CONTEXT_NAME_BASE);
}
catch (NameNotFoundException nnfe)
{
+ LOG.debug("Initializing WSRF JNDI context...");
LOG.debug("Creating JNDI subcontext: " + JndiConstants.CONTEXT_NAME_BASE + " ...");
wsrfContext = initialContext.createSubcontext(JndiConstants.CONTEXT_NAME_BASE);
LOG.debug("Creating JNDI subcontext: " + JndiConstants.CONTEXT_SERVICES_BASE + " ...");
@@ -122,6 +124,7 @@
LOG.debug("Creating JNDI subcontext: " + JndiConstants.CONTEXT_GLOBAL_BASE + " ...");
wsrfContext.createSubcontext(JndiConstants.CONTEXT_GLOBAL_BASE);
}
+ return wsrfContext;
}
private static void initJndiImpl()
@@ -649,19 +652,17 @@
throw new IllegalArgumentException( "initial context was null." );
}
- /*Context envContext = (Context) initContext.lookup( "java:comp/env" );
+ Context wsrfContext = initWsrfContext();
Digester digester = new Digester();
- // Don't do any validation for now
- // TODO: look into getting rid of this stuff!
-
+ // TODO: look into factoring out the use of Commons Digester (NOTE: it IS currently needed)
digester.setNamespaceAware( true );
- digester.setValidating( false );
+ digester.setValidating( false ); // don't do any validation for now
digester.addRuleSet( new JNDIConfigRuleSet( "jndiConfig/" ) );
- digester.push( new NamingContext( envContext, engine ) );
+ digester.push( new NamingContext( wsrfContext, engine ) );
digester.parse( configInput );
- digester.clear();*/
+ digester.clear();
}
}