CorbaClientSecurityInterceptor.java

00001 
00022 package org.objectweb.jonas.security.interceptors.iiop;
00023 
00024 import org.objectweb.security.context.SecurityContext;
00025 import org.objectweb.security.context.SecurityCurrent;
00026 import org.omg.IOP.ServiceContext;
00027 import org.omg.PortableInterceptor.ClientRequestInfo;
00028 import org.omg.PortableInterceptor.ClientRequestInterceptor;
00029 import org.omg.PortableInterceptor.ForwardRequest;
00030 import org.omg.PortableInterceptor.ORBInitInfo;
00031 
00038 public class CorbaClientSecurityInterceptor extends SecurityInterceptor implements ClientRequestInterceptor {
00039 
00043     private String interceptorName = "CorbaClientSecurityInteceptor";
00044 
00048     public CorbaClientSecurityInterceptor(ORBInitInfo info) {
00049     }
00050 
00055     public String name() {
00056         return interceptorName;
00057     }
00058 
00059     public void destroy() {
00060     }
00061 
00067     public void send_request(ClientRequestInfo jri) throws ForwardRequest {
00068         // Gets Current object (always existing in JOnAS Server)
00069         SecurityCurrent current = SecurityCurrent.getCurrent();
00070         if (current != null) {
00071             SecurityContext jsc = current.getSecurityContext();
00072             if (jsc != null) {
00073                 ServiceContext ssc = new ServiceContext(SEC_CTX_ID, marshallSecurityContext(jsc));
00074                 jri.add_request_service_context(ssc, true);
00075             }
00076         }
00077 
00078     }
00079 
00085     public void receive_reply(ClientRequestInfo jri) {
00086     }
00087 
00088     // empty method
00089     public void send_poll(ClientRequestInfo jri) {
00090     }
00091 
00092     public void receive_exception(ClientRequestInfo jri) throws ForwardRequest {
00093     }
00094 
00095     public void receive_other(ClientRequestInfo jri) throws ForwardRequest {
00096     }
00097 }
00098 

Generated on Tue Feb 15 15:05:21 2005 for JOnAS by  doxygen 1.3.9.1