1. /*
  2. * @(#)CorbaLoc.java 1.5 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.corba;
  8. /** The corbaloc: URL definitions from the -ORBInitDef and -ORBDefaultInitDef's
  9. * will be stored in this object. This object is capable of storing multiple
  10. * Host profiles as defined in the CorbaLoc grammer.
  11. */
  12. public class CorbaLoc
  13. {
  14. // If rirFlag is set to true that means internal
  15. // boot strapping technique will be used. If set to
  16. // false then the HostInfo will be used to create the
  17. // Service Object reference.
  18. private boolean rirFlag;
  19. private java.util.Vector theHostInfo;
  20. private String theKeyString;
  21. public CorbaLoc( ) {
  22. rirFlag = false;
  23. theHostInfo = null;
  24. // If no Key string is specified then it means
  25. // It is pointing to NameService
  26. theKeyString = "NameService";
  27. }
  28. public void setRIRFlag( ) {
  29. rirFlag = true;
  30. }
  31. public boolean getRIRFlag( ) {
  32. return rirFlag;
  33. }
  34. /** There can be one or more HostInfo in a given Corbaloc and
  35. * hence it will be stored in Vector as a list.
  36. */
  37. public void addHostInfo( HostInfo element ) {
  38. if( theHostInfo == null ) {
  39. theHostInfo = new java.util.Vector( );
  40. }
  41. theHostInfo.addElement( element );
  42. }
  43. public java.util.Vector getHostInfo( ) {
  44. return theHostInfo;
  45. }
  46. public void setKeyString( String keyString ) {
  47. theKeyString = keyString;
  48. }
  49. public String getKeyString( ) {
  50. return theKeyString;
  51. }
  52. public void dprint( ) {
  53. System.out.println("///////////////////////////////////////////////" );
  54. System.out.println( " Printing CORBALoc Object ..........." );
  55. System.out.println( "rirFlag -> " + rirFlag );
  56. if( theHostInfo != null ) {
  57. System.out.println( "Printing all the Host Info .........." );
  58. for( int i = 0; i < theHostInfo.size(); i++ ) {
  59. HostInfo temp = (HostInfo) theHostInfo.elementAt( i );
  60. temp.dprint( );
  61. }
  62. }
  63. System.out.println( "KeyString -> " + theKeyString );
  64. System.out.println("//////////////////////////////////////////////" );
  65. System.out.flush( );
  66. }
  67. }