ClientSecurityInterceptor.java

00001 
00026 package org.objectweb.jonas.security.interceptors.jrmp;
00027 
00028 // java import
00029 import java.io.IOException;
00030 
00031 import org.objectweb.carol.rmi.jrmp.interceptor.JClientRequestInfo;
00032 import org.objectweb.carol.rmi.jrmp.interceptor.JClientRequestInterceptor;
00033 import org.objectweb.security.context.SecurityContext;
00034 import org.objectweb.security.context.SecurityCurrent;
00035 
00043 public class ClientSecurityInterceptor implements JClientRequestInterceptor {
00044 
00048     public static int SEC_CTX_ID = 1;
00049 
00053     private String interceptorName = "ClientSecurityInterceptor";
00054 
00058     public ClientSecurityInterceptor() {
00059     }
00060 
00068     public void send_request(JClientRequestInfo jri) throws IOException {
00069 
00070         // Gets Current object (always existing in JOnAS Server)
00071         SecurityCurrent current = SecurityCurrent.getCurrent();
00072         if (current != null) {
00073             // Get the Security Context
00074             SecurityContext ctx = current.getSecurityContext();
00075             SecurityServiceContext ssc = new SecurityServiceContext(SEC_CTX_ID, ctx);
00076             jri.add_request_service_context(ssc);
00077         }
00078     }
00079 
00086     public void receive_reply(JClientRequestInfo jri) throws IOException {
00087     }
00088 
00093     public String name() {
00094         return interceptorName;
00095     }
00096 
00097     // empty method
00098     public void send_poll(JClientRequestInfo jri) throws IOException {
00099     }
00100 
00101     public void receive_exception(JClientRequestInfo jri) throws IOException {
00102     }
00103 
00104     public void receive_other(JClientRequestInfo jri) throws IOException {
00105     }
00106 }
00107 

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