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