T - public abstract class TieableRepository<T extends Tieable,S extends IStats> extends Object implements IProducerRegistryListener<S>, IUpdateable
| Constructor and Description |
|---|
TieableRepository() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addToAutoTie(T tieable,
IStatsProducer<?> producer) |
protected void |
addUntied(T t) |
protected void |
attachToListener(T t) |
protected void |
cleanup()
cleans the internal state maps.
|
protected abstract T |
create(TieableDefinition def) |
T |
createTieable(TieableDefinition definition) |
protected void |
detachFromListener(T t) |
T |
getById(String id)
Returns the tieable with the corresponding id.
|
T |
getByName(String name) |
List<String> |
getIdsByProducerId(String producerId) |
protected IProducerRegistry |
getRegistry() |
List<T> |
getTieables() |
void |
notifyProducerRegistered(IStatsProducer<S> producer)
Called whenever a new producer is registered.
|
void |
notifyProducerUnregistered(IStatsProducer<S> producer)
Called whenever a producer is unregistered.
|
void |
removeById(String id) |
void |
removeTieable(String name)
Removes previously added tieable by name.
|
void |
removeTieable(TieableDefinition def) |
protected abstract boolean |
tie(T t,
IStatsProducer<? extends IStats> to) |
void |
update()
This method will be called if an update occures.
|
protected void addUntied(T t)
protected void addToAutoTie(T tieable, IStatsProducer<?> producer)
public void notifyProducerRegistered(IStatsProducer<S> producer)
IProducerRegistryListenernotifyProducerRegistered in interface IProducerRegistryListener<S extends IStats>public void notifyProducerUnregistered(IStatsProducer<S> producer)
IProducerRegistryListenernotifyProducerUnregistered in interface IProducerRegistryListener<S extends IStats>protected abstract boolean tie(T t, IStatsProducer<? extends IStats> to)
protected IProducerRegistry getRegistry()
protected void detachFromListener(T t)
protected void attachToListener(T t)
protected abstract T create(TieableDefinition def)
public T createTieable(TieableDefinition definition)
public void removeById(String id)
public void removeTieable(String name)
name - name of the tieable to remove.public void removeTieable(TieableDefinition def)
public void update()
IUpdateableupdate in interface IUpdateablepublic T getById(String id)
id - the internal id of the tieable.protected void cleanup()
Copyright © 2010-2017 anotheria.net. All Rights Reserved.