public class ConditionsManagerImplementation extends ConditionsManager
ConditionsManager.ConditionsNotFoundException, ConditionsManager.ConditionsSetNotFoundException
Modifier and Type | Field and Description |
---|---|
protected Map<String,CachedConditions> |
cache |
protected Map<Class,ConditionsConverter> |
converters |
protected String |
detectorName |
protected List<ConditionsListener> |
listenerList |
protected static Logger |
logger |
protected ConditionsReader |
reader |
protected int |
run |
Modifier | Constructor and Description |
---|---|
protected |
ConditionsManagerImplementation()
The default implementation of ConditionsManager.
|
Modifier and Type | Method and Description |
---|---|
void |
addConditionsListener(ConditionsListener l)
Add a listener to be notified about changes to ANY conditions.
|
protected void |
clearCache() |
protected void |
fireConditionsChanged() |
<T> CachedConditions<T> |
getCachedConditions(Class<T> type,
String name)
Access conditions converted to a java object using a conditions
converter.
|
ConditionsSet |
getConditions(String name)
Get the conditions associated with the given name.
|
protected ConditionsReader |
getConditionsReader() |
String |
getDetector()
Get the current detector name
|
RawConditions |
getRawConditions(String name)
Get an input stream to directly read raw conditions from the database.
|
int |
getRun()
Get the current run number.
|
protected InputStream |
open(String name,
String type) |
void |
registerConditionsConverter(ConditionsConverter conv)
Adds a conditions converter.
|
void |
removeConditionsConverter(ConditionsConverter conv)
Removes a conditions converter.
|
void |
removeConditionsListener(ConditionsListener l)
Remove a global change listener.
|
void |
setConditionsReader(ConditionsReader newReader,
String name) |
void |
setDetector(String detectorName,
int run)
Normally called automatically by the framework to set the detector name
and run number,
|
void |
setRun(int run)
Set the current run number.
|
defaultInstance, isSetup, setDefaultConditionsManager
protected Map<Class,ConditionsConverter> converters
protected Map<String,CachedConditions> cache
protected ConditionsReader reader
protected String detectorName
protected int run
protected List<ConditionsListener> listenerList
protected static final Logger logger
protected ConditionsManagerImplementation()
public void setDetector(String detectorName, int run) throws ConditionsManager.ConditionsNotFoundException
ConditionsManager
setDetector
in class ConditionsManager
detectorName
- The current detector name.run
- The current run number.ConditionsManager.ConditionsNotFoundException
- If the conditions associated with this detector/run number
can not be found.public void setConditionsReader(ConditionsReader newReader, String name)
public void removeConditionsConverter(ConditionsConverter conv)
ConditionsManager
removeConditionsConverter
in class ConditionsManager
conv
- The converter to remove.public void registerConditionsConverter(ConditionsConverter conv)
ConditionsManager
registerConditionsConverter
in class ConditionsManager
conv
- The converter to add.public <T> CachedConditions<T> getCachedConditions(Class<T> type, String name) throws ConditionsManager.ConditionsSetNotFoundException
ConditionsManager
getCachedConditions
in class ConditionsManager
type
- The type of conditions requested (used to select an
appropriate conditions converter).name
- The name of the conditions requested.ConditionsManager.ConditionsSetNotFoundException
- If the specified conditions can not be found.public void setRun(int run)
ConditionsManager
setRun
in class ConditionsManager
run
- The current run numberpublic int getRun()
ConditionsManager
getRun
in class ConditionsManager
public String getDetector()
ConditionsManager
getDetector
in class ConditionsManager
public void addConditionsListener(ConditionsListener l)
ConditionsManager
addConditionsListener
in class ConditionsManager
l
- The listener to add.public void removeConditionsListener(ConditionsListener l)
ConditionsManager
removeConditionsListener
in class ConditionsManager
l
- The listener to remove.protected void fireConditionsChanged()
protected InputStream open(String name, String type) throws IOException
IOException
public ConditionsSet getConditions(String name) throws ConditionsManager.ConditionsSetNotFoundException
ConditionsManager
getConditions
in class ConditionsManager
name
- The name of the conditions to search for.ConditionsManager.ConditionsSetNotFoundException
- If the named conditions can not be found.public RawConditions getRawConditions(String name) throws ConditionsManager.ConditionsSetNotFoundException
ConditionsManager
getRawConditions
in class ConditionsManager
name
- The name of the conditions requested.ConditionsManager.ConditionsSetNotFoundException
- If the requested conditions can not be found.protected ConditionsReader getConditionsReader()
protected void clearCache()
Copyright © 2016 Linear Collider Detector (LCD). All rights reserved.