1. /*
  2. * @(#)NSORB.java 1.4 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package com.sun.corba.se.internal.CosNaming;
  8. // Get CORBA type
  9. import org.omg.CORBA.INITIALIZE;
  10. import org.omg.CORBA.ORB;
  11. import org.omg.CORBA.CompletionStatus;
  12. import com.sun.corba.se.internal.POA.*;
  13. import org.omg.CosNaming.*;
  14. import org.omg.CORBA.Policy;
  15. import org.omg.PortableServer.POA;
  16. import org.omg.PortableServer.LifespanPolicyValue;
  17. import org.omg.PortableServer.RequestProcessingPolicyValue;
  18. import org.omg.PortableServer.IdAssignmentPolicyValue;
  19. import org.omg.PortableServer.ServantRetentionPolicyValue;
  20. // Get org.omg.CosNaming types
  21. import org.omg.CosNaming.NamingContext;
  22. // Import transient naming context
  23. import com.sun.corba.se.internal.CosNaming.TransientNamingContext;
  24. public class NSORB extends POAORB {
  25. public NSORB( ) {
  26. super();
  27. this.setPersistentServerId( (int) 1000000 );
  28. }
  29. private org.omg.CORBA.Object initializeRootNamingContext( ) {
  30. org.omg.CORBA.Object rootContext = null;
  31. try {
  32. TransientNameService tns = new TransientNameService(this);
  33. return tns.initialNamingContext();
  34. } catch (org.omg.CORBA.SystemException e) {
  35. NamingUtils.printException(e);
  36. throw new org.omg.CORBA.INITIALIZE(
  37. MinorCodes.TRANS_NS_CANNOT_CREATE_INITIAL_NC_SYS,
  38. CompletionStatus.COMPLETED_NO);
  39. } catch (Exception e) {
  40. NamingUtils.printException(e);
  41. throw new org.omg.CORBA.INITIALIZE(
  42. MinorCodes.TRANS_NS_CANNOT_CREATE_INITIAL_NC,
  43. CompletionStatus.COMPLETED_NO);
  44. }
  45. }
  46. public org.omg.CORBA.Object getInitialService( String theKey ) {
  47. if( theKey.equals( "NameService" ) ) {
  48. return initializeRootNamingContext();
  49. }
  50. return null;
  51. }
  52. }