|
Project JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.impl.peergroup.NullConfigurator
public class NullConfigurator
A minimal Platform Configurator. This implementation can load a configuration from an existing PlatformConfig file and also save a configuration to the PlatformConfig file.
This configurator provides no explict validation of the PlatformConfig as it is read from the file (Some is done by the PlatformConfig class) and provides no mechanism for reconfiguration. The NullConfigurator provides a useful base implementation for extending your own Configurator and also provides the minimal implementation needed for applications which perform their own configuration.
Nested Class Summary | |
---|---|
(package private) static class |
NullConfigurator.ProxyAuthenticator
inner class to be used when a proxy user/pass is set |
Field Summary | |
---|---|
protected PlatformConfig |
advertisement
The platform config |
protected File |
configFile
The file in which contains the platform configurtation. |
protected static String |
CONFIGFILENAME
File name into which we will store the platform configuration. |
protected File |
jxtaHomeDir
The directory in which the configuration files will reside. |
protected File |
propertiesFile
The file in which contains the configurtation properties. |
protected static String |
PROPERTIESFILENAME
File name into which we will store various configuration properties. |
Constructor Summary | |
---|---|
NullConfigurator()
Constructor for the NullConfigurator object |
|
NullConfigurator(File homeDir)
|
Method Summary | |
---|---|
protected void |
adjustLog4JPriority()
Adjust the log4j priority based on the user's configuration file. |
ConfigParams |
getConfigParams()
|
URI |
getJXTAHome()
|
PlatformConfig |
getPlatformConfig()
Retrieve the associated PlatformConfig and
potentially reconfigure the parameters before returning. |
boolean |
isReconfigure()
Determine if a forced reconfiguration is set for the next call to PlatformConfigurator.getPlatformConfig() . |
ConfigParams |
load()
|
PlatformConfig |
load(File loadFile)
Persist the associated{ @link net.jxta.impl.protocol.PlatformConfig} to the specified location . |
boolean |
save()
|
boolean |
save(File saveFile)
Persist the associated{ @link net.jxta.impl.protocol.PlatformConfig} to the specified location . |
void |
setConfigParams(ConfigParams cp)
|
void |
setPlatformConfig(PlatformConfig config)
Sets the associated PlatformConfig . |
void |
setReconfigure(boolean reconfigure)
Sets the reconfiguration status to the specified status. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String CONFIGFILENAME
protected static final String PROPERTIESFILENAME
protected final File jxtaHomeDir
protected final File configFile
protected final File propertiesFile
protected PlatformConfig advertisement
Constructor Detail |
---|
public NullConfigurator() throws ConfiguratorException
ConfiguratorException
public NullConfigurator(File homeDir) throws ConfiguratorException
ConfiguratorException
Method Detail |
---|
public URI getJXTAHome()
getJXTAHome
in interface PlatformConfigurator
public PlatformConfig getPlatformConfig() throws ConfiguratorException
PlatformConfigurator
PlatformConfig
and
potentially reconfigure the parameters before returning.
getPlatformConfig
in interface PlatformConfigurator
ConfiguratorException
public final void setPlatformConfig(PlatformConfig config)
PlatformConfigurator
PlatformConfig
.
setPlatformConfig
in interface PlatformConfigurator
public ConfigParams getConfigParams() throws ConfiguratorException
getConfigParams
in interface Configurator
ConfiguratorException
public void setConfigParams(ConfigParams cp)
setConfigParams
in interface Configurator
public void setReconfigure(boolean reconfigure)
PlatformConfigurator
true
then reconfiguration will be forced the next time the
PlatformConfig
is retrieved.
setReconfigure
in interface PlatformConfigurator
reconfigure
- If true
then a forced reconfiguration
will occur the next time PlatformConfigurator.getPlatformConfig()
is called.public boolean isReconfigure()
PlatformConfigurator
PlatformConfigurator.getPlatformConfig()
.
isReconfigure
in interface PlatformConfigurator
true
if a forced reconfiguration
will occur the next time PlatformConfigurator.getPlatformConfig()
is called.public ConfigParams load() throws ConfiguratorException
load
in interface Configurator
ConfiguratorException
public PlatformConfig load(File loadFile) throws ConfiguratorException
location
.
load
in interface PlatformConfigurator
loadFile
- The file to which the configuration will be saved.
true
if the configuration was successfully saved
otherwise false
. If the parameters are not persisted then
false/code> is returned.
- Throws:
ConfiguratorException
public boolean save() throws ConfiguratorException
save
in interface Configurator
ConfiguratorException
public boolean save(File saveFile) throws ConfiguratorException
location
.
save
in interface PlatformConfigurator
saveFile
- The file to which the configuration will be saved.
true
if the configuration was successfully saved
otherwise false
. If the parameters are not persisted then
false/code> is returned.
- Throws:
ConfiguratorException
protected void adjustLog4JPriority()
|
JXTA J2SE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |