KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.jacorb.security.ssl.sun_jsse;
2
3 /*
4  * JacORB - a free Java ORB
5  *
6  * Copyright (C) 2002-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 public class SecurityServiceInitializer
30     extends org.omg.CORBA.LocalObject JavaDoc
31     implements ORBInitializer
32 {
33     /**
34     * This method registers the interceptors.
35     */

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

74         // we reserve slots for the security contexts
75

76     }
77 } // SSL setup Initializer
78

79
80
81
82
83
84
Popular Tags