* Creates a proxy instance for the service, and returns it, wrapped in any interceptors for the
* service.
*/
private Object createServiceProxy()
{
ConstructableServicePoint servicePoint = getServicePoint();
if (_log.isDebugEnabled())
_log.debug("Creating ThreadedProxy for service " + servicePoint.getExtensionPointId());
Object proxy = ProxyUtils.createDelegatingProxy(
"ThreadedProxy",
this,
"getServiceImplementationForCurrentThread",
servicePoint);
Object intercepted = addInterceptors(proxy);
RegistryShutdownListener outerProxy = ProxyUtils
.createOuterProxy(intercepted, servicePoint);
ShutdownCoordinator coordinator = servicePoint.getShutdownCoordinator();
coordinator.addRegistryShutdownListener(outerProxy);
return outerProxy;
}