1 55 56 62 63 package org.jboss.axis.components.uuid; 64 65 import org.jboss.axis.i18n.Messages; 66 67 78 public abstract class UUIDGenFactory 79 { 80 private static final String defaultUUIDGenClassName = "org.jboss.axis.components.uuid.SimpleUUIDGen"; 81 82 87 public static UUIDGen getUUIDGen(String uuidgenClassName) 88 { 89 UUIDGen uuidgen = null; 90 91 if ((uuidgenClassName == null) || (uuidgenClassName.length() == 0)) 92 { 93 uuidgenClassName = defaultUUIDGenClassName; 95 } 96 97 Class uuidgenClass = null; 98 try 99 { 100 uuidgenClass = java.lang.Class.forName(uuidgenClassName); 102 } 103 catch (ClassNotFoundException e) 104 { 105 throw new RuntimeException (Messages.getMessage("uuidGenFactoryCNFE00", uuidgenClassName)); 106 } 107 108 try 109 { 110 uuidgen = (UUIDGen)uuidgenClass.newInstance(); 112 } 113 catch (java.lang.Exception e) 114 { 115 throw new RuntimeException (Messages.getMessage("uuidGenFactoryException02", uuidgenClass.getName(), e.getMessage())); 116 } 117 118 return uuidgen; 119 } 120 121 124 public static void destroyUUIDGen(UUIDGen uuidgen) 125 { 126 if (uuidgen != null) 127 uuidgen.destroy(); 128 } 129 } | Popular Tags |