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<java.lang.Object>,- IManagedContainer,- INotifier,- INotifier.INotifier2,- IDeactivateable,- ILifecycle,- ILifecycle.DeferrableActivation
 
 public class ManagedContainer extends Lifecycle implements IManagedContainer A default implementation of amanaged container.- Author:
- Eike Stepper
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.container.IContainerIContainer.Modifiable<E>, IContainer.Persistable<E>, IContainer.Persistence<E>
 - 
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycleILifecycle.DeferrableActivation
 - 
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.container.IManagedContainerIManagedContainer.ContainerAware
 - 
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifierINotifier.INotifier2
 
- 
 - 
Constructor SummaryConstructors Constructor Description ManagedContainer()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidactivateElement(java.lang.Object element)voidaddPostProcessor(IElementProcessor postProcessor)voidaddPostProcessor(IElementProcessor postProcessor, boolean processExistingElements)voidclearElements()protected java.lang.ObjectcreateElement(java.lang.String productGroup, java.lang.String factoryType, java.lang.String description)protected IRegistry<IFactoryKey,IFactory>createFactoryRegistry()protected java.util.List<IElementProcessor>createPostProcessors()protected voiddoActivate()protected voiddoDeactivate()voidfireEvent(IEvent event)<T> voidforEachElement(java.lang.String productGroup, java.lang.Class<T> productType, java.lang.String description, java.util.function.Consumer<T> consumer)<T> voidforEachElement(java.lang.String productGroup, java.lang.Class<T> productType, java.util.function.Consumer<T> consumer)<T> voidforEachElement(java.lang.String productGroup, java.lang.Class<T> productType, java.util.function.Function<java.lang.String,java.lang.String> descriptionProvider, java.util.function.Consumer<T> consumer)java.lang.ObjectgetElement(java.lang.String productGroup, java.lang.String factoryType, java.lang.String description)java.lang.ObjectgetElement(java.lang.String productGroup, java.lang.String factoryType, java.lang.String description, boolean activate)java.lang.String[]getElementKey(java.lang.Object element)<T> TgetElementOrNull(java.lang.String productGroup, java.lang.String factoryType, java.lang.String description)protected java.util.Map.Entry<org.eclipse.net4j.util.container.ManagedContainer.ElementKey,java.lang.Object>[]getElementRegistryEntries()protected org.eclipse.net4j.util.container.ManagedContainer.ElementKey[]getElementRegistryKeys()protected java.lang.Object[]getElementRegistryValues()java.lang.Object[]getElements()java.lang.Object[]getElements(java.lang.String productGroup)java.lang.Object[]getElements(java.lang.String productGroup, java.lang.String factoryType)IFactorygetFactory(java.lang.String productGroup, java.lang.String factoryType)IRegistry<IFactoryKey,IFactory>getFactoryRegistry()java.util.Set<java.lang.String>getFactoryTypes(java.lang.String productGroup)java.lang.StringgetName()Returns the name of this container, ornullif no name has been set.java.util.List<IElementProcessor>getPostProcessors()java.util.Set<java.lang.String>getProductGroups()protected java.lang.StringgetTypeName()booleanisEmpty()voidloadElements(java.io.InputStream stream)protected java.lang.ObjectpostProcessElement(java.lang.String productGroup, java.lang.String factoryType, java.lang.String description, java.lang.Object element)java.lang.ObjectputElement(java.lang.String productGroup, java.lang.String factoryType, java.lang.String description, java.lang.Object element)protected java.lang.ObjectputElement(org.eclipse.net4j.util.container.ManagedContainer.ElementKey key, java.lang.Object element)ManagedContainerregisterFactory(IFactory factory)java.lang.ObjectremoveElement(java.lang.String productGroup, java.lang.String factoryType, java.lang.String description)protected java.lang.ObjectremoveElement(org.eclipse.net4j.util.container.ManagedContainer.ElementKey key)voidremovePostProcessor(IElementProcessor postProcessor)voidsaveElements(java.io.OutputStream stream)voidsetName(java.lang.String name)Sets the name of this container before it is activated.java.lang.StringtoString()- 
Methods inherited from class org.eclipse.net4j.util.lifecycle.Lifecycleactivate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doAfterActivate, doBeforeActivate, doBeforeDeactivate, dump, getLifecycleState, isActive, isDeferredActivation
 - 
Methods inherited from class org.eclipse.net4j.util.event.NotifieraddListener, addUniqueListener, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListener, hasListeners, lastListenerRemoved, listenerAdded, listenerRemoved, removeListener
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycleactivate, deactivate, getLifecycleState, isActive
 - 
Methods inherited from interface org.eclipse.net4j.util.event.INotifieraddListener, getListeners, hasListeners, removeListener
 
- 
 
- 
- 
- 
Method Detail- 
getNamepublic java.lang.String getName() Description copied from interface:IManagedContainerReturns the name of this container, ornullif no name has been set.- Specified by:
- getNamein interface- IManagedContainer
- Since:
- 3.8
 
 - 
setNamepublic void setName(java.lang.String name) Description copied from interface:IManagedContainerSets the name of this container before it is activated.- Specified by:
- setNamein interface- IManagedContainer
- Since:
- 3.8
 
 - 
getFactoryRegistrypublic IRegistry<IFactoryKey,IFactory> getFactoryRegistry() - Specified by:
- getFactoryRegistryin interface- IManagedContainer
 
 - 
registerFactorypublic ManagedContainer registerFactory(IFactory factory) - Specified by:
- registerFactoryin interface- IManagedContainer
 
 - 
getPostProcessorspublic java.util.List<IElementProcessor> getPostProcessors() - Specified by:
- getPostProcessorsin interface- IManagedContainer
 
 - 
addPostProcessorpublic void addPostProcessor(IElementProcessor postProcessor, boolean processExistingElements) - Specified by:
- addPostProcessorin interface- IManagedContainer
 
 - 
addPostProcessorpublic void addPostProcessor(IElementProcessor postProcessor) - Specified by:
- addPostProcessorin interface- IManagedContainer
 
 - 
removePostProcessorpublic void removePostProcessor(IElementProcessor postProcessor) - Specified by:
- removePostProcessorin interface- IManagedContainer
 
 - 
getProductGroupspublic java.util.Set<java.lang.String> getProductGroups() - Specified by:
- getProductGroupsin interface- IManagedContainer
 
 - 
getFactoryTypespublic java.util.Set<java.lang.String> getFactoryTypes(java.lang.String productGroup) - Specified by:
- getFactoryTypesin interface- IManagedContainer
 
 - 
getFactorypublic IFactory getFactory(java.lang.String productGroup, java.lang.String factoryType) throws FactoryNotFoundException - Specified by:
- getFactoryin interface- IManagedContainer
- Throws:
- FactoryNotFoundException
 
 - 
isEmptypublic boolean isEmpty() - Specified by:
- isEmptyin interface- IContainer<java.lang.Object>
 
 - 
getElementKeypublic java.lang.String[] getElementKey(java.lang.Object element) - Specified by:
- getElementKeyin interface- IManagedContainer
 
 - 
getElementspublic java.lang.Object[] getElements() - Specified by:
- getElementsin interface- IContainer<java.lang.Object>
 
 - 
getElementspublic java.lang.Object[] getElements(java.lang.String productGroup) - Specified by:
- getElementsin interface- IManagedContainer
 
 - 
getElementspublic java.lang.Object[] getElements(java.lang.String productGroup, java.lang.String factoryType)- Specified by:
- getElementsin interface- IManagedContainer
 
 - 
getElementpublic java.lang.Object getElement(java.lang.String productGroup, java.lang.String factoryType, java.lang.String description) throws FactoryNotFoundException, ProductCreationException- Specified by:
- getElementin interface- IManagedContainer
- Throws:
- FactoryNotFoundException
- ProductCreationException
 
 - 
getElementpublic java.lang.Object getElement(java.lang.String productGroup, java.lang.String factoryType, java.lang.String description, boolean activate) throws FactoryNotFoundException, ProductCreationException- Specified by:
- getElementin interface- IManagedContainer
- Throws:
- FactoryNotFoundException
- ProductCreationException
- Since:
- 2.0
 
 - 
getElementOrNullpublic <T> T getElementOrNull(java.lang.String productGroup, java.lang.String factoryType, java.lang.String description)- Specified by:
- getElementOrNullin interface- IManagedContainer
 
 - 
activateElementprotected void activateElement(java.lang.Object element) - Since:
- 3.2
 
 - 
putElementpublic java.lang.Object putElement(java.lang.String productGroup, java.lang.String factoryType, java.lang.String description, java.lang.Object element)- Specified by:
- putElementin interface- IManagedContainer
 
 - 
putElementprotected java.lang.Object putElement(org.eclipse.net4j.util.container.ManagedContainer.ElementKey key, java.lang.Object element)
 - 
removeElementpublic java.lang.Object removeElement(java.lang.String productGroup, java.lang.String factoryType, java.lang.String description)- Specified by:
- removeElementin interface- IManagedContainer
 
 - 
removeElementprotected java.lang.Object removeElement(org.eclipse.net4j.util.container.ManagedContainer.ElementKey key) 
 - 
forEachElementpublic <T> void forEachElement(java.lang.String productGroup, java.lang.Class<T> productType, java.util.function.Function<java.lang.String,java.lang.String> descriptionProvider, java.util.function.Consumer<T> consumer)- Specified by:
- forEachElementin interface- IManagedContainer
 
 - 
forEachElementpublic <T> void forEachElement(java.lang.String productGroup, java.lang.Class<T> productType, java.lang.String description, java.util.function.Consumer<T> consumer)- Specified by:
- forEachElementin interface- IManagedContainer
 
 - 
forEachElementpublic <T> void forEachElement(java.lang.String productGroup, java.lang.Class<T> productType, java.util.function.Consumer<T> consumer)- Specified by:
- forEachElementin interface- IManagedContainer
 
 - 
clearElementspublic void clearElements() - Specified by:
- clearElementsin interface- IManagedContainer
 
 - 
loadElementspublic void loadElements(java.io.InputStream stream) throws java.io.IOException, FactoryNotFoundException, ProductCreationException- Specified by:
- loadElementsin interface- IManagedContainer
- Throws:
- java.io.IOException
- FactoryNotFoundException
- ProductCreationException
 
 - 
saveElementspublic void saveElements(java.io.OutputStream stream) throws java.io.IOException- Specified by:
- saveElementsin interface- IManagedContainer
- Throws:
- java.io.IOException
 
 - 
getTypeNameprotected java.lang.String getTypeName() - Since:
- 3.8
 
 - 
createFactoryRegistryprotected IRegistry<IFactoryKey,IFactory> createFactoryRegistry() 
 - 
createPostProcessorsprotected java.util.List<IElementProcessor> createPostProcessors() 
 - 
getElementRegistryKeysprotected org.eclipse.net4j.util.container.ManagedContainer.ElementKey[] getElementRegistryKeys() - Since:
- 2.0
 
 - 
getElementRegistryValuesprotected java.lang.Object[] getElementRegistryValues() - Since:
- 2.0
 
 - 
getElementRegistryEntriesprotected java.util.Map.Entry<org.eclipse.net4j.util.container.ManagedContainer.ElementKey,java.lang.Object>[] getElementRegistryEntries() - Since:
- 2.0
 
 - 
createElementprotected java.lang.Object createElement(java.lang.String productGroup, java.lang.String factoryType, java.lang.String description) throws FactoryNotFoundException, ProductCreationException
 - 
postProcessElementprotected java.lang.Object postProcessElement(java.lang.String productGroup, java.lang.String factoryType, java.lang.String description, java.lang.Object element)
 - 
doActivateprotected void doActivate() throws java.lang.Exception- Overrides:
- doActivatein class- Lifecycle
- Throws:
- java.lang.Exception
 
 - 
doDeactivateprotected void doDeactivate() throws java.lang.Exception- Overrides:
- doDeactivatein class- Lifecycle
- Throws:
- java.lang.Exception
 
 
- 
 
-