|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectplanet.generic.commonapi.GenericApp
This class only attemps to help to programmers make more simple the initialization of the
required context of new applications. Are two ways to initialize the context:
One
The new application must extends this GenericApp and includes in theirs constructors the
sentence super() or super(factoriesProperties,simProperties,kbrProperties).
For example:
public NewTest() throws InitializationException {
super(factoriesProperties,simProperties,kbrProperties);
where parameters of super() constructor are the path to specified files.
Two
Includes theese lines before anything that make reference to the network and the simulator and ...
Properties.init(factoriesProperties,simProperties,kbrProperties);
GenericFactory.init();
where parameters of init() method are the path to specified files.
Constructor Summary | |
GenericApp()
Make required initialization on the context of the application. |
|
GenericApp(java.lang.String factoriesProperties,
java.lang.String simProperties,
java.lang.String kbrProperties)
Make required initialization on the context of the application. |
|
GenericApp(java.lang.String factoriesProperties,
java.lang.String simProperties,
java.lang.String kbrProperties,
java.lang.String dhtProperties)
Make required initialization on the context of the application. |
|
GenericApp(java.lang.String factoriesProperties,
java.lang.String simProperties,
java.lang.String kbrProperties,
java.lang.String dhtProperties,
java.lang.String behProperties)
Make required initialization on the context of the application. |
Method Summary | |
static java.lang.String |
timeElapsedInSeconds(long firstTime,
long lastTime)
Shows in Y.XXX string format, the seconds elapsed between firstTime and lastTime, where 'Y' are the seconds, and 'XXX' the milliseconds ones. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GenericApp() throws InitializationException
Properties.init("../conf/factories.properties","../conf/sim.properties","../conf/chord.properties"); GenericFactory.init();Because of theese lines, the new application must be executed under bin directory.
InitializationException
- if any error has occurred during initialization of the context.public GenericApp(java.lang.String factoriesProperties, java.lang.String simProperties, java.lang.String kbrProperties) throws InitializationException
Properties.init(factoriesProperties,simProperties,kbrProperties); GenericFactory.init();Because of theese lines, the new application must be executed under the implicitly specified directory by the parameters files.
factoriesProperties
- Path to properties file of factories attributes.simProperties
- Path to properties file of simulator attributes.kbrProperties
- Path to properties file of chord attributes.
InitializationException
- if any error has occurred during initialization of the context.public GenericApp(java.lang.String factoriesProperties, java.lang.String simProperties, java.lang.String kbrProperties, java.lang.String dhtProperties) throws InitializationException
Properties.init(factoriesProperties,simProperties,chordProperties); GenericFactory.init();Because of theese lines, the new application must be executed under the implicitly specified directory by the parameters files.
factoriesProperties
- Path to properties file of factories attributes.simProperties
- Path to properties file of simulator attributes.kbrProperties
- Path to properties file of kbr attributes.dhtProperties
- Path to properties file of dht attributes.
InitializationException
- if any error has occurred during initialization of the context.public GenericApp(java.lang.String factoriesProperties, java.lang.String simProperties, java.lang.String kbrProperties, java.lang.String dhtProperties, java.lang.String behProperties) throws InitializationException
Properties.init(factoriesProperties,simProperties,chordProperties); GenericFactory.init();Because of theese lines, the new application must be executed under the implicitly specified directory by the parameters files.
factoriesProperties
- Path to properties file of factories attributes.simProperties
- Path to properties file of simulator attributes.kbrProperties
- Path to properties file of kbr attributes.dhtProperties
- Path to properties file of dht attributes.behProperties
- Paht to properties file of behaviours attributes
InitializationException
- if any error has occurred during initialization of the context.Method Detail |
public static java.lang.String timeElapsedInSeconds(long firstTime, long lastTime)
firstTime
- First logged time.lastTime
- Second logged time.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |