Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

net.jxta.ext.config
Class AbstractConfigurator  view AbstractConfigurator download AbstractConfigurator.java

java.lang.Object
  extended bynet.jxta.ext.config.AbstractConfigurator
All Implemented Interfaces:
net.jxta.peergroup.Configurator, net.jxta.impl.peergroup.PlatformConfigurator

public abstract class AbstractConfigurator
extends java.lang.Object
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.

Version:
$Id: AbstractConfigurator.java,v 1.1 2004/11/30 22:42:09 gonzo Exp $

Nested Class Summary
(package private) static class AbstractConfigurator.ConfiguratorWrapper
           
 
Field Summary
private static java.lang.String DEFAULT_JXTA_PROPERTIES
           
private static java.lang.String DEFAULT_PROFILE
           
static java.lang.String JXTA_PROPERTIES_KEY
          jxta.properties resource name.
private static org.apache.log4j.Logger LOG
           
static java.lang.String PROFILE_KEY
          ext:config profile resource name.
private static java.util.Map resources
           
 
Constructor Summary
AbstractConfigurator(net.jxta.impl.peergroup.PlatformConfigurator configurator)
          Constructor which overrides the backing Configurator.
 
Method Summary
static java.lang.String addResource(java.lang.String key, java.lang.String value)
          Deprecated. resource management will be moved to instance members.
static void addResources(java.util.Map resources)
          Deprecated. resource management will be moved to instance members.
static java.util.Map clearResources()
          Deprecated. resource management will be moved to instance members.
abstract  net.jxta.impl.protocol.PlatformConfig createPlatformConfig(net.jxta.impl.peergroup.PlatformConfigurator configurator)
          Application callback invoked upon registered Configurators prior to Platform startup when a newly created PlatformConfig is required.
 net.jxta.protocol.ConfigParams getConfigParams()
          null
 java.net.URI getJXTAHome()
          null
private  java.io.File getJXTAHomeFile()
           
 net.jxta.impl.protocol.PlatformConfig getPlatformConfig()
          null
static java.lang.String getResource(java.lang.String key)
          Deprecated. resource management will be moved to instance members.
static java.util.Iterator getResourceKeys()
          Deprecated. resource management will be moved to instance members.
 boolean isReconfigure()
          null
 net.jxta.protocol.ConfigParams load()
          null
 net.jxta.impl.protocol.PlatformConfig load(java.io.File pc)
          null
private  void manageResources()
           
static void register(java.lang.Class configurator)
          Registers a delgate Configurator class with the Platform that will manage configuration resources.
static java.lang.String removeResource(java.lang.String key)
          Deprecated. resource management will be moved to instance members.
 boolean save()
          null
 boolean save(java.io.File f)
          null
 void setConfigParams(net.jxta.protocol.ConfigParams cp)
          null
 void setPlatformConfig(net.jxta.impl.protocol.PlatformConfig config)
          null
 void setReconfigure(boolean reconfigure)
          null
 net.jxta.impl.protocol.PlatformConfig updatePlatformConfig(net.jxta.impl.peergroup.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

PROFILE_KEY

public static final java.lang.String PROFILE_KEY
ext:config profile resource name.

See Also:
Constant Field Values

JXTA_PROPERTIES_KEY

public static final java.lang.String JXTA_PROPERTIES_KEY
jxta.properties resource name.

See Also:
Constant Field Values

DEFAULT_PROFILE

private static final java.lang.String DEFAULT_PROFILE
See Also:
Constant Field Values

DEFAULT_JXTA_PROPERTIES

private static final java.lang.String DEFAULT_JXTA_PROPERTIES
See Also:
Constant Field Values

LOG

private static final org.apache.log4j.Logger LOG

resources

private static final java.util.Map resources
Constructor Detail

AbstractConfigurator

public AbstractConfigurator(net.jxta.impl.peergroup.PlatformConfigurator configurator)
Constructor which overrides the backing Configurator.

Method Detail

register

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


getResourceKeys

public static java.util.Iterator getResourceKeys()
Deprecated. resource management will be moved to instance members.

Resource key iterator. note: not thread safe


getResource

public static java.lang.String getResource(java.lang.String key)
Deprecated. resource management will be moved to instance members.

Resource accessor.


addResource

public static java.lang.String addResource(java.lang.String key,
                                           java.lang.String value)
Deprecated. resource management will be moved to instance members.

Resource setter.


addResources

public static void addResources(java.util.Map resources)
Deprecated. resource management will be moved to instance members.

Resource setter.


removeResource

public static java.lang.String removeResource(java.lang.String key)
Deprecated. resource management will be moved to instance members.

Resource remover.


clearResources

public static java.util.Map clearResources()
Deprecated. resource management will be moved to instance members.

Resource clearer.


createPlatformConfig

public abstract net.jxta.impl.protocol.PlatformConfig createPlatformConfig(net.jxta.impl.peergroup.PlatformConfigurator configurator)
                                                                    throws net.jxta.exception.ConfiguratorException
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.


updatePlatformConfig

public net.jxta.impl.protocol.PlatformConfig updatePlatformConfig(net.jxta.impl.peergroup.PlatformConfigurator configurator)
                                                           throws net.jxta.exception.ConfiguratorException
Application callback invoked upon registered Configurators prior to Platform startup. A ConfiguratorException will be thrown in the event the manufactured PlatformConfig is invalid.


getJXTAHome

public java.net.URI getJXTAHome()
null

Specified by:
getJXTAHome in interface net.jxta.impl.peergroup.PlatformConfigurator

getPlatformConfig

public net.jxta.impl.protocol.PlatformConfig getPlatformConfig()
                                                        throws net.jxta.exception.ConfiguratorException
null

Specified by:
getPlatformConfig in interface net.jxta.impl.peergroup.PlatformConfigurator

setPlatformConfig

public void setPlatformConfig(net.jxta.impl.protocol.PlatformConfig config)
null

Specified by:
setPlatformConfig in interface net.jxta.impl.peergroup.PlatformConfigurator

getConfigParams

public net.jxta.protocol.ConfigParams getConfigParams()
                                               throws net.jxta.exception.ConfiguratorException
null

Specified by:
getConfigParams in interface net.jxta.peergroup.Configurator

setConfigParams

public void setConfigParams(net.jxta.protocol.ConfigParams cp)
null

Specified by:
setConfigParams in interface net.jxta.peergroup.Configurator

setReconfigure

public void setReconfigure(boolean reconfigure)
null

Specified by:
setReconfigure in interface net.jxta.impl.peergroup.PlatformConfigurator

load

public net.jxta.protocol.ConfigParams load()
                                    throws net.jxta.exception.ConfiguratorException
null

Specified by:
load in interface net.jxta.peergroup.Configurator

load

public net.jxta.impl.protocol.PlatformConfig load(java.io.File pc)
                                           throws net.jxta.exception.ConfiguratorException
null

Specified by:
load in interface net.jxta.impl.peergroup.PlatformConfigurator

isReconfigure

public boolean isReconfigure()
null

Specified by:
isReconfigure in interface net.jxta.impl.peergroup.PlatformConfigurator

save

public boolean save()
             throws net.jxta.exception.ConfiguratorException
null

Specified by:
save in interface net.jxta.peergroup.Configurator

save

public boolean save(java.io.File f)
             throws net.jxta.exception.ConfiguratorException
null

Specified by:
save in interface net.jxta.impl.peergroup.PlatformConfigurator

manageResources

private void manageResources()

getJXTAHomeFile

private java.io.File getJXTAHomeFile()