1 23 package com.sun.enterprise.admin.wsmgmt.repository.spi; 24 25 import com.sun.enterprise.admin.wsmgmt.repository.impl.*; 26 27 44 public class RepositoryFactory { 45 46 49 private RepositoryFactory () { 50 } 51 52 57 public static RepositoryFactory getRepositoryFactory() { 58 return new RepositoryFactory(); 59 } 60 61 82 public static RepositoryProvider getRepositoryProvider() 83 throws InstantiationException , IllegalAccessException , ClassCastException , 84 ClassNotFoundException { 85 String implName = System.getProperty(REPOSITORY_PROVIDER_NAME); 86 if ( implName == null ) { 87 return new AppServRepositoryProvider(); 88 } else { 89 Class repClass = Class.forName(implName); 90 Object o = repClass.newInstance(); 91 return (RepositoryProvider)o; 92 93 } 94 } 95 96 117 public static WebServiceInfoProvider getWebServiceInfoProvider() 118 throws InstantiationException , IllegalAccessException , ClassCastException , 119 ClassNotFoundException { 120 String implName = System.getProperty(WEBSERVICE_INFO_PROVIDER_NAME); 121 if ( implName == null ) { 122 Class repClass = Class.forName(AS_DEFAULT_PROVIDER); 124 return (WebServiceInfoProvider) repClass.newInstance(); 125 } else { 126 Class repClass = Class.forName(implName); 127 return (WebServiceInfoProvider) repClass.newInstance(); 128 } 129 } 130 131 132 public static final String REPOSITORY_PROVIDER_NAME = 133 "repository.provider.classname"; 134 135 136 public static final String WEBSERVICE_INFO_PROVIDER_NAME = 137 "webservice_info.provider.classname"; 138 139 private static final String AS_DEFAULT_PROVIDER = 140 "com.sun.enterprise.tools.common.AppServWebServiceInfoProvider"; 141 } 142 | Popular Tags |