1 7 8 package com.sun.corba.se.impl.orbutil; 9 10 import com.sun.corba.se.spi.orb.ORBVersion; 11 import com.sun.corba.se.spi.orb.ORB; 12 13 public abstract class RepositoryIdFactory 14 { 15 private static final RepIdDelegator_1_3 legacyDelegator 16 = new RepIdDelegator_1_3(); 17 18 private static final RepIdDelegator_1_3_1 ladybirdDelegator 19 = new RepIdDelegator_1_3_1(); 20 21 private static final RepIdDelegator currentDelegator 22 = new RepIdDelegator(); 23 24 27 public static RepositoryIdStrings getRepIdStringsFactory() 28 { 29 return currentDelegator; 30 } 31 32 36 public static RepositoryIdStrings getRepIdStringsFactory(ORB orb) 37 { 38 if (orb != null) { 39 switch (orb.getORBVersion().getORBType()) { 40 case ORBVersion.NEWER: 41 case ORBVersion.FOREIGN: 42 case ORBVersion.JDK1_3_1_01: 43 return currentDelegator; 44 case ORBVersion.OLD: 45 return legacyDelegator; 46 case ORBVersion.NEW: 47 return ladybirdDelegator; 48 default: 49 return currentDelegator; 50 } 51 } else 52 return currentDelegator; 53 } 54 55 58 public static RepositoryIdUtility getRepIdUtility() 59 { 60 return currentDelegator; 61 } 62 63 67 public static RepositoryIdUtility getRepIdUtility(ORB orb) 68 { 69 if (orb != null) { 70 switch (orb.getORBVersion().getORBType()) { 71 case ORBVersion.NEWER: 72 case ORBVersion.FOREIGN: 73 case ORBVersion.JDK1_3_1_01: 74 return currentDelegator; 75 case ORBVersion.OLD: 76 return legacyDelegator; 77 case ORBVersion.NEW: 78 return ladybirdDelegator; 79 default: 80 return currentDelegator; 81 } 82 } else 83 return currentDelegator; 84 } 85 } 86 | Popular Tags |