1 /** 2 * EasyBeans 3 * Copyright (C) 2006 Bull S.A.S. 4 * Contact: easybeans@objectweb.org 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Lesser General Public 8 * License as published by the Free Software Foundation; either 9 * version 2.1 of the License, or any later version. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with this library; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 19 * USA 20 * 21 * -------------------------------------------------------------------------- 22 * $Id: ClientSecurityInterceptor.java 1121 2006-09-27 08:51:06Z benoitf $ 23 * -------------------------------------------------------------------------- 24 */ 25 26 package org.objectweb.easybeans.security.propagation.rmi.jrmp.interceptors; 27 28 import java.io.IOException; 29 30 import org.objectweb.carol.rmi.jrmp.interceptor.JClientRequestInfo; 31 import org.objectweb.carol.rmi.jrmp.interceptor.JClientRequestInterceptor; 32 import org.objectweb.easybeans.security.propagation.context.SecurityCurrent; 33 34 /** 35 * Manages security propagation on the client's side. (only send request) 36 * @author Florent Benoit 37 */ 38 public class ClientSecurityInterceptor implements JClientRequestInterceptor { 39 40 /** 41 * Serial version UID. 42 */ 43 private static final long serialVersionUID = 6761192579690917252L; 44 45 /** 46 * Interceptor name. 47 */ 48 private static final String NAME = "JRMPClientSecurityInterceptor"; 49 50 /** 51 * Default Constructor. 52 */ 53 public ClientSecurityInterceptor() { 54 } 55 56 /** 57 * Send client context with the request. 58 * @param jClientRequestInfo jri the jrmp client info 59 * @exception IOException if an exception occur with the ObjectOutput 60 */ 61 public void send_request(final JClientRequestInfo jClientRequestInfo) throws IOException { 62 // Sends the current security Context object 63 jClientRequestInfo.add_request_service_context(new SecurityServiceContext(SecurityCurrent.getCurrent() 64 .getSecurityContext())); 65 } 66 67 /** 68 * Gets the name of this interceptor. 69 * @return name of the interceptor 70 */ 71 public String name() { 72 return NAME; 73 } 74 75 /** 76 * No receive. 77 * @param jri the jrmp client info 78 * @exception IOException if an exception occur with the ObjectOutput 79 */ 80 public void receive_reply(final JClientRequestInfo jri) throws IOException { 81 // nothing 82 } 83 84 /** 85 * Send client context in pool. 86 * @param jri the jrmp client info 87 * @exception IOException if an exception occur with the ObjectOutput 88 */ 89 public void send_poll(final JClientRequestInfo jri) throws IOException { 90 // nothing 91 } 92 93 /** 94 * Receive exception interception. 95 * @param jri the jrmp client info 96 * @exception IOException if an exception occur with the ObjectOutput 97 */ 98 public void receive_exception(final JClientRequestInfo jri) throws IOException { 99 // nothing 100 } 101 102 /** 103 * Receive other interception. 104 * @param jri the jrmp client info 105 * @exception IOException if an exception occur with the ObjectOutput 106 */ 107 public void receive_other(final JClientRequestInfo jri) throws IOException { 108 // nothing 109 } 110 111 } 112