Class AbstractContributionRegistry<K,T>
- java.lang.Object
-
- org.nuxeo.runtime.contribution.impl.AbstractContributionRegistry<K,T>
-
- All Implemented Interfaces:
ContributionRegistry<K,T>
- Direct Known Subclasses:
LinkRegistry
,TypeRegistry
public abstract class AbstractContributionRegistry<K,T> extends Object implements ContributionRegistry<K,T>
The parent provider is read only. It is never modified by the registry. It serves only to resolve dependencies. This allows greater flexibility in managing dependencies. This registry may have a parent registry that can be used only read only.- Author:
- Bogdan Stefanescu
-
-
Field Summary
Fields Modifier and Type Field Description protected List<AbstractContributionRegistry<K,T>>
listeners
protected AbstractContributionRegistry<K,T>
parent
protected Map<Object,Contribution<K,T>>
registry
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractContributionRegistry()
protected
AbstractContributionRegistry(AbstractContributionRegistry<K,T> parent)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Contribution<K,T>
addFragment(K key, T fragment, K... superKeys)
protected void
applyFragment(T object, T fragment)
Applies fragment over the given object.protected void
applySuperFragment(T object, T superFragment)
protected abstract T
clone(T object)
void
dispose()
void
fireResolved(Contribution<K,T> contrib)
void
fireUnresolved(Contribution<K,T> contrib, T value)
void
fireUpdated(T oldValue, Contribution<K,T> contrib)
Contribution<K,T>
getContribution(K primaryKey)
T
getObject(K key)
Contribution<K,T>
getOrCreateDependency(K key)
ContributionRegistry<K,T>
getParent()
protected void
importContribution(Contribution<K,T> contrib)
protected void
importParentContributions()
protected abstract void
installContribution(K key, T object)
protected boolean
isMainFragment(T object)
void
removeContribution(K key)
void
removeFragment(K key, T fragment)
protected abstract void
uninstallContribution(K key, T object)
protected void
updateContribution(K key, T object, T oldValue)
-
-
-
Field Detail
-
registry
protected final Map<Object,Contribution<K,T>> registry
-
parent
protected final AbstractContributionRegistry<K,T> parent
-
listeners
protected final List<AbstractContributionRegistry<K,T>> listeners
-
-
Constructor Detail
-
AbstractContributionRegistry
protected AbstractContributionRegistry()
-
AbstractContributionRegistry
protected AbstractContributionRegistry(AbstractContributionRegistry<K,T> parent)
-
-
Method Detail
-
getParent
public ContributionRegistry<K,T> getParent()
- Specified by:
getParent
in interfaceContributionRegistry<K,T>
-
importParentContributions
protected void importParentContributions()
-
importContribution
protected void importContribution(Contribution<K,T> contrib)
-
getContribution
public Contribution<K,T> getContribution(K primaryKey)
- Specified by:
getContribution
in interfaceContributionRegistry<K,T>
-
removeContribution
public void removeContribution(K key)
- Specified by:
removeContribution
in interfaceContributionRegistry<K,T>
-
removeFragment
public void removeFragment(K key, T fragment)
- Specified by:
removeFragment
in interfaceContributionRegistry<K,T>
-
addFragment
public Contribution<K,T> addFragment(K key, T fragment, K... superKeys)
- Specified by:
addFragment
in interfaceContributionRegistry<K,T>
-
getOrCreateDependency
public Contribution<K,T> getOrCreateDependency(K key)
-
fireUnresolved
public void fireUnresolved(Contribution<K,T> contrib, T value)
-
fireResolved
public void fireResolved(Contribution<K,T> contrib)
-
fireUpdated
public void fireUpdated(T oldValue, Contribution<K,T> contrib)
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceContributionRegistry<K,T>
-
applyFragment
protected void applyFragment(T object, T fragment)
Applies fragment over the given object.
-
isMainFragment
protected boolean isMainFragment(T object)
-
-