container.registerComponent(adapter);
public ComponentAdapter registerComponent(ComponentAdapter componentAdapter) throws PicoRegistrationException { return delegate.registerComponent(componentAdapter); }
private static void registerCoreServices(final MutablePicoContainer container) { container.registerComponent(new CachingComponentAdapter( new PushTaskExecutorFactoryComponentAdapter( new ConstructorInjectionComponentAdapter(PushTaskExecutorFactory.class, ConfigurablePushTaskExecutorFactory.class)))); // etcl evaluator container.registerComponentImplementation(DefaultETCLEvaluator.class); // message factory container.registerComponentImplementation(DefaultMessageFactory.class); // taskprocessor container.registerComponentImplementation(DefaultTaskFactory.class); container.registerComponentImplementation(DefaultTaskProcessor.class); registerEvaluationContextFactory(container); }
container.registerComponent(adapter);
@SuppressWarnings("unchecked") private ComponentAdapter registerComponent(Class<?> key, ComponentAdapter firstComponentRegistered) { return picoContainer.registerComponent(new DelegateComponentAdapter(key, firstComponentRegistered)); }
public Object getComponentInstance(PicoContainer container) throws PicoInitializationException, PicoIntrospectionException { final MutablePicoContainer _helperContainer = new DefaultPicoContainer(container); for (int i = 0; i < helperCAs_.length; ++i) { _helperContainer.registerComponent(helperCAs_[i]); } return super.getComponentInstance(_helperContainer); }
public TypedEventChannelFactoryImpl(MutablePicoContainer container, ORB orb) throws UserException { super(container, orb); container_.registerComponent(new CORBAObjectComponentAdapter( TypedEventChannelFactory.class, TypedEventChannelFactoryHelper.narrow(thisRef_))); }
public EventChannelFactoryImpl(MutablePicoContainer container, ORB orb) throws UserException { super(container, orb); container_.registerComponent(new CORBAObjectComponentAdapter(EventChannelFactory.class, EventChannelFactoryHelper.narrow(thisRef_))); }
private void loadFilterPlugins(Configuration conf) { org.jacorb.config.Configuration config = (org.jacorb.config.Configuration)conf; ComponentAdapter etclCA = componentAdapterFactory_.createComponentAdapter(ETCLFilter.CONSTRAINT_GRAMMAR, ETCLFilter.class, null); // add default ETCL Filter filterPico_.registerComponent(etclCA); availableFilters_.add(ETCLFilter.CONSTRAINT_GRAMMAR); Iterator i = config.getAttributeNamesWithPrefix(Attributes.FILTER_PLUGIN_PREFIX).iterator(); while (i.hasNext()) { String key = (String) i.next(); String _clazzName = null; try { String _grammar = key.substring(Attributes.FILTER_PLUGIN_PREFIX.length() + 1); logger_.info("Loading Filterplugin for Grammar: " + _grammar); _clazzName = conf.getAttribute(key); Class _clazz = ObjectUtil.classForName(_clazzName); ComponentAdapter customCA = componentAdapterFactory_.createComponentAdapter(_grammar, _clazz, null); filterPico_.registerComponent(customCA); availableFilters_.add(_grammar); } catch (ConfigurationException e) { logger_.error("Unable to access attribute: " + key, e); } catch (ClassNotFoundException e) { logger_.error("Property " + key + ": Unable to load FilterPlugin " + _clazzName + ". The FilterPlugin will not be available.", e); } } }
private static void registerORBServices(final MutablePicoContainer container) { // register services that need to be looked up via orb using custom componentadapter // POA container.registerComponent(new CachingComponentAdapter(new BiDirGiopPOAComponentAdapter(new POAComponentAdapter()))); // DynAnyFactory container.registerComponent(new CachingComponentAdapter(new DynAnyFactoryComponentAdapter())); // Configuration container.registerComponent(new CachingComponentAdapter(new ConfigurationComponentAdapter())); // FilterFactory container.registerComponent(new CachingComponentAdapter(new FilterFactoryComponentAdapter())); // IFR container.registerComponent(new CachingComponentAdapter(new RepositoryComponentAdapter())); // CurrentTimeUtil container.registerComponent(new CurrentTimeUtilComponentAdapter()); }
private static void registerEvaluationContextFactory(final MutablePicoContainer container) { // PoolingEvaluationContextFactory depends on DefaultEvaluationContextFactory. // however both implement the same interface users depend on which causes an ambiguity. // therefore DefaultEvaluationContextFactory should be only visible to PoolingEvaluationContextFactory. final ConstructorInjectionComponentAdapter _serviceCA = new ConstructorInjectionComponentAdapter(DefaultEvaluationContextFactory.class, DefaultEvaluationContextFactory.class); final ConstructorInjectionComponentAdapter _poolingServiceCA = new ConstructorInjectionComponentAdapter(EvaluationContextFactory.class, PoolingEvaluationContextFactory.class, new Parameter[] {BasicComponentParameter.BASIC_DEFAULT, new BasicComponentParameter(DefaultEvaluationContextFactory.class)}); final LocalParameterComponentAdapter _localParamCA = new LocalParameterComponentAdapter(_poolingServiceCA, new ComponentAdapter[] {_serviceCA}); final ComponentAdapter _cachingCA = new CachingComponentAdapter(_localParamCA); container.registerComponent(_cachingCA); }
public SupplierAdminImpl(IEventChannel channelServant, ORB orb, POA poa, Configuration config, MessageFactory messageFactory, OfferManager offerManager, SubscriptionManager subscriptionManager) { super(channelServant, orb, poa, config, messageFactory, offerManager, subscriptionManager); thisCorbaRef_ = SupplierAdminHelper.narrow(activate()); container_.registerComponent(new CachingComponentAdapter(new CORBAObjectComponentAdapter( SupplierAdmin.class, thisCorbaRef_))); registerDisposable(new Disposable() { public void dispose() { container_.unregisterComponent(SupplierAdmin.class); } }); }
public Object getComponentInstance(PicoContainer container) throws PicoInitializationException, PicoIntrospectionException { ORB orb = (ORB) container.getComponentInstanceOfType(ORB.class); MutablePicoContainer tempContainer = new DefaultPicoContainer(container); try { TimeService timeService = TimeServiceHelper.narrow(orb.resolve_initial_references("TimeService")); tempContainer.registerComponent(new CORBAObjectComponentAdapter(TimeService.class, timeService)); } catch (Exception e) { // ignored } return super.getComponentInstance(tempContainer); }
ComponentAdapter component = application.getPicoContainer().getComponentAdapter(ProgressManager.class.getName()); if (component == null) { application.getPicoContainer().registerComponent(new AbstractComponentAdapter(ProgressManager.class.getName(), Object.class) { @Override public Object getComponentInstance(PicoContainer container) throws PicoInitializationException, PicoIntrospectionException {
container_.registerComponent(new CachingComponentAdapter(new CORBAObjectComponentAdapter( ConsumerAdmin.class, _thisRef)));