KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > security > propagation > rmi > jrmp > interceptors > SecurityInitializer


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: SecurityInitializer.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 org.objectweb.carol.rmi.jrmp.interceptor.JDuplicateName;
29 import org.objectweb.carol.rmi.jrmp.interceptor.JInitializer;
30 import org.objectweb.carol.rmi.jrmp.interceptor.JInitInfo;
31
32 /**
33  * Initialize interceptors on client and server.
34  * @author Florent Benoit.
35  */

36 public class SecurityInitializer implements JInitializer {
37
38     /**
39      * In JRMP the 2 method( per and post init have the same consequences ...
40      * @param info the JInit Information
41      */

42     public void pre_init(final JInitInfo info) {
43         try {
44             info.add_client_request_interceptor(new ClientSecurityInterceptor());
45         } catch (JDuplicateName e) {
46            throw new IllegalStateException JavaDoc("Cannot add the client interceptor for EasyBeans security", e);
47         }
48         try {
49             info.add_server_request_interceptor(new ServerSecurityInterceptor());
50         } catch (JDuplicateName e) {
51             throw new IllegalStateException JavaDoc("Cannot add the server interceptor for EasyBeans security", e);
52         }
53
54     }
55
56     /**
57      * Nothing to do in post method.
58      * @param info the JInit Information
59      */

60     public void post_init(final JInitInfo info) {
61         // nothing
62
}
63
64 }
65
Popular Tags