You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by du...@apache.org on 2001/04/10 15:28:14 UTC
cvs commit: xml-soap/java/src/org/apache/soap/server/http ServerHTTPUtils.java
dug 01/04/10 06:28:14
Modified: java/src/org/apache/soap/providers RPCJavaProvider.java
java/src/org/apache/soap/server/http ServerHTTPUtils.java
Log:
Since we're more dependent that never on HTTP being the transport
I'm adding a few minor mods/hacks to allow other transports to get
thru the code w/o trapping.
Revision Changes Path
1.3 +6 -2 xml-soap/java/src/org/apache/soap/providers/RPCJavaProvider.java
Index: RPCJavaProvider.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/providers/RPCJavaProvider.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- RPCJavaProvider.java 2001/01/17 18:05:01 1.2
+++ RPCJavaProvider.java 2001/04/10 13:28:14 1.3
@@ -96,8 +96,12 @@
this.servlet = servlet ;
this.session = session ;
- ServletConfig config = servlet.getServletConfig();
- ServletContext context = config.getServletContext ();
+ ServletConfig config = null ;
+ ServletContext context = null ;
+
+ if ( servlet != null ) config = servlet.getServletConfig();
+ if ( config != null ) context = config.getServletContext ();
+
ServiceManager serviceManager =
ServerHTTPUtils.getServiceManagerFromContext (context);
1.18 +11 -5 xml-soap/java/src/org/apache/soap/server/http/ServerHTTPUtils.java
Index: ServerHTTPUtils.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/server/http/ServerHTTPUtils.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- ServerHTTPUtils.java 2001/03/23 17:33:07 1.17
+++ ServerHTTPUtils.java 2001/04/10 13:28:14 1.18
@@ -96,13 +96,18 @@
public static ServiceManager getServiceManagerFromContext(ServletContext context,
String configFilename) {
Object o;
- synchronized (context) {
- o = context.getAttribute(SERVICE_MANAGER_ID);
- if (o == null) {
- o = new ServiceManager(context, configFilename);
- context.setAttribute (SERVICE_MANAGER_ID, o);
+ if ( context != null ) {
+ synchronized (context) {
+ o = context.getAttribute(SERVICE_MANAGER_ID);
+ if (o == null) {
+ o = new ServiceManager(context, configFilename);
+ context.setAttribute (SERVICE_MANAGER_ID, o);
+ }
}
}
+ else {
+ o = new ServiceManager( null, configFilename );
+ }
return (ServiceManager) o;
}
@@ -272,6 +277,7 @@
targetObject = serviceManager;
} else {
// locate (or create) the target object and invoke the method
+ if ( scopeLock == null ) scopeLock = className ; // Just pick something
synchronized (scopeLock) {
if (scopeLock == session) {
// targetObject = session.getAttribute (targetID);