|
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.
Field Summary | |
---|---|
protected PlatformConfig |
advertisement
The platform config |
protected URI |
configFile
The file in which contains the platform configurtation. |
protected URI |
jxtaHome
The location in which the configuration files will reside. |
Constructor Summary | |
---|---|
NullConfigurator(URI homeRoot)
Constructor for the NullConfigurator |
Method Summary | |
---|---|
ConfigParams |
getConfigParams()
Retrieve the parameters associated with this configuration from the default location. |
PlatformConfig |
getPlatformConfig()
Retrieve the associated PlatformConfig and
potentially performing any required configuration of the parameters
before returning. |
boolean |
isReconfigure()
Determine if a forced reconfiguration is set for the next call to PlatformConfigurator.getPlatformConfig() . |
ConfigParams |
load()
Retrieves the persisted parameters associated with this configuration from the standard location. |
protected PlatformConfig |
load(URI loadFile)
Deprecated. Loading of existing configuration is best accomplished by use of specific constructors of the implementing configurator. This method complicates the state management of configuration parameters and may have unpredictable results depending upon the constructor and configuration set methods used prior to it's execution. |
boolean |
save()
Persist the parameters associated with this configuration to the standard location. |
protected boolean |
save(URI saveFile)
Persist the parameters associated with this configuration to the specified location. |
void |
setConfigParams(ConfigParams cp)
Sets the parameters associated with this configuration object to the provided values. |
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 final URI jxtaHome
protected final URI configFile
protected PlatformConfig advertisement
Constructor Detail |
---|
public NullConfigurator(URI homeRoot) throws ConfiguratorException
homeRoot
- The location in which the configuration files will reside.
ConfiguratorException
- If there is a problem accessing the configuration information.Method Detail |
---|
public PlatformConfig getPlatformConfig() throws ConfiguratorException
PlatformConfigurator
PlatformConfig
and
potentially performing any required configuration of the parameters
before returning.
getPlatformConfig
in interface PlatformConfigurator
ConfiguratorException
- If configuration error
occurs.public final void setPlatformConfig(PlatformConfig config)
PlatformConfigurator
PlatformConfig
.
setPlatformConfig
in interface PlatformConfigurator
config
- the configurationpublic ConfigParams getConfigParams() throws ConfiguratorException
net.jxta.peergroup.Configurator
getConfigParams
in interface Configurator
ConfiguratorException
- If there was a failure in retrieving the
parameters. This is normally a chained exception to the underlying
cause.public void setConfigParams(ConfigParams cp)
net.jxta.peergroup.Configurator
setConfigParams
in interface Configurator
cp
- The parameters to be associated with this configuration.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
- If there was a failure in retrieving the
persisted parameters. This is normally a chained exception to the
underlying cause.@Deprecated protected PlatformConfig load(URI loadFile) throws ConfiguratorException
loadFile
- The location from which the configuration data should be
loaded.
ConfiguratorException
- If there was a failure in retrieving the
persisted parameters. This is normally a chained exception to the
underlying cause.public boolean save() throws ConfiguratorException
save
in interface Configurator
true
if the configuration was successfully saved
otherwise false
. If the parameters are not persisted then
false/code> is returned.
- Throws:
ConfiguratorException
- If there was a failure in persisting the
parameters. This is normally a chained exception to the underlying
cause.
protected boolean save(URI saveFile) throws ConfiguratorException
saveFile
- The location to which the configuration should be saved.
true
if the configuration was successfully saved
otherwise false
. If the parameters are not persisted then
false/code> is returned.
- Throws:
ConfiguratorException
- If there was a failure in persisting the
parameters. This is normally a chained exception to the underlying
cause.
|
JXSE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |