Methods Summary |
---|
private static synchronized org.apache.commons.discovery.resource.names.DiscoverNamesInAlternateManagedProperties | getAlternatePropertyNameDiscoverer()
if (altNameDiscoverer == null) {
altNameDiscoverer = new DiscoverNamesInAlternateManagedProperties();
}
return altNameDiscoverer;
|
private static synchronized org.apache.commons.discovery.resource.ClassLoaders | getClassLoaders()
if (loaders == null) {
loaders = ClassLoaders.getAppLoaders(AxisProperties.class, null, true);
}
return loaders;
|
private static synchronized org.apache.commons.discovery.resource.names.DiscoverMappedNames | getMappedNames()
if (mappedNames == null) {
mappedNames = new DiscoverMappedNames();
}
return mappedNames;
|
public static synchronized org.apache.commons.discovery.ResourceNameDiscover | getNameDiscoverer()
if (nameDiscoverer == null) {
nameDiscoverer = new NameDiscoverers();
nameDiscoverer.addResourceNameDiscover(getAlternatePropertyNameDiscoverer());
nameDiscoverer.addResourceNameDiscover(new DiscoverNamesInManagedProperties());
nameDiscoverer.addResourceNameDiscover(new DiscoverServiceNames(getClassLoaders()));
nameDiscoverer.addResourceNameDiscover(getMappedNames());
}
return nameDiscoverer;
|
public static java.util.Properties | getProperties()This is an expensive operation.
return ManagedProperties.getProperties();
|
public static java.lang.String | getProperty(java.lang.String propertyName)Get value for property bound to the current thread context class loader.
return ManagedProperties.getProperty(propertyName);
|
public static java.lang.String | getProperty(java.lang.String propertyName, java.lang.String dephault)Get value for property bound to the current thread context class loader.
If not found, then return default.
return ManagedProperties.getProperty(propertyName, dephault);
|
public static org.apache.commons.discovery.ResourceClassIterator | getResourceClassIterator(java.lang.Class spi)
ResourceNameIterator it = getNameDiscoverer().findResourceNames(spi.getName());
return new DiscoverClasses(loaders).findResourceClasses(it);
|
public static java.lang.Object | newInstance(java.lang.Class spiClass, java.lang.Class[] constructorParamTypes, java.lang.Object[] constructorParams)
return AccessController.doPrivileged(
new PrivilegedAction() {
public Object run() {
ResourceClassIterator services = getResourceClassIterator(spiClass);
Object obj = null;
while (obj == null && services.hasNext()) {
Class service = services.nextResourceClass().loadClass();
/* service == null
* if class resource wasn't loadable
*/
if (service != null) {
/* OK, class loaded.. attempt to instantiate it.
*/
try {
ClassUtils.verifyAncestory(spiClass, service);
obj = ClassUtils.newInstance(service, constructorParamTypes, constructorParams);
} catch (InvocationTargetException e) {
if (e.getTargetException() instanceof java.lang.NoClassDefFoundError) {
log.debug(Messages.getMessage("exception00"), e);
} else {
log.warn(Messages.getMessage("exception00"), e);
}
} catch (Exception e) {
log.warn(Messages.getMessage("exception00"), e);
}
}
}
return obj;
}
});
|
public static java.lang.Object | newInstance(java.lang.Class spiClass, java.lang.Class defaultClass)
return newInstance(new SPInterface(spiClass), new DefaultClassHolder(defaultClass));
|
private static java.lang.Object | newInstance(org.apache.commons.discovery.tools.SPInterface spi, org.apache.commons.discovery.tools.DefaultClassHolder defaultClass)!WARNING!
SECURITY issue.
See bug 11874
The solution to both is to move doPrivilege UP within AXIS to a
class that is either private (cannot be reached by code outside
AXIS) or that represents a secure public interface...
This is going to require analysis and (probably) rearchitecting.
So, I'm taking taking the easy way out until we are at a point
where we can reasonably rearchitect for security.
return AccessController.doPrivileged(
new PrivilegedAction() {
public Object run() {
try {
return DiscoverClass.newInstance(null,
spi,
(PropertiesHolder)null,
defaultClass);
} catch (Exception e) {
log.error(Messages.getMessage("exception00"), e);
}
return null;
}
});
|
public static java.lang.Object | newInstance(java.lang.Class spiClass)Create a new instance of a service provider class.
!WARNING!
SECURITY issue.
See bug 11874
The solution to both is to move doPrivilege UP within AXIS to a
class that is either private (cannot be reached by code outside
AXIS) or that represents a secure public interface...
This is going to require analysis and (probably) rearchitecting.
So, I'm taking taking the easy way out until we are at a point
where we can reasonably rearchitect for security.
return newInstance(spiClass, null, null);
|
public static java.util.Enumeration | propertyNames()
return ManagedProperties.propertyNames();
|
public static void | setClassDefault(java.lang.Class clazz, java.lang.String defaultName)
getMappedNames().map(clazz.getName(), defaultName);
|
public static void | setClassDefaults(java.lang.Class clazz, java.lang.String[] defaultNames)
getMappedNames().map(clazz.getName(), defaultNames);
|
public static void | setClassOverrideProperty(java.lang.Class clazz, java.lang.String propertyName)
getAlternatePropertyNameDiscoverer()
.addClassToPropertyNameMapping(clazz.getName(), propertyName);
|
public static void | setProperties(java.util.Map newProperties)Set property values for Properties bound to the
current thread context class loader.
ManagedProperties.setProperties(newProperties);
|
public static void | setProperties(java.util.Map newProperties, boolean isDefault)Set property values for Properties bound to the
current thread context class loader.
ManagedProperties.setProperties(newProperties, isDefault);
|
public static void | setProperty(java.lang.String propertyName, java.lang.String value)Set value for property bound to the current thread context class loader.
ManagedProperties.setProperty(propertyName, value);
|
public static void | setProperty(java.lang.String propertyName, java.lang.String value, boolean isDefault)Set value for property bound to the current thread context class loader.
ManagedProperties.setProperty(propertyName, value, isDefault);
|