public Object createInstance() throws Fabric3Exception { if (recreate.getAndSet(false)) { implementationManager = null; } Object instance = getImplementationManager().newInstance(); if (Scope.COMPOSITE == scopeContainer.getScope()) { cachedInstance = instance; } return instance; }
public void reinject(Object instance) throws InstanceLifecycleException { getImplementationManager().reinject(instance); }
public void startInstance(Object instance) throws Fabric3Exception { getImplementationManager().start(instance); }
public void removeSupplier(Injectable injectable) { factory.removeSupplier(injectable); String name = injectable.getName(); List<Object> instances = scopeContainer.getActiveInstances(this); for (Object instance : instances) { getImplementationManager().removed(instance, name); } // Clear the instance factory as it has changed and will need to be re-created. This can happen if reinjection occurs after the first // instance has been created. recreate.set(true); }
public void stopInstance(Object instance) throws InstanceDestructionException { cachedInstance = null; getImplementationManager().stop(instance); }
/** * Sets a Supplier. * * @param injectable the injectable identifying the component reference, property or context artifact the Supplier creates instances for * @param supplier the Supplier * @param attributes the injection attributes */ public void setSupplier(Injectable injectable, Supplier<?> supplier, InjectionAttributes attributes) { factory.setSupplier(injectable, supplier, attributes); List<Object> instances = scopeContainer.getActiveInstances(this); String name = injectable.getName(); for (Object instance : instances) { getImplementationManager().updated(instance, name); } // Clear the instance factory as it has changed and will need to be re-created. This can happen if reinjection occurs after the first // instance has been created. recreate.set(true); }
public void removeObjectFactory(Injectable injectable) { factory.removeObjectFactory(injectable); String name = injectable.getName(); List<Object> instances = scopeContainer.getActiveInstances(this); for (Object instance : instances) { getImplementationManager().removed(instance, name); } // Clear the instance factory as it has changed and will need to be re-created. This can happen if reinjection occurs after the first // instance has been created. recreate.set(true); }
public void stopInstance(Object instance) throws Fabric3Exception { cachedInstance = null; getImplementationManager().stop(instance); }
/** * Sets an object factory. * * @param injectable the injectable identifying the component reference, property or context artifact the object factory creates instances for * @param objectFactory the object factory * @param attributes the injection attributes */ public void setObjectFactory(Injectable injectable, ObjectFactory<?> objectFactory, InjectionAttributes attributes) { factory.setObjectFactory(injectable, objectFactory, attributes); List<Object> instances = scopeContainer.getActiveInstances(this); String name = injectable.getName(); for (Object instance : instances) { getImplementationManager().updated(instance, name); } // Clear the instance factory as it has changed and will need to be re-created. This can happen if reinjection occurs after the first // instance has been created. recreate.set(true); }
public void removeSupplier(Injectable injectable) { factory.removeSupplier(injectable); String name = injectable.getName(); List<Object> instances = scopeContainer.getActiveInstances(this); for (Object instance : instances) { getImplementationManager().removed(instance, name); } // Clear the instance factory as it has changed and will need to be re-created. This can happen if reinjection occurs after the first // instance has been created. recreate.set(true); }
public Object createInstance() throws ObjectCreationException { if (recreate.getAndSet(false)) { implementationManager = null; } Object instance = getImplementationManager().newInstance(); if (Scope.COMPOSITE == scopeContainer.getScope()) { cachedInstance = instance; } return instance; }
public void stopInstance(Object instance) throws Fabric3Exception { cachedInstance = null; getImplementationManager().stop(instance); }
public void reinject(Object instance) throws Fabric3Exception { getImplementationManager().reinject(instance); }
public void startInstance(Object instance) throws Fabric3Exception { getImplementationManager().start(instance); }
/** * Sets a Supplier. * * @param injectable the injectable identifying the component reference, property or context artifact the Supplier creates instances for * @param supplier the Supplier * @param attributes the injection attributes */ public void setSupplier(Injectable injectable, Supplier<?> supplier, InjectionAttributes attributes) { factory.setSupplier(injectable, supplier, attributes); List<Object> instances = scopeContainer.getActiveInstances(this); String name = injectable.getName(); for (Object instance : instances) { getImplementationManager().updated(instance, name); } // Clear the instance factory as it has changed and will need to be re-created. This can happen if reinjection occurs after the first // instance has been created. recreate.set(true); }
public Object createInstance() throws Fabric3Exception { if (recreate.getAndSet(false)) { implementationManager = null; } Object instance = getImplementationManager().newInstance(); if (Scope.COMPOSITE == scopeContainer.getScope()) { cachedInstance = instance; } return instance; }
public void reinject(Object instance) throws Fabric3Exception { getImplementationManager().reinject(instance); }
public void startInstance(Object instance) throws InstanceInitException { getImplementationManager().start(instance); }