if(logger.isTraceEnabled())
ClassLoaderUtil.displayClassLoaderTree(serviceCL);
currentThread.setContextClassLoader(serviceCL);
/* Get the ProxyPreparer */
ProxyPreparer servicePreparer = (ProxyPreparer)Config.getNonNullEntry(config,
COMPONENT,
"servicePreparer",
ProxyPreparer.class,
new BasicProxyPreparer());
synchronized(RioServiceDescriptor.class) {
/* supplant global policy 1st time through */
if(globalPolicy == null) {
//initialGlobalPolicy = Policy.getPolicy();
initialGlobalPolicy = new PolicyFileProvider(getPolicy());
globalPolicy = new AggregatePolicyProvider(initialGlobalPolicy);
Policy.setPolicy(globalPolicy);
if(logger.isTraceEnabled())
logger.trace("Global policy set: {}", globalPolicy.toString());
}
/*DynamicPolicyProvider service_policy = new DynamicPolicyProvider(new PolicyFileProvider(getPolicy()));
LoaderSplitPolicyProvider splitServicePolicy =
new LoaderSplitPolicyProvider(serviceCL, service_policy, new DynamicPolicyProvider(initialGlobalPolicy));
globalPolicy.setPolicy(serviceCL, splitServicePolicy);*/
}
Object impl;
try {
Class<?> implClass;
implClass = Class.forName(getImplClassName(), false, serviceCL);
if(logger.isTraceEnabled())
logger.trace("Attempting to get implementation constructor");
Constructor constructor = implClass.getDeclaredConstructor(actTypes);
if(logger.isTraceEnabled())
logger.trace("Obtained implementation constructor: {}", constructor.toString());
constructor.setAccessible(true);
impl = constructor.newInstance(getServerConfigArgs(), lifeCycle);
if(logger.isTraceEnabled())
logger.trace("Obtained implementation instance: {}", impl.toString());
if(impl instanceof ServiceProxyAccessor) {
proxy = ((ServiceProxyAccessor)impl).getServiceProxy();
} else if(impl instanceof ProxyAccessor) {
proxy = ((ProxyAccessor)impl).getProxy();
} else {
proxy = null; // just for insurance
}
if(proxy != null) {
proxy = servicePreparer.prepareProxy(proxy);
}
if(logger.isTraceEnabled())
logger.trace("Proxy: {}", proxy==null?"<NULL>":proxy.toString());
currentThread.setContextClassLoader(currentClassLoader);
} catch(InvocationTargetException e) {