|
copyright The Portico Project 2008. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.portico.lrc.LRCConfigurator
public class LRCConfigurator
This class is responsible for initializing and configuring the LRC
according to the
configuration file and any loaded plugins. See the configure(LRC)
method for more
informationa regarding what happens during this process.
initializeSinks(LRC)
) processRid(LRC)
) processUserConfiguration(LRC)
)
Field Summary | |
---|---|
private org.apache.log4j.Logger |
logger
|
Constructor Summary | |
---|---|
LRCConfigurator()
|
Method Summary | |
---|---|
private void |
bootstrapLogging()
This method will initialize and configure the logging properties for the LRC. |
void |
configure(LRC theLRC)
This method will do the following: Initialize the LRC sinks with the default configuration Looks for any plugins and processed any configurations found in them Apply any user configuration (from any file pointed to by the system property LRCProperties.PROP_CONFIG if it exists - does nothing if it doesn't)
Creates and configures the connection
The user configuration is applied last so that it can override any settings provided by the
default or plugin configurations. |
private void |
createConnection(LRC theLRC)
This method will create the connection for the LRC. |
private String |
findUserConfiguration()
This method will attempt to locate a user configuratoin file on the local filesystem. |
private com.lbf.commons.messaging.ModuleGroup |
getModules(com.lbf.commons.config.xml.XMLSource configuration)
Process the given configuration element for any modules. |
private void |
initializeSinks(LRC theLRC)
Applies the default configuration. |
protected boolean |
processConfiguration(LRC theLRC,
com.lbf.commons.config.xml.XMLSource xsource)
Attempts to apply the configuration in the given XMLSource to the given LRC . |
private void |
processRid(LRC theLRC)
This method will look for a configuration file at the location specified in the environment variable RTI_RID_FILE, and if that does not exist, the path given in the PorticoConstants.DEFAULT_RTI_RID variable will be checked. |
private void |
processUserConfiguration(LRC theLRC)
Attempts to apply any user configuration to the given LRC . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private org.apache.log4j.Logger logger
Constructor Detail |
---|
public LRCConfigurator()
Method Detail |
---|
public void configure(LRC theLRC) throws JRTIinternalError
LRCProperties.PROP_CONFIG
if it exists - does nothing if it doesn't)JRTIinternalError
is thrown.
JRTIinternalError
private void bootstrapLogging()
LRCProperties.PROP_LOGLEVEL
system property and setting it to any valid log4j
level string (TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF)
private void initializeSinks(LRC theLRC) throws JRTIinternalError
LRCProperties.PROP_IDC
property is set to
true
, this method will not execute.
Here we initialize the LRC
message sinks using the appropriate modules for the HLA
specification version that is being used by the federate.
JRTIinternalError
private com.lbf.commons.messaging.ModuleGroup getModules(com.lbf.commons.config.xml.XMLSource configuration) throws com.lbf.commons.config.ConfigurationException
com.lbf.commons.config.ConfigurationException
protected boolean processConfiguration(LRC theLRC, com.lbf.commons.config.xml.XMLSource xsource) throws JRTIinternalError
LRC
.
JRTIinternalError
private void processUserConfiguration(LRC theLRC) throws JRTIinternalError
LRC
. It will search for a
user configuration using the findUserConfiguration()
method. Only files that are
only the location file system will be considered. See findUserConfiguration()
for
information on where it looks.
Files can be either a valid XML LRC configuration file, or a standard java properties file
JRTIinternalError
private String findUserConfiguration()
lrc.configuration
. If that property is set, the value is used as the location
of the file. If the property isn't set, then the default value is used. The default value is
./lrc.configuration
.
If the file exists, its location is returned from the method, if it doesn't, null is
returned.
private void processRid(LRC theLRC) throws JRTIinternalError
PorticoConstants.DEFAULT_RTI_RID
variable will be checked.
This should be applied to the LRC after the plug-in configuration, but before the user
configuration. If the file doesn't exist, nothing will happen and the method will return.
If the file does exist, and it contains errors, it will throw a JRTIinternalError
.
theLRC
- Apply the configuration data in the rid to this LRC
JRTIinternalError
- If the config file exists, but contains errorsprivate void createConnection(LRC theLRC) throws JRTIinternalError
LRCProperties.PROP_CONNECTION
for the implementation class. If found, it will
attempt to create and configuration an instance of that class. If not found, it will use
the default value from LRCProperties.DEFAULT_CONNECT
.
NOTE: The connection implementation class must extend the LRCConnection
abstract class.
JRTIinternalError
|
copyright The Portico Project 2008. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |