1 17 18 19 package org.apache.naming; 20 21 import javax.naming.Context ; 22 import javax.naming.Reference ; 23 24 30 31 public class ResourceEnvRef 32 extends Reference { 33 34 35 37 38 41 public static final String DEFAULT_FACTORY = 42 org.apache.naming.factory.Constants.DEFAULT_RESOURCE_ENV_FACTORY; 43 44 45 47 48 53 public ResourceEnvRef(String resourceType) { 54 super(resourceType); 55 } 56 57 58 65 public ResourceEnvRef(String resourceType, String factory, 66 String factoryLocation) { 67 super(resourceType, factory, factoryLocation); 68 } 69 70 71 73 74 76 77 81 public String getFactoryClassName() { 82 String factory = super.getFactoryClassName(); 83 if (factory != null) { 84 return factory; 85 } else { 86 factory = System.getProperty(Context.OBJECT_FACTORIES); 87 if (factory != null) { 88 return null; 89 } else { 90 return DEFAULT_FACTORY; 91 } 92 } 93 } 94 95 96 98 99 } 100 | Popular Tags |