|
Project JXTA | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.ext.config.AbstractConfigurator
An abstract PlatformConfigurator
implementation that provides
application callbacks for PlatformConfig
generation and
update prior to Platform startup. The default backing configurator is
ext:config Configurator
that is overridable via a constructor.
Applications can register their implementation with the Platform in addition
to adding application specific resources that will be copied to the
JXTA_HOME prior to startup.
Nested Class Summary | |
(package private) static class |
AbstractConfigurator.ConfiguratorWrapper
|
Field Summary | |
static String |
JXTA_PROPERTIES_KEY
jxta.properties resource name. |
static String |
PROFILE_KEY
ext:config profile resource name. |
Constructor Summary | |
AbstractConfigurator(PlatformConfigurator configurator)
Constructor which overrides the backing Configurator . |
Method Summary | |
static String |
addResource(String key,
String value)
Deprecated. resource management will be moved to instance members. |
static void |
addResources(Map resources)
Deprecated. resource management will be moved to instance members. |
static Map |
clearResources()
Deprecated. resource management will be moved to instance members. |
abstract PlatformConfig |
createPlatformConfig(PlatformConfigurator configurator)
Application callback invoked upon registered Configurators
prior to Platform startup when a newly created
PlatformConfig is required.
|
ConfigParams |
getConfigParams()
|
URI |
getJXTAHome()
|
PlatformConfig |
getPlatformConfig()
Retrieve the associated PlatformConfig and
potentially reconfigure the parameters before returning. |
static String |
getResource(String key)
Deprecated. resource management will be moved to instance members. |
static Iterator |
getResourceKeys()
Deprecated. resource management will be moved to instance members. |
boolean |
isReconfigure()
Determine if a forced reconfiguration is set for the next call to PlatformConfigurator.getPlatformConfig() . |
ConfigParams |
load()
|
PlatformConfig |
load(File pc)
Persist the associated{ @link net.jxta.impl.protocol.PlatformConfig} to the specified location . |
static void |
register(Class configurator)
Registers a delgate Configurator class with the Platform
that will manage configuration resources. |
static String |
removeResource(String key)
Deprecated. resource management will be moved to instance members. |
boolean |
save()
|
boolean |
save(File f)
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. If true then reconfiguration will be forced the next time the
PlatformConfig is retrieved. |
PlatformConfig |
updatePlatformConfig(PlatformConfigurator configurator)
Application callback invoked upon registered Configurators
prior to Platform startup.
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String PROFILE_KEY
public static final String JXTA_PROPERTIES_KEY
Constructor Detail |
public AbstractConfigurator(PlatformConfigurator configurator)
Configurator
.
configurator
- configurator delegateMethod Detail |
public static void register(Class configurator)
Configurator
class with the Platform
that will manage configuration resources.
configurator
- public static Iterator getResourceKeys()
public static String getResource(String key)
key
- resource key
public static String addResource(String key, String value)
key
- resource keyvalue
- resource value
public static void addResources(Map resources)
resources
- resource mappublic static String removeResource(String key)
key
- resource key
public static Map clearResources()
public abstract PlatformConfig createPlatformConfig(PlatformConfigurator configurator) throws ConfiguratorException
Configurators
prior to Platform startup when a newly created
PlatformConfig is required.
A ConfiguratorException
will be thrown in the event the
manufactured PlatformConfig
is invalid.
- Parameters:
configurator
- delegate Configurator
- Returns:
- PlatformConfig generated PlatformConfig
- Throws:
ConfiguratorException
public PlatformConfig updatePlatformConfig(PlatformConfigurator configurator) throws ConfiguratorException
Configurators
prior to Platform startup.
A ConfiguratorException
will be thrown in the event the
manufactured PlatformConfig
is invalid.
configurator
- delegate Configurator
ConfiguratorException
public URI getJXTAHome()
getJXTAHome
in interface PlatformConfigurator
public PlatformConfig getPlatformConfig() throws ConfiguratorException
PlatformConfig
and
potentially reconfigure the parameters before returning.
getPlatformConfig
in interface PlatformConfigurator
ConfiguratorException
public void setPlatformConfig(PlatformConfig config)
PlatformConfig
.
setPlatformConfig
in interface PlatformConfigurator
config
- public ConfigParams getConfigParams() throws ConfiguratorException
getConfigParams
in interface Configurator
ConfiguratorException
public void setConfigParams(ConfigParams cp)
setConfigParams
in interface Configurator
public void setReconfigure(boolean reconfigure)
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 ConfigParams load() throws ConfiguratorException
load
in interface Configurator
ConfiguratorException
public PlatformConfig load(File pc) throws ConfiguratorException
location
.
load
in interface PlatformConfigurator
pc
- 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 isReconfigure()
PlatformConfigurator.getPlatformConfig()
.
isReconfigure
in interface PlatformConfigurator
true
if a forced reconfiguration
will occur the next time PlatformConfigurator.getPlatformConfig()
is called.public boolean save() throws ConfiguratorException
save
in interface Configurator
ConfiguratorException
public boolean save(File f) throws ConfiguratorException
location
.
save
in interface PlatformConfigurator
f
- 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
|
JXTA J2SE | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |