djencks 2005/07/30 04:05:50
Modified: modules/core/src/java/org/openejb/corba/sunorb
ServiceContextInterceptor.java
Log:
GERONIMO-813 ServiceContextInterceptor NPE fix
Revision Changes Path
1.2 +11 -7
openejb/modules/core/src/java/org/openejb/corba/sunorb/ServiceContextInterceptor.java
Index: ServiceContextInterceptor.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/corba/sunorb/ServiceContextInterceptor.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ServiceContextInterceptor.java 27 Mar 2005 02:04:42 -0000 1.1
+++ ServiceContextInterceptor.java 30 Jul 2005 08:05:50 -0000 1.2
@@ -49,6 +49,7 @@
import javax.net.ssl.SSLSocket;
import com.sun.corba.se.interceptor.RequestInfoExt;
+import com.sun.corba.se.connection.Connection;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.omg.CORBA.LocalObject;
@@ -77,12 +78,15 @@
if (log.isDebugEnabled()) log.debug("Looking for SSL Session");
RequestInfoExt riExt = (RequestInfoExt) ri;
- Socket socket = riExt.connection().getSocket();
- if (socket instanceof SSLSocket) {
- if (log.isDebugEnabled()) log.debug("Found SSL Session");
- SSLSocket sslSocket = (SSLSocket) socket;
+ Connection connection = riExt.connection();
+ if (connection != null) {
+ Socket socket = connection.getSocket();
+ if (socket instanceof SSLSocket) {
+ if (log.isDebugEnabled()) log.debug("Found SSL Session");
+ SSLSocket sslSocket = (SSLSocket) socket;
- SSLSessionManager.setSSLSession(ri.request_id(),
sslSocket.getSession());
+ SSLSessionManager.setSSLSession(ri.request_id(),
sslSocket.getSession());
+ }
}
}