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.util.container.ManagedContainer
- All Implemented Interfaces:
IContainer<Object>,IManagedContainer,INotifier,INotifier.INotifier2,IDeactivateable,ILifecycle,ILifecycle.DeferrableActivation
A default implementation of a
managed container.- Author:
- Eike Stepper
-
Nested Class Summary
Nested 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
-
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.- Specified by:
getNamein interfaceIManagedContainer- Since:
- 3.8
-
setName
Description copied from interface:IManagedContainerSets the name of this container before it is activated.- Specified by:
setNamein interfaceIManagedContainer- Since:
- 3.8
-
getFactoryRegistry
- Specified by:
getFactoryRegistryin interfaceIManagedContainer
-
registerFactory
- Specified by:
registerFactoryin interfaceIManagedContainer
-
unregisterFactory
- Specified by:
unregisterFactoryin interfaceIManagedContainer
-
getPostProcessors
- Specified by:
getPostProcessorsin interfaceIManagedContainer
-
addPostProcessor
- Specified by:
addPostProcessorin interfaceIManagedContainer
-
addPostProcessor
- Specified by:
addPostProcessorin interfaceIManagedContainer
-
removePostProcessor
- Specified by:
removePostProcessorin interfaceIManagedContainer
-
getProductGroups
- Specified by:
getProductGroupsin interfaceIManagedContainer
-
getFactoryTypes
- Specified by:
getFactoryTypesin interfaceIManagedContainer
-
getFactory
- Specified by:
getFactoryin interfaceIManagedContainer- Throws:
FactoryNotFoundException
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceIContainer<Object>
-
getElementKey
- Specified by:
getElementKeyin interfaceIManagedContainer
-
getElements
- Specified by:
getElementsin interfaceIContainer<Object>
-
getElements
- Specified by:
getElementsin interfaceIManagedContainer
-
getElements
- Specified by:
getElementsin interfaceIManagedContainer
-
getElement
public Object getElement(String productGroup, String factoryType, String description) throws FactoryNotFoundException, ProductCreationException - Specified by:
getElementin interfaceIManagedContainer- Throws:
FactoryNotFoundExceptionProductCreationException
-
getElement
public Object getElement(String productGroup, String factoryType, String description, boolean activate) throws FactoryNotFoundException, ProductCreationException - Specified by:
getElementin interfaceIManagedContainer- Throws:
FactoryNotFoundExceptionProductCreationException- Since:
- 2.0
-
getElementOrNull
public <T> T getElementOrNull(String productGroup, String factoryType) throws ProductCreationException - Specified by:
getElementOrNullin interfaceIManagedContainer- Throws:
ProductCreationException
-
getElementOrNull
public <T> T getElementOrNull(String productGroup, String factoryType, String description) throws ProductCreationException - Specified by:
getElementOrNullin interfaceIManagedContainer- Throws:
ProductCreationException
-
getElementOrNull
public <T> T getElementOrNull(String productGroup, String factoryType, Tree config) throws ProductCreationException - Specified by:
getElementOrNullin interfaceIManagedContainer- Throws:
ProductCreationException- Since:
- 3.23
-
createElement
public <T> T createElement(String productGroup, String factoryType, String description) throws FactoryNotFoundException, ProductCreationException - Specified by:
createElementin interfaceIManagedContainer- Throws:
FactoryNotFoundExceptionProductCreationException- Since:
- 3.23
-
createElement
public <T> T createElement(String productGroup, String factoryType, Tree config) throws FactoryNotFoundException, ProductCreationException - Specified by:
createElementin interfaceIManagedContainer- Throws:
FactoryNotFoundExceptionProductCreationException- Since:
- 3.23
-
countElements
- Specified by:
countElementsin interfaceIManagedContainer
-
countElements
- Specified by:
countElementsin interfaceIManagedContainer
-
activateElement
- Since:
- 3.2
-
putElement
public Object putElement(String productGroup, String factoryType, String description, Object element) - Specified by:
putElementin interfaceIManagedContainer
-
putElement
-
removeElement
- Specified by:
removeElementin interfaceIManagedContainer
-
removeElement
-
forEachElement
public <T> void forEachElement(String productGroup, Class<T> productType, Function<String, String> descriptionProvider, Consumer<T> consumer) - Specified by:
forEachElementin interfaceIManagedContainer
-
forEachElement
public <T> void forEachElement(String productGroup, Class<T> productType, String description, Consumer<T> consumer) - Specified by:
forEachElementin interfaceIManagedContainer
-
forEachElement
- Specified by:
forEachElementin interfaceIManagedContainer
-
clearElements
public void clearElements()- Specified by:
clearElementsin interfaceIManagedContainer
-
loadElements
public void loadElements(InputStream stream) throws IOException, FactoryNotFoundException, ProductCreationException - Specified by:
loadElementsin interfaceIManagedContainer- Throws:
IOExceptionFactoryNotFoundExceptionProductCreationException
-
saveElements
- Specified by:
saveElementsin interfaceIManagedContainer- 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 classLifecycle- Throws:
Exception
-