private static CachingComponentAdapterFactory makeComponentAdapterFactory(ComponentAdapterFactory caf) { if (caf instanceof CachingComponentAdapterFactory) { return (CachingComponentAdapterFactory) caf; } return new CachingComponentAdapterFactory(caf); }
private static CachingComponentAdapterFactory makeComponentAdapterFactory(ComponentAdapterFactory caf) { if (caf instanceof CachingComponentAdapterFactory) { // assume that implementation hiding CAF inside Caching one. return (CachingComponentAdapterFactory) caf; } if (caf instanceof ImplementationHidingComponentAdapterFactory) { return new CachingComponentAdapterFactory(caf); } return new CachingComponentAdapterFactory(new ImplementationHidingComponentAdapterFactory(caf, false)); }
private static MutablePicoContainer createContainer(final Logger logger) { final ConstructorInjectionComponentAdapterFactory _nonCachingCAFactory = new ConstructorInjectionComponentAdapterFactory(); //false, new ConsoleComponentMonitor(System.out)); final ComponentAdapterFactory _cachingCAFactory = new CachingComponentAdapterFactory(_nonCachingCAFactory); final MutablePicoContainer _container = new DefaultPicoContainer(_cachingCAFactory); _container.registerComponentInstance(ComponentAdapterFactory.class, _nonCachingCAFactory); logger.debug("Created Top Level Container"); return _container; }
public COSNotificationService(ORB orb, MBeanServer mbeanServer, DynamicMBeanProvider mbeanProvider, String[] args) { super(); optionalORB_ = orb; properties_ = ConsoleMain.parseProperties(args); DynamicMBeanProvider _decoratedProvider = new UnregisterObjectNameProviderDecorator( mbeanServer, mbeanProvider); ComponentAdapterFactory _defaultCAF = new JMXExposingComponentAdapterFactory( new ConstructorInjectionComponentAdapterFactory(), mbeanServer, new DynamicMBeanProvider[] { _decoratedProvider }); ComponentAdapterFactory _cachingCAF = new CachingComponentAdapterFactory( _defaultCAF); container_ = new DefaultPicoContainer(_cachingCAF); container_.registerComponentInstance(ComponentAdapterFactory.class, _defaultCAF); }