org.eclipse.net4j.util.container
Class ManagedContainer

java.lang.Object
  extended by org.eclipse.net4j.util.event.Notifier
      extended by org.eclipse.net4j.util.lifecycle.Lifecycle
          extended by org.eclipse.net4j.util.container.ManagedContainer
All Implemented Interfaces:
IContainer<java.lang.Object>, IManagedContainer, INotifier, INotifier.Introspection, ILifecycle, ILifecycle.Introspection

public class ManagedContainer
extends Lifecycle
implements IManagedContainer


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifier
INotifier.Introspection
 
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycle
ILifecycle.Introspection
 
Field Summary
 
Fields inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle
USE_LABEL
 
Constructor Summary
ManagedContainer()
           
 
Method Summary
 void addPostProcessor(IElementProcessor postProcessor)
           
 void addPostProcessor(IElementProcessor postProcessor, boolean processExistingElements)
           
 void clearElements()
           
protected  java.lang.Object createElement(java.lang.String productGroup, java.lang.String factoryType, java.lang.String description)
           
protected  IRegistry<IFactoryKey,IFactory> createFactoryRegistry()
           
protected  java.util.List<IElementProcessor> createPostProcessors()
           
protected  void doActivate()
           
protected  void doDeactivate()
           
 void fireEvent(IEvent event)
           
 java.lang.Object getElement(java.lang.String productGroup, java.lang.String factoryType, java.lang.String description)
           
 java.lang.String[] getElementKey(java.lang.Object element)
           
 java.lang.Object[] getElements()
           
 java.lang.Object[] getElements(java.lang.String productGroup)
           
 java.lang.Object[] getElements(java.lang.String productGroup, java.lang.String factoryType)
           
 IFactory getFactory(java.lang.String productGroup, java.lang.String factoryType)
           
 IRegistry<IFactoryKey,IFactory> getFactoryRegistry()
           
 java.util.Set<java.lang.String> getFactoryTypes(java.lang.String productGroup)
           
 java.util.List<IElementProcessor> getPostProcessors()
           
 java.util.Set<java.lang.String> getProductGroups()
           
protected  void initMaxElementID()
           
 boolean isEmpty()
           
 void loadElements(java.io.InputStream stream)
           
protected  java.lang.Object postProcessElement(java.lang.String productGroup, java.lang.String factoryType, java.lang.String description, java.lang.Object element)
           
protected  java.lang.Object putElement(org.eclipse.net4j.util.container.ManagedContainer.ElementKey key, java.lang.Object element)
           
 java.lang.Object putElement(java.lang.String productGroup, java.lang.String factoryType, java.lang.String description, java.lang.Object element)
           
 ManagedContainer registerFactory(IFactory factory)
           
protected  java.lang.Object removeElement(org.eclipse.net4j.util.container.ManagedContainer.ElementKey key)
           
 java.lang.Object removeElement(java.lang.String productGroup, java.lang.String factoryType, java.lang.String description)
           
 void removePostProcessor(IElementProcessor postProcessor)
           
 void saveElements(java.io.OutputStream stream)
           
 java.lang.String toString()
           
 
Methods inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle
activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, deferredDeactivate, doBeforeActivate, doBeforeDeactivate, dump, getLifecycleState, isActive, isDeferredActivation, isDeferredDeactivation
 
Methods inherited from class org.eclipse.net4j.util.event.Notifier
addListener, getListeners, hasListeners, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.net4j.util.event.INotifier
addListener, removeListener
 

Constructor Detail

ManagedContainer

public ManagedContainer()
Method Detail

getFactoryRegistry

public IRegistry<IFactoryKey,IFactory> getFactoryRegistry()
Specified by:
getFactoryRegistry in interface IManagedContainer

registerFactory

public ManagedContainer registerFactory(IFactory factory)
Specified by:
registerFactory in interface IManagedContainer

getPostProcessors

public java.util.List<IElementProcessor> getPostProcessors()
Specified by:
getPostProcessors in interface IManagedContainer

addPostProcessor

public void addPostProcessor(IElementProcessor postProcessor,
                             boolean processExistingElements)
Specified by:
addPostProcessor in interface IManagedContainer

addPostProcessor

public void addPostProcessor(IElementProcessor postProcessor)
Specified by:
addPostProcessor in interface IManagedContainer

removePostProcessor

public void removePostProcessor(IElementProcessor postProcessor)
Specified by:
removePostProcessor in interface IManagedContainer

getProductGroups

public java.util.Set<java.lang.String> getProductGroups()
Specified by:
getProductGroups in interface IManagedContainer

getFactoryTypes

public java.util.Set<java.lang.String> getFactoryTypes(java.lang.String productGroup)
Specified by:
getFactoryTypes in interface IManagedContainer

getFactory

public IFactory getFactory(java.lang.String productGroup,
                           java.lang.String factoryType)
Specified by:
getFactory in interface IManagedContainer

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface IContainer<java.lang.Object>

getElementKey

public java.lang.String[] getElementKey(java.lang.Object element)
Specified by:
getElementKey in interface IManagedContainer

getElements

public java.lang.Object[] getElements()
Specified by:
getElements in interface IContainer<java.lang.Object>

getElements

public java.lang.Object[] getElements(java.lang.String productGroup)
Specified by:
getElements in interface IManagedContainer

getElements

public java.lang.Object[] getElements(java.lang.String productGroup,
                                      java.lang.String factoryType)
Specified by:
getElements in interface IManagedContainer

getElement

public java.lang.Object getElement(java.lang.String productGroup,
                                   java.lang.String factoryType,
                                   java.lang.String description)
Specified by:
getElement in interface IManagedContainer

putElement

public java.lang.Object putElement(java.lang.String productGroup,
                                   java.lang.String factoryType,
                                   java.lang.String description,
                                   java.lang.Object element)
Specified by:
putElement in interface IManagedContainer

putElement

protected java.lang.Object putElement(org.eclipse.net4j.util.container.ManagedContainer.ElementKey key,
                                      java.lang.Object element)

removeElement

public java.lang.Object removeElement(java.lang.String productGroup,
                                      java.lang.String factoryType,
                                      java.lang.String description)
Specified by:
removeElement in interface IManagedContainer

removeElement

protected java.lang.Object removeElement(org.eclipse.net4j.util.container.ManagedContainer.ElementKey key)

clearElements

public void clearElements()
Specified by:
clearElements in interface IManagedContainer

loadElements

public void loadElements(java.io.InputStream stream)
                  throws java.io.IOException
Specified by:
loadElements in interface IManagedContainer
Throws:
java.io.IOException

saveElements

public void saveElements(java.io.OutputStream stream)
                  throws java.io.IOException
Specified by:
saveElements in interface IManagedContainer
Throws:
java.io.IOException

fireEvent

public void fireEvent(IEvent event)
Overrides:
fireEvent in class Notifier

toString

public java.lang.String toString()
Overrides:
toString in class Lifecycle

createFactoryRegistry

protected IRegistry<IFactoryKey,IFactory> createFactoryRegistry()

createPostProcessors

protected java.util.List<IElementProcessor> createPostProcessors()

createElement

protected java.lang.Object createElement(java.lang.String productGroup,
                                         java.lang.String factoryType,
                                         java.lang.String description)

postProcessElement

protected java.lang.Object postProcessElement(java.lang.String productGroup,
                                              java.lang.String factoryType,
                                              java.lang.String description,
                                              java.lang.Object element)

initMaxElementID

protected void initMaxElementID()

doActivate

protected void doActivate()
                   throws java.lang.Exception
Overrides:
doActivate in class Lifecycle
Throws:
java.lang.Exception

doDeactivate

protected void doDeactivate()
                     throws java.lang.Exception
Overrides:
doDeactivate in class Lifecycle
Throws:
java.lang.Exception

Copyright (c) 2004 - 2008 Eike Stepper, Germany.
All Rights Reserved.