mx4j/src/core/mx4j/remote/rmi RMIConnectionSubjectInvoker.java,1.7,1.8
Simone Bordet <[email protected]>
| Newsgroups | gmane.comp.java.mx4j.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/mx4j/mx4j/src/core/mx4j/remote/rmi
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10321/src/core/mx4j/remote/rmi
Modified Files:
RMIConnectionSubjectInvoker.java
Log Message:
Passing the environment to the subject invoker, so that it can configure itself
Index: RMIConnectionSubjectInvoker.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/core/mx4j/remote/rmi/RMIConnectionSubjectInvoker.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** RMIConnectionSubjectInvoker.java 24 Feb 2004 14:10:53 -0000 1.7
--- RMIConnectionSubjectInvoker.java 27 Aug 2004 22:20:57 -0000 1.8
***************
*** 12,19 ****
import java.lang.reflect.Proxy;
import java.rmi.MarshalledObject;
- import java.security.PrivilegedExceptionAction;
import java.security.AccessControlContext;
import java.util.ArrayList;
!
import javax.management.ObjectName;
import javax.management.remote.JMXServerErrorException;
--- 12,19 ----
import java.lang.reflect.Proxy;
import java.rmi.MarshalledObject;
import java.security.AccessControlContext;
+ import java.security.PrivilegedExceptionAction;
import java.util.ArrayList;
! import java.util.Map;
import javax.management.ObjectName;
import javax.management.remote.JMXServerErrorException;
***************
*** 32,49 ****
public class RMIConnectionSubjectInvoker extends RMIConnectionProxy
{
! public static RMIConnection newInstance(RMIConnection nested, Subject subject, AccessControlContext context)
{
! RMIConnectionSubjectInvoker handler = new RMIConnectionSubjectInvoker(nested, subject, context);
! return (RMIConnection)Proxy.newProxyInstance(handler.getClass().getClassLoader(), new Class[] {RMIConnection.class}, handler);
}
private final Subject subject;
private final AccessControlContext context;
! private RMIConnectionSubjectInvoker(RMIConnection nested, Subject subject, AccessControlContext context)
{
super(nested);
this.subject = subject;
this.context = context;
}
--- 32,51 ----
public class RMIConnectionSubjectInvoker extends RMIConnectionProxy
{
! public static RMIConnection newInstance(RMIConnection nested, Subject subject, AccessControlContext context, Map environment)
{
! RMIConnectionSubjectInvoker handler = new RMIConnectionSubjectInvoker(nested, subject, context, environment);
! return (RMIConnection)Proxy.newProxyInstance(handler.getClass().getClassLoader(), new Class[]{RMIConnection.class}, handler);
}
private final Subject subject;
private final AccessControlContext context;
+ private Map environment;
! private RMIConnectionSubjectInvoker(RMIConnection nested, Subject subject, AccessControlContext context, Map environment)
{
super(nested);
this.subject = subject;
this.context = context;
+ this.environment = environment;
}
***************
*** 67,71 ****
MarshalledObject filter = ((MarshalledObject[])args[1])[i];
Subject delegate = delegates[i];
! Object[] newArgs = new Object[] {new ObjectName[] {name}, new MarshalledObject[] {filter}, new Subject[] {delegate}};
Integer id = ((Integer[])subjectInvoke(proxy, method, newArgs, delegate))[0];
ids.add(id);
--- 69,73 ----
MarshalledObject filter = ((MarshalledObject[])args[1])[i];
Subject delegate = delegates[i];
! Object[] newArgs = new Object[]{new ObjectName[]{name}, new MarshalledObject[]{filter}, new Subject[]{delegate}};
Integer id = ((Integer[])subjectInvoke(proxy, method, newArgs, delegate))[0];
ids.add(id);
***************
*** 83,87 ****
private Object subjectInvoke(final Object proxy, final Method method, final Object[] args, Subject delegate) throws Exception
{
! return MX4JRemoteUtils.subjectInvoke(subject, delegate, context, new PrivilegedExceptionAction()
{
public Object run() throws Exception
--- 85,89 ----
private Object subjectInvoke(final Object proxy, final Method method, final Object[] args, Subject delegate) throws Exception
{
! return MX4JRemoteUtils.subjectInvoke(subject, delegate, context, environment, new PrivilegedExceptionAction()
{
public Object run() throws Exception
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click