KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > impl > activation > NameServiceStartThread


1 /*
2  * @(#)NameServiceStartThread.java 1.13 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package com.sun.corba.se.impl.activation;
9
10
11 import java.io.File JavaDoc;
12
13 import org.omg.CosNaming.NamingContext JavaDoc;
14 import com.sun.corba.se.spi.orb.ORB;
15 import com.sun.corba.se.impl.naming.pcosnaming.NameService;
16 import com.sun.corba.se.impl.orbutil.ORBConstants;
17
18 // REVISIT: After Merlin to see if we can get rid of this Thread and
19
// make the registration of PNameService for INS and BootStrap neat.
20
public class NameServiceStartThread extends java.lang.Thread JavaDoc
21 {
22     private ORB orb;
23     private File JavaDoc dbDir;
24
25     public NameServiceStartThread( ORB theOrb, File JavaDoc theDir )
26     {
27     orb = theOrb;
28     dbDir = theDir;
29     }
30
31     public void run( )
32     {
33     try {
34         // start Name Service
35
NameService nameService = new NameService(orb, dbDir );
36             NamingContext JavaDoc rootContext = nameService.initialNamingContext();
37             orb.register_initial_reference(
38                 ORBConstants.PERSISTENT_NAME_SERVICE_NAME, rootContext );
39         } catch( Exception JavaDoc e ) {
40         System.err.println(
41                 "NameService did not start successfully" );
42         e.printStackTrace( );
43     }
44     }
45 }
46
Popular Tags