|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.util.DeepObject
com.threerings.config.ManagedConfig
public abstract class ManagedConfig
Represents a configuration managed by the ConfigManager.
| Field Summary | |
|---|---|
protected ConfigManager |
_cfgmgr
The config manager that we use to resolve references. |
protected WeakObserverList<ConfigUpdateListener<ManagedConfig>> |
_listeners
The list of listeners to notify on change or removal. |
protected String |
_name
The name of this configuration. |
protected ArrayList<ManagedConfig> |
_updateConfigs
The list of configs to which we are listening for updates. |
protected HashSet<String> |
_updateResources
The list of resources to which we are listening for modifications. |
| Constructor Summary | |
|---|---|
ManagedConfig()
|
|
| Method Summary | |
|---|---|
void |
addListener(ConfigUpdateListener listener)
Adds a listener to notify on updates. |
protected void |
addUpdateDependencies()
Resolves the update dependencies and subscribes to them. |
protected void |
clearUpdateDependencies()
Unsubscribes from the update dependencies. |
void |
configUpdated(ConfigEvent<ManagedConfig> event)
Called when a configuration has been updated. |
protected void |
fireConfigUpdated()
Fires a configuration updated event. |
ConfigManager |
getConfigManager()
Returns a reference to the config manager to use when resolving references within this config. |
ManagedConfig |
getInstance(ArgumentMap args)
Returns the derived instance with the supplied arguments. |
ManagedConfig |
getInstance(Scope scope)
Returns the derived instance in the specified scope. |
ManagedConfig |
getInstance(Scope scope,
ArgumentMap args)
Returns the derived instance in the specified scope with the supplied arguments. |
ManagedConfig |
getInstance(Scope scope,
String firstKey,
Object firstValue,
Object... otherArgs)
Returns the derived instance in the specified scope with the supplied arguments. |
ManagedConfig |
getInstance(String firstKey,
Object firstValue,
Object... otherArgs)
Returns the derived instance with the supplied arguments. |
String |
getName()
Returns the name of this configuration. |
ConfigReference<? extends ManagedConfig> |
getReference()
Returns a reference to this configuration based on its name and arguments. |
protected void |
getUpdateReferences(ConfigReferenceSet refs)
Collects all of the references within this config to configs that, when updated, should trigger a call to fireConfigUpdated(). |
protected void |
getUpdateResources(HashSet<String> paths)
Collects the paths of all resources referenced by this config that, when modified, should trigger a call to fireConfigUpdated(). |
void |
init(ConfigManager cfgmgr)
Initializes this config with a reference to the config manager that it should use to resolve references. |
protected void |
maybeFireOnConfigManager()
Fires a configuration updated event on the config manager if appropriate. |
void |
removeListener(ConfigUpdateListener listener)
Removes a listener from the list. |
void |
resourceModified(String path,
long lastModified)
|
void |
setName(String name)
Sets the name of this configuration. |
void |
updateFromSource(EditorContext ctx,
boolean force)
Updates this configuration from its external source, if any. |
void |
validateOuters(String where)
Validates the outer object references in this config. |
boolean |
validateReferences(String where,
PrintStream out)
Validates the references in this config. |
void |
wasUpdated()
Notes that this configuration has been updated. |
| Methods inherited from class com.threerings.util.DeepObject |
|---|
clone, copy, copy, equals, hashCode, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected String _name
@DeepOmit protected transient ConfigManager _cfgmgr
@DeepOmit protected transient WeakObserverList<ConfigUpdateListener<ManagedConfig>> _listeners
@DeepOmit protected transient ArrayList<ManagedConfig> _updateConfigs
@DeepOmit protected transient HashSet<String> _updateResources
| Constructor Detail |
|---|
public ManagedConfig()
| Method Detail |
|---|
public void setName(String name)
public String getName()
public ConfigReference<? extends ManagedConfig> getReference()
public ConfigManager getConfigManager()
public ManagedConfig getInstance(String firstKey,
Object firstValue,
Object... otherArgs)
public ManagedConfig getInstance(Scope scope,
String firstKey,
Object firstValue,
Object... otherArgs)
public ManagedConfig getInstance(Scope scope)
public ManagedConfig getInstance(ArgumentMap args)
public ManagedConfig getInstance(Scope scope,
ArgumentMap args)
public void addListener(ConfigUpdateListener listener)
public void removeListener(ConfigUpdateListener listener)
public void init(ConfigManager cfgmgr)
public void updateFromSource(EditorContext ctx,
boolean force)
force - if true, reload the source data even if it has already been loaded.public void wasUpdated()
public boolean validateReferences(String where,
PrintStream out)
public void validateOuters(String where)
public void configUpdated(ConfigEvent<ManagedConfig> event)
ConfigUpdateListener
configUpdated in interface ConfigUpdateListener<ManagedConfig>
public void resourceModified(String path,
long lastModified)
resourceModified in interface ResourceManager.ModificationObserverprotected void getUpdateReferences(ConfigReferenceSet refs)
fireConfigUpdated().
protected void getUpdateResources(HashSet<String> paths)
fireConfigUpdated().
protected void fireConfigUpdated()
protected void maybeFireOnConfigManager()
protected void addUpdateDependencies()
protected void clearUpdateDependencies()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||