Class AbstractConfigurator
package: src.net.jxta.ext.config
public abstract class AbstractConfigurator
Implements:
net.jxta.impl.peergroup.PlatformConfigurator
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.
Author:
james todd [gonzo at jxta dot org]
Version:
$Id: AbstractConfigurator.java,v 1.2 2005/06/01 16:42:55 gonzo Exp $
created:
2004.11.14
Inner Class Summary
final class
 
Field Summary
private final static String
private final static String
public final static String
   jxta.properties resource name.
 
private final static Logger
public final static String
   ext:config profile resource name.
 
private final static Map
Constructor Summary
public
public
   Constructor which overrides the backing Configurator.
 
Method Summary
public static String
addResource(String key, String value)
   Resource setter.
 
public static void
addResources(Map resources)
   Resource setter.
 
public static Map
   Resource clearer.
 
public abstract PlatformConfig
   Application callback invoked upon registered Configurators prior to Platform startup when a newly created PlatformConfig is required.
 
public ConfigParams
   {@inheritDoc}
 
public URI
   {@inheritDoc}
 
private File
   {@inheritDoc}
 
public static String
getResource(String key)
   Resource accessor.
 
public static Iterator
   Resource key iterator.
 
public boolean
   {@inheritDoc}
 
public ConfigParams
   {@inheritDoc}
 
load(File pc)
   {@inheritDoc}
 
private void
public static void
register(Class configurator)
   Registers a delgate Configurator class with the Platform that will manage configuration resources.
 
public static String
removeResource(String key)
   Resource remover.
 
public boolean
   {@inheritDoc}
 
public boolean
save(File f)
   {@inheritDoc}
 
public void
setConfigParams(ConfigParams cp)
   {@inheritDoc}
 
public void
   {@inheritDoc}
 
public void
setReconfigure(boolean reconfigure)
   {@inheritDoc}
 
   Application callback invoked upon registered Configurators prior to Platform startup.
 
Field Detail
DEFAULT_JXTA_PROPERTIES
private final static String DEFAULT_JXTA_PROPERTIES = "/jxta.properties"

DEFAULT_PROFILE
private final static String DEFAULT_PROFILE = "/net/jxta/ext/config/resources/edge.xml"

JXTA_PROPERTIES_KEY
public final static String JXTA_PROPERTIES_KEY = "jxta.properties"
jxta.properties resource name.

LOG
private final static Logger LOG = Logger.getLogger(AbstractConfigurator.class.getName())

PROFILE_KEY
public final static String PROFILE_KEY = "profile.xml"
ext:config profile resource name.

resources
private final static Map resources = new HashMap()
Constructor Detail
AbstractConfigurator
public AbstractConfigurator()

AbstractConfigurator
public AbstractConfigurator(Configurator configurator)
Constructor which overrides the backing Configurator.
Parameters:
configurator configurator delegate
Method Detail
addResource
public static String addResource(String key, String value)
Resource setter.
Deprecated:
resource management will be moved to instance members.
Parameters:
key resource key
value resource value
Return:
previous keyed value or null

addResources
public static void addResources(Map resources)
Resource setter.
Deprecated:
resource management will be moved to instance members.
Parameters:
resources resource map

clearResources
public static Map clearResources()
Resource clearer.
Deprecated:
resource management will be moved to instance members.

createPlatformConfig
public abstract PlatformConfig createPlatformConfig(Configurator configurator)
Application callback invoked upon registered 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.
Throws:
ConfiguratorException
Parameters:
configurator delegate Configurator
Return:
PlatformConfig generated PlatformConfig

getConfigParams
public ConfigParams getConfigParams()
{@inheritDoc}
Throws:
ConfiguratorException

getJXTAHome
public URI getJXTAHome()
{@inheritDoc}

getJXTAHomeFile
private File getJXTAHomeFile()

getPlatformConfig
public PlatformConfig getPlatformConfig()
{@inheritDoc}
Throws:
ConfiguratorException

getResource
public static String getResource(String key)
Resource accessor.
Deprecated:
resource management will be moved to instance members.
Parameters:
key resource key
Return:
resource value

getResourceKeys
public static Iterator getResourceKeys()
Resource key iterator. note: not thread safe
Deprecated:
resource management will be moved to instance members.
Return:
resource keys

isReconfigure
public boolean isReconfigure()
{@inheritDoc}

load
public PlatformConfig load(File pc)
{@inheritDoc}
Throws:
ConfiguratorException

load
public ConfigParams load()
{@inheritDoc}
Throws:
ConfiguratorException

manageResources
private void manageResources()

register
public static void register(Class configurator)
Registers a delgate Configurator class with the Platform that will manage configuration resources.
Parameters:
configurator

removeResource
public static String removeResource(String key)
Resource remover.
Deprecated:
resource management will be moved to instance members.
Parameters:
key resource key
Return:
resource value

save
public boolean save(File f)
{@inheritDoc}
Throws:
ConfiguratorException

save
public boolean save()
{@inheritDoc}
Throws:
ConfiguratorException

setConfigParams
public void setConfigParams(ConfigParams cp)
{@inheritDoc}

setPlatformConfig
public void setPlatformConfig(PlatformConfig config)
{@inheritDoc}

setReconfigure
public void setReconfigure(boolean reconfigure)
{@inheritDoc}

updatePlatformConfig
public PlatformConfig updatePlatformConfig(Configurator configurator)
Application callback invoked upon registered Configurators prior to Platform startup. A ConfiguratorException will be thrown in the event the manufactured PlatformConfig is invalid.
Throws:
ConfiguratorException
Parameters:
configurator delegate Configurator
Return:
PlatformConfig updated PlatformConfig