|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
util.PropertyResources
util.PropertyBundles
stella.parameter.AbstractParameter
stella.parameter.TargetList
public class TargetList
A parameter that is capable of resolving a list of parsed targets in its
get() method. Default action is to check if the #KEY_FILE
property is set. If so, the file is located via the inherited
ResourceSupplying.KEY_URLRESOURCES and the targets are loaded as
ParsedTargets into
an internal list during initialization.
This target is exit cleaning, meaning that the total list of targets hosted
by this parameter is dumped when the KEY_DUMP key is present.
In the current version, KEY_DUMP should point to a directory,
where all targets are dumped.
The parameter is reloadable in a sense that its properties might be changed, then restore target is called.
TargetList.TargetDump| Nested Class Summary | |
|---|---|
static class |
TargetList.Check
Checks the file given on the command line. |
static class |
TargetList.Invoke
Mainly used for parsing input-xml files and writing them as serialized targets. |
static class |
TargetList.TargetDump
A class that is a thread and dumps all of the targets registered at VM-exit to the scheduler to the dump directory. |
| Nested classes/interfaces inherited from class util.PropertyResources |
|---|
PropertyResources.URLResource |
| Field Summary | |
|---|---|
private Collection<ParsedTarget> |
alltargets
A list containing all targets, even those not wanted. |
private static boolean |
DEFIGNORESERIAL
Default ignore of serialized targtes. |
static String |
DEFNAME
The default name of the target list. |
private static String |
DEFURLRESOURCES
The default path for resource loccation. |
static String |
KEY_CHAINFILE
The file holding targets relevant only for chained targets. |
static String |
KEY_DUMP
The file holding target-xml file names. |
static String |
KEY_HISTORYDB
If present, the properties of the history database. |
static String |
KEY_IGNORESERIAL
If pointing to true, serialized versions are always ignored. |
static String |
KEY_REMOVE
The key to the comma-list of unwanted targets. |
static String |
KEY_STELLA
The telescope we work on. |
static String |
KEY_TARGETDB
If present, the properties of the target database. |
static String |
KEY_TARGETFILE
The file holding target-xml file names. |
private Collection<ParsedTarget> |
targets
A list of parsed targets used. |
| Fields inherited from class stella.parameter.AbstractParameter |
|---|
KEY_FORMAT, KEY_NAME, KEY_PRESERVE, UNKNOWN |
| Fields inherited from class util.PropertyBundles |
|---|
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES |
| Fields inherited from class util.PropertyResources |
|---|
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset |
| Fields inherited from class util.PropertyContainer |
|---|
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR |
| Fields inherited from interface stella.TargetProviding |
|---|
SERIAL, XML |
| Fields inherited from interface util.PropertySupplying |
|---|
CONFIG, KEY_CLASS |
| Fields inherited from interface util.ResourceSupplying |
|---|
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME |
| Constructor Summary | |
|---|---|
TargetList(Map<String,String> sprop)
Constructs a new target list parameter. |
|
| Method Summary | |
|---|---|
boolean |
add(Object dom)
Adds a new target to this scheduler. |
boolean |
addTarget(ParsedTarget dom)
Add a target to all targets. |
void |
clear()
Empties the targets hash map. |
void |
exit()
Exits this parameter. |
Object |
get()
Returns the Collection of targets currently handled by the
target list. |
Collection<ParsedTarget> |
getActiveTargets()
Returns all active targets. |
List<String> |
getAllNames()
Returns a set of all target names. |
Collection<ParsedTarget> |
getAllTargets()
Returns all targets known to this provider. |
Collection<ParsedTarget> |
getCompletedTargets()
Parsed Targets provide a complete flag. |
ParsedTarget |
getFromActive(String name)
Gets from all targets. |
ParsedTarget |
getFromAll(String name)
Gets from all targets. |
private ParsedTarget |
getTargetFromResource(String xmlname)
Returns a parsed document from a resource. |
void |
init()
The init section. |
private ParsedTarget |
parseTargetResource(URL xml,
URL serial)
Returns the newer of two versions. |
double |
reload()
Calls the super method and then restores my targets. |
boolean |
remove(TargetDefinition dom)
Removes the target-defining DOM from the scheduler, classified by its name. |
boolean |
removeTarget(ParsedTarget dom)
Removes the target-defining DOM from the scheduler, classified by its name. |
double |
rescanned(String key,
String old,
String newval)
Makes this method public, no further changes. |
private Collection<ParsedTarget> |
resolveFileTargets(List<String> files)
Reads the file indicated by the argument. |
boolean |
restore()
Restores all targets. |
boolean |
restoreTargets()
Restores all targets. |
Object |
set(Object list)
Loads a list of target definitions to this scheduler. |
| Methods inherited from class stella.parameter.AbstractParameter |
|---|
createParameter, delivers, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, register, setName, toString |
| Methods inherited from class util.PropertyBundles |
|---|
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource |
| Methods inherited from class util.PropertyResources |
|---|
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet |
| Methods inherited from class util.PropertyContainer |
|---|
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, removeProperty, setObject, setProperties, setProperty, stringProperties |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface util.PropertySupplying |
|---|
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties |
| Methods inherited from interface util.ResourceSupplying |
|---|
getResource, getResourceAsStream, getResources |
| Field Detail |
|---|
public static final String KEY_TARGETFILE
public static final String KEY_CHAINFILE
public static final String KEY_REMOVE
public static final String KEY_IGNORESERIAL
public static final String KEY_DUMP
public static final String KEY_HISTORYDB
public static final String KEY_TARGETDB
public static final String KEY_STELLA
public static final String DEFNAME
private static final String DEFURLRESOURCES
private static final boolean DEFIGNORESERIAL
private Collection<ParsedTarget> targets
private Collection<ParsedTarget> alltargets
| Constructor Detail |
|---|
public TargetList(Map<String,String> sprop)
init() section.
| Method Detail |
|---|
public void init()
KEY_TARGETFILE is set, the target list
is searched, read and passed to the resolveFileTargets(java.util.List)
method.
init in interface Initializableinit in class AbstractParameter
public double rescanned(String key,
String old,
String newval)
rescanned in interface Reloadablerescanned in class AbstractParameterpublic double reload()
reload in interface Reloadablereload in class PropertyContainerpublic Collection<ParsedTarget> getCompletedTargets()
getCompletedTargets in interface TargetProviding<ParsedTarget>HistoryAware,
Appointablepublic Collection<ParsedTarget> getAllTargets()
TargetProviding
getAllTargets in interface TargetProviding<ParsedTarget>public Collection<ParsedTarget> getActiveTargets()
TargetProvidingTargetProviding.getAllTargets().
getActiveTargets in interface TargetProviding<ParsedTarget>public boolean restore()
restore in interface TargetProviding<ParsedTarget>public boolean restoreTargets()
public void exit()
KEY_DUMP key points to a
directory, all targets hosted by this parameter are dumped as xml-files
into the specified directory.
exit in interface ExitCleaningexit in class AbstractParameterpublic Object set(Object list)
ParsedTargets.
Only these enter the final set.
set in interface Parameterpublic Object get()
Collection of targets currently handled by the
target list.
get in interface ParameterTargetDefinitions, or null.public ParsedTarget getFromAll(String name)
getFromAll in interface TargetProviding<ParsedTarget>public ParsedTarget getFromActive(String name)
getFromActive in interface TargetProviding<ParsedTarget>public boolean add(Object dom)
ParsedTarget.
It's priority is also retrieved and, if valid, added to the look-up
table matching priorities to target names. If the argument is
null false is returned.
target - An object that must be an instance of
ParsedTarget.
IllegalArgumentException - If the argument is not an instance of
ParsedTarget.public boolean addTarget(ParsedTarget dom)
TargetProviding
addTarget in interface TargetProviding<ParsedTarget>public boolean removeTarget(ParsedTarget dom)
removeTarget in interface TargetProviding<ParsedTarget>public boolean remove(TargetDefinition dom)
public void clear()
clear in interface TargetProviding<ParsedTarget>public List<String> getAllNames()
private Collection<ParsedTarget> resolveFileTargets(List<String> files)
ResourceSupplying.KEY_URLRESOURCES property is given, the files are assumed to
lie
underneath this dir.DOMTarget.parseTarget(java.lang.String, org.w3c.dom.Document, java.util.Map)
method.
The parsed documents are then returned in a target set.
file - An object of the file type
private ParsedTarget getTargetFromResource(String xmlname)
private ParsedTarget parseTargetResource(URL xml,
URL serial)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||