[prev in list] [next in list] [prev in thread] [next in thread]
List: openejb-cvs
Subject: [openejb-scm] openejb/modules/core/src/java/org/openejb/corba/security ServerPolicy.java ServerPolic
From: maguro () codehaus ! org
Date: 2005-04-23 18:44:29
Message-ID: 20050423184429.6900.qmail () codehaus ! org
[Download RAW message or body]
maguro 2005/04/23 14:44:29
Modified: modules/core/src/java/org/openejb/corba/security
ServerPolicy.java ServerPolicyFactory.java
ServerSecurityInterceptor.java
Log:
Better handling of identity assertions.
Revision Changes Path
1.2 +29 -3 \
openejb/modules/core/src/java/org/openejb/corba/security/ServerPolicy.java
Index: ServerPolicy.java
===================================================================
RCS file: /home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/corba/security/ServerPolicy.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ServerPolicy.java 8 Mar 2005 04:08:27 -0000 1.1
+++ ServerPolicy.java 23 Apr 2005 18:44:29 -0000 1.2
@@ -47,6 +47,8 @@
*/
package org.openejb.corba.security;
+import java.io.Serializable;
+
import org.omg.CORBA.LocalObject;
import org.omg.CORBA.Policy;
@@ -59,15 +61,21 @@
public class ServerPolicy extends LocalObject implements Policy {
private final TSSConfig TSSConfig;
+ private final ClassLoader classloader;
- public ServerPolicy(TSSConfig TSSConfig) {
- this.TSSConfig = TSSConfig;
+ public ServerPolicy(Config config) {
+ this.TSSConfig = config.getTSSConfig();
+ this.classloader = config.getClassloader();
}
public TSSConfig getConfig() {
return TSSConfig;
}
+ public ClassLoader getClassloader() {
+ return classloader;
+ }
+
public int policy_type() {
return ServerPolicyFactory.POLICY_TYPE;
}
@@ -77,5 +85,23 @@
public Policy copy() {
return null;
+ }
+
+ public static class Config implements Serializable {
+ private final TSSConfig TSSConfig;
+ private final transient ClassLoader classloader;
+
+ public Config(TSSConfig TSSConfig, ClassLoader classloader) {
+ this.TSSConfig = TSSConfig;
+ this.classloader = classloader;
+ }
+
+ public final TSSConfig getTSSConfig() {
+ return TSSConfig;
+ }
+
+ public final ClassLoader getClassloader() {
+ return classloader;
+ }
}
}
1.2 +2 -2 \
openejb/modules/core/src/java/org/openejb/corba/security/ServerPolicyFactory.java
Index: ServerPolicyFactory.java
===================================================================
RCS file: /home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/corba/security/ServerPolicyFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ServerPolicyFactory.java 8 Mar 2005 04:08:27 -0000 1.1
+++ ServerPolicyFactory.java 23 Apr 2005 18:44:29 -0000 1.2
@@ -66,6 +66,6 @@
public Policy create_policy(int type, Any value) throws PolicyError {
if (type != POLICY_TYPE) throw new PolicyError();
- return new ServerPolicy((TSSConfig) value.extract_Value());
+ return new ServerPolicy((ServerPolicy.Config) value.extract_Value());
}
}
1.11 +10 -4 \
openejb/modules/core/src/java/org/openejb/corba/security/ServerSecurityInterceptor.java
Index: ServerSecurityInterceptor.java
===================================================================
RCS file: /home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/corba/security/ServerSecurityInterceptor.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ServerSecurityInterceptor.java 14 Apr 2005 02:44:28 -0000 1.10
+++ ServerSecurityInterceptor.java 23 Apr 2005 18:44:29 -0000 1.11
@@ -48,8 +48,6 @@
import javax.security.auth.DestroyFailedException;
import javax.security.auth.Subject;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_PARAM;
import org.omg.CORBA.INTERNAL;
@@ -72,6 +70,8 @@
import org.omg.IOP.ServiceContext;
import org.omg.PortableInterceptor.ServerRequestInfo;
import org.omg.PortableInterceptor.ServerRequestInterceptor;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.apache.geronimo.security.ContextManager;
@@ -106,12 +106,16 @@
long contextId = 0;
if (log.isDebugEnabled()) log.debug("receive_request(" + ri.operation() + \
" [" + new String(ri.object_id()) + "] "); + ClassLoader savedCL = \
Thread.currentThread().getContextClassLoader(); try {
ServerPolicy serverPolicy = (ServerPolicy) \
ri.get_server_policy(ServerPolicyFactory.POLICY_TYPE); if (serverPolicy == null) \
return; +
TSSConfig tssPolicy = serverPolicy.getConfig();
if (tssPolicy == null) return;
+ if (serverPolicy.getClassloader() != null) \
Thread.currentThread().setContextClassLoader(serverPolicy.getClassloader()); +
if (log.isDebugEnabled()) log.debug("Found server policy");
ServiceContext serviceContext = \
ri.get_request_service_context(SecurityAttributeService.value); @@ -174,6 +178,8 @@
} catch (Exception e) {
log.error("Exception", e);
throw (RuntimeException) e.getCause();
+ } finally {
+ Thread.currentThread().setContextClassLoader(savedCL);
}
if (log.isDebugEnabled()) log.debug(" " + identity);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic