KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jacorb > security > ssl > iaik > SecurityServiceInitializer


1 package org.jacorb.security.ssl.iaik;
2
3 /*
4  * JacORB - a free Java ORB
5  *
6  * Copyright (C) 2000-2004 Gerald Brose
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the Free
20  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21  */

22
23 import java.io.*;
24 import org.omg.PortableInterceptor.*;
25 import org.omg.PortableInterceptor.ORBInitInfoPackage.*;
26 import org.omg.SecurityReplaceable.*;
27 import org.omg.Security.*;
28
29 /**
30  * The SecurityServiceInitializer class is responsible for setting up
31  * the secure access interceptors and reserving slots in PICurrent.
32  *
33  * @author Andrư Benvenuti
34  *
35  */

36
37 public class SecurityServiceInitializer
38     extends org.omg.CORBA.LocalObject JavaDoc
39     implements ORBInitializer
40 {
41     /**
42     * This method registers the interceptors.
43     */

44     public void post_init( ORBInitInfo info )
45     {
46         try
47         {
48             org.omg.SecurityLevel2.Current current = null;
49             try
50             {
51                 org.omg.CORBA.Object JavaDoc sc =
52                     info.resolve_initial_references("SecurityCurrent");
53
54                 current = org.omg.SecurityLevel2.CurrentHelper.narrow(sc);
55             }
56             catch (InvalidName in)
57             {
58             }
59
60             info.add_server_request_interceptor(new ServerInvocationInterceptor(current));
61         }
62         catch (DuplicateName duplicateName)
63         {
64             duplicateName.printStackTrace();
65         }
66     }
67     
68     public void pre_init(ORBInitInfo info)
69     {
70         // we don't to define initial references
71
// because the security current if already defined.
72

73         // we reserve slots for the security contexts
74

75     }
76 } // SSL setup Initializer
77

78
79
80
81
82
83
Popular Tags