Class ContributionImpl<K,T>
- java.lang.Object
-
- org.nuxeo.runtime.contribution.impl.ContributionImpl<K,T>
-
- All Implemented Interfaces:
Iterable<T>
,Contribution<K,T>
public class ContributionImpl<K,T> extends Object implements Contribution<K,T>
- Author:
- Bogdan Stefanescu
-
-
Field Summary
Fields Modifier and Type Field Description protected Set<Contribution<K,T>>
dependencies
protected Set<Contribution<K,T>>
dependents
protected List<T>
fragments
protected boolean
isResolved
protected List<T>
mainFragments
protected K
primaryKey
protected AbstractContributionRegistry<K,T>
registry
protected T
value
-
Constructor Summary
Constructors Constructor Description ContributionImpl(AbstractContributionRegistry<K,T> reg, K primaryKey)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFragment(T fragment, K... superKeys)
protected boolean
checkIsResolved()
boolean
equals(Object obj)
Set<Contribution<K,T>>
getDependencies()
Set<Contribution<K,T>>
getDependents()
T
getFragment(int index)
K
getId()
ContributionRegistry<K,T>
getRegistry()
Set<Contribution<K,T>>
getUnresolvedDependencies()
T
getValue()
int
hashCode()
boolean
isEmpty()
boolean
isPhantom()
boolean
isRegistered()
boolean
isResolved()
Iterator<T>
iterator()
boolean
removeFragment(Object fragment)
void
resolve()
int
size()
String
toString()
void
unregister()
void
unresolve()
protected void
update()
Called each time a fragment is added or removed to update resolved state and to fire update notifications to the registry owning that contribution-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
registry
protected final AbstractContributionRegistry<K,T> registry
-
primaryKey
protected final K primaryKey
-
dependencies
protected final Set<Contribution<K,T>> dependencies
-
dependents
protected final Set<Contribution<K,T>> dependents
-
value
protected T value
-
isResolved
protected boolean isResolved
-
-
Constructor Detail
-
ContributionImpl
public ContributionImpl(AbstractContributionRegistry<K,T> reg, K primaryKey)
-
-
Method Detail
-
getRegistry
public ContributionRegistry<K,T> getRegistry()
- Specified by:
getRegistry
in interfaceContribution<K,T>
-
getId
public K getId()
- Specified by:
getId
in interfaceContribution<K,T>
- Returns:
- the primaryKey.
-
getDependencies
public Set<Contribution<K,T>> getDependencies()
- Specified by:
getDependencies
in interfaceContribution<K,T>
-
getDependents
public Set<Contribution<K,T>> getDependents()
- Specified by:
getDependents
in interfaceContribution<K,T>
-
getUnresolvedDependencies
public Set<Contribution<K,T>> getUnresolvedDependencies()
- Specified by:
getUnresolvedDependencies
in interfaceContribution<K,T>
-
checkIsResolved
protected boolean checkIsResolved()
-
size
public int size()
- Specified by:
size
in interfaceContribution<K,T>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceContribution<K,T>
-
getFragment
public T getFragment(int index)
- Specified by:
getFragment
in interfaceContribution<K,T>
-
removeFragment
public boolean removeFragment(Object fragment)
- Specified by:
removeFragment
in interfaceContribution<K,T>
-
addFragment
public void addFragment(T fragment, K... superKeys)
- Specified by:
addFragment
in interfaceContribution<K,T>
-
getValue
public T getValue()
- Specified by:
getValue
in interfaceContribution<K,T>
-
isPhantom
public boolean isPhantom()
- Specified by:
isPhantom
in interfaceContribution<K,T>
-
isResolved
public boolean isResolved()
- Specified by:
isResolved
in interfaceContribution<K,T>
-
isRegistered
public boolean isRegistered()
- Specified by:
isRegistered
in interfaceContribution<K,T>
-
update
protected void update()
Called each time a fragment is added or removed to update resolved state and to fire update notifications to the registry owning that contribution
-
unregister
public void unregister()
- Specified by:
unregister
in interfaceContribution<K,T>
-
unresolve
public void unresolve()
- Specified by:
unresolve
in interfaceContribution<K,T>
-
resolve
public void resolve()
- Specified by:
resolve
in interfaceContribution<K,T>
-
-