Package org.eclipse.net4j.util.container
Class ManagedContainer
java.lang.Object
org.eclipse.net4j.util.event.Notifier
org.eclipse.net4j.util.lifecycle.Lifecycle
org.eclipse.net4j.internal.util.bundle.AbstractManagedContainer
org.eclipse.net4j.util.container.ManagedContainer
- All Implemented Interfaces:
IContainer<Object>,IManagedContainer,INotifier,INotifier.INotifier2,IDeactivateable,ILifecycle,ILifecycle.DeferrableActivation
public class ManagedContainer
extends org.eclipse.net4j.internal.util.bundle.AbstractManagedContainer
A default implementation of a
managed container.- Author:
- Eike Stepper
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.net4j.util.event.Notifier
Notifier.CancelationNested classes/interfaces inherited from interface org.eclipse.net4j.util.container.IContainer
IContainer.Modifiable<E>, IContainer.Persistable<E>, IContainer.Persistence<E>Nested classes/interfaces inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycle
ILifecycle.DeferrableActivationNested classes/interfaces inherited from interface org.eclipse.net4j.util.container.IManagedContainer
IManagedContainer.ContainerAwareNested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifier
INotifier.INotifier2 -
Field Summary
Fields inherited from interface org.eclipse.net4j.util.container.IManagedContainer
INSTANCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidactivateElement(Object element) voidaddPostProcessor(IElementProcessor postProcessor) voidaddPostProcessor(IElementProcessor postProcessor, boolean processExistingElements) voidintcountElements(String productGroup) intcountElements(String productGroup, String factoryType) <T> TcreateElement(String productGroup, String factoryType, String description) <T> TcreateElement(String productGroup, String factoryType, Tree config) protected IRegistry<IFactoryKey, IFactory> protected List<IElementProcessor> protected voidprotected voidvoid<T> voidforEachElement(String productGroup, Class<T> productType, String description, Consumer<T> consumer) <T> voidforEachElement(String productGroup, Class<T> productType, Consumer<T> consumer) <T> voidforEachElement(String productGroup, Class<T> productType, Function<String, String> descriptionProvider, Consumer<T> consumer) getElement(String productGroup, String factoryType, String description) getElement(String productGroup, String factoryType, String description, boolean activate) String[]getElementKey(Object element) <T> TgetElementOrNull(String productGroup, String factoryType) <T> TgetElementOrNull(String productGroup, String factoryType, String description) <T> TgetElementOrNull(String productGroup, String factoryType, Tree config) protected org.eclipse.net4j.util.container.ManagedContainer.ElementKey[]protected Object[]Object[]Object[]getElements(String productGroup) Object[]getElements(String productGroup, String factoryType) getFactory(String productGroup, String factoryType) getFactoryTypes(String productGroup) getName()Returns the name of this container, ornullif no name has been set.protected StringbooleanisEmpty()voidloadElements(InputStream stream) protected ObjectpostProcessElement(String productGroup, String factoryType, String description, Object element) putElement(String productGroup, String factoryType, String description, Object element) protected ObjectputElement(org.eclipse.net4j.util.container.ManagedContainer.ElementKey key, Object element) registerFactory(IFactory factory) removeElement(String productGroup, String factoryType, String description) protected ObjectremoveElement(org.eclipse.net4j.util.container.ManagedContainer.ElementKey key) voidremovePostProcessor(IElementProcessor postProcessor) voidsaveElements(OutputStream stream) voidSets the name of this container before it is activated.toString()unregisterFactory(IFactory factory) Methods inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle
activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doAfterActivate, doBeforeActivate, doBeforeDeactivate, dump, getLifecycleState, isActive, isDeferredActivationMethods inherited from class org.eclipse.net4j.util.event.Notifier
addListener, addUniqueListener, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListener, hasListeners, lastListenerRemoved, listenerAdded, listenerRemoved, removeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycle
activate, deactivate, getLifecycleState, isActiveMethods inherited from interface org.eclipse.net4j.util.event.INotifier
addListener, getListeners, hasListeners, removeListener
-
Constructor Details
-
ManagedContainer
public ManagedContainer()
-
-
Method Details
-
getName
Description copied from interface:IManagedContainerReturns the name of this container, ornullif no name has been set.- Since:
- 3.8
-
setName
Description copied from interface:IManagedContainerSets the name of this container before it is activated.- Since:
- 3.8
-
getFactoryRegistry
-
registerFactory
-
unregisterFactory
-
getPostProcessors
-
addPostProcessor
-
addPostProcessor
-
removePostProcessor
-
getProductGroups
-
getFactoryTypes
-
getFactory
- Throws:
FactoryNotFoundException
-
isEmpty
public boolean isEmpty() -
getElementKey
-
getElements
-
getElements
-
getElements
-
getElement
public Object getElement(String productGroup, String factoryType, String description) throws FactoryNotFoundException, ProductCreationException -
getElement
public Object getElement(String productGroup, String factoryType, String description, boolean activate) throws FactoryNotFoundException, ProductCreationException - Throws:
FactoryNotFoundExceptionProductCreationException- Since:
- 2.0
-
getElementOrNull
public <T> T getElementOrNull(String productGroup, String factoryType) throws ProductCreationException - Throws:
ProductCreationException
-
getElementOrNull
public <T> T getElementOrNull(String productGroup, String factoryType, String description) throws ProductCreationException - Throws:
ProductCreationException
-
getElementOrNull
public <T> T getElementOrNull(String productGroup, String factoryType, Tree config) throws ProductCreationException - Throws:
ProductCreationException- Since:
- 3.23
-
createElement
public <T> T createElement(String productGroup, String factoryType, String description) throws FactoryNotFoundException, ProductCreationException - Throws:
FactoryNotFoundExceptionProductCreationException- Since:
- 3.23
-
createElement
public <T> T createElement(String productGroup, String factoryType, Tree config) throws FactoryNotFoundException, ProductCreationException - Throws:
FactoryNotFoundExceptionProductCreationException- Since:
- 3.23
-
countElements
-
countElements
-
activateElement
- Since:
- 3.2
-
putElement
-
putElement
-
removeElement
-
removeElement
-
forEachElement
-
forEachElement
-
forEachElement
-
clearElements
public void clearElements() -
loadElements
public void loadElements(InputStream stream) throws IOException, FactoryNotFoundException, ProductCreationException -
saveElements
- Throws:
IOException
-
fireEvent
-
toString
-
getTypeName
- Since:
- 3.8
-
createFactoryRegistry
-
createPostProcessors
-
getElementRegistryKeys
protected org.eclipse.net4j.util.container.ManagedContainer.ElementKey[] getElementRegistryKeys()- Since:
- 2.0
-
getElementRegistryValues
- Since:
- 2.0
-
getElementRegistryEntries
protected Map.Entry<org.eclipse.net4j.util.container.ManagedContainer.ElementKey,Object>[] getElementRegistryEntries()- Since:
- 2.0
-
postProcessElement
-
doActivate
- Overrides:
doActivatein classLifecycle- Throws:
Exception
-
doDeactivate
- Overrides:
doDeactivatein classorg.eclipse.net4j.internal.util.bundle.AbstractManagedContainer- Throws:
Exception
-