Project JXTA

net.jxta.impl.config
Class Config

java.lang.Object
  |
  +--net.jxta.impl.config.Config

public class Config
extends java.lang.Object

Instances of Config class provides the interface for configuring a JXTA peer. Config provides:

  • an interface to write a configuration to XML (write())
  • an interface to read a configuration from XML (static read())
  • an interface to create default a configuration (static createDefaultConfig())
  • an interface to read configuration information
  • an interface to set configuration information


    Field Summary
    static java.lang.String SERVICE_DISCOVERY
               
    static java.lang.String SERVICE_MEMBERSHIP
               
    static java.lang.String SERVICE_PEERINFO
               
    static java.lang.String SERVICE_PIPE
               
    static java.lang.String SERVICE_RESOLVER
               
     
    Constructor Summary
    Config()
              Creates a blank configuration.
     
    Method Summary
     void addRendezvousPeer(net.jxta.endpoint.EndpointAddress address)
              Adds a rendezvous peer
     void clearRendezvousPeers()
              Clears ou the list of rendezvous peers
    static Config createDefaultConfig()
              Creates a default configuration instance.
     HttpConfig getHttpConfig()
              Gets the contained Http Transport configuration
     CodeDescriptor getInitialApp()
              Returns the classname of the initial class that is booted at startup
     CodeDescriptor getInitialPlatform()
              Returns the descriptor of the initial class that is booted at startup
     java.util.Enumeration getRendezvousPeers()
              Returns an enumeration of rendezvous peers
     CodeDescriptor getServiceImplDescriptor(java.lang.String aServiceKey)
              Given a service key, returns the descriptor of the implementation class.
     boolean getShouldPropagate()
              Tells whether messages should be propagated.
     TcpConfig getTcpConfig()
              Gets the contained TCP Transport configuration
     boolean isRendezvous()
              Tells whether the peer is a rendezvous peer
     boolean isRouter()
              Tells whether the peer is a router peer
    static Config read(java.io.InputStream aInStream)
              Reads the configuration file in aInStream and creates a new Configuration.
     void setHttpConfig(HttpConfig aConfig)
              Sets the contained Http Transport configuration
     void setInitialApp(CodeDescriptor aInitialApp)
              Sets the classname of the initial class that is booted at startup
     void setInitialPlatform(CodeDescriptor aInitialPlatform)
              Sets the classname of the initial class that is booted at startup
     void setRendezvous(boolean aIsRendezvous)
              Sets whether the peer is a rendezvous peer
     void setRouter(boolean aIsRouter)
              Sets whether the peer is a rendezvous peer
     void setServiceImplDescriptor(java.lang.String aServiceKey, CodeDescriptor aDescriptor)
              Correlates a service with a code descriptor.
     void setShouldPropagate(boolean aShouldPropagate)
              Sets whether messages should be propagated.
     void setTcpConfig(TcpConfig aConfig)
              Sets the contained TCP Transport configuration
     void write(java.io.Writer aWriter)
              Writes configuration to a writer in XML format.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    SERVICE_DISCOVERY

    public static final java.lang.String SERVICE_DISCOVERY

    SERVICE_MEMBERSHIP

    public static final java.lang.String SERVICE_MEMBERSHIP

    SERVICE_PIPE

    public static final java.lang.String SERVICE_PIPE

    SERVICE_PEERINFO

    public static final java.lang.String SERVICE_PEERINFO

    SERVICE_RESOLVER

    public static final java.lang.String SERVICE_RESOLVER
    Constructor Detail

    Config

    public Config()
    Creates a blank configuration. Normally you will want to create a Config object by either reading a pre-existing XML document or by calling the static createDefaultConfig()
    Method Detail

    createDefaultConfig

    public static Config createDefaultConfig()
    Creates a default configuration instance.

    getServiceImplDescriptor

    public CodeDescriptor getServiceImplDescriptor(java.lang.String aServiceKey)
    Given a service key, returns the descriptor of the implementation class. See the set of SERVICE_ constants above.

    setServiceImplDescriptor

    public void setServiceImplDescriptor(java.lang.String aServiceKey,
                                         CodeDescriptor aDescriptor)
                                  throws ConfigurationException
    Correlates a service with a code descriptor.

    isRendezvous

    public boolean isRendezvous()
    Tells whether the peer is a rendezvous peer

    setRendezvous

    public void setRendezvous(boolean aIsRendezvous)
    Sets whether the peer is a rendezvous peer

    isRouter

    public boolean isRouter()
    Tells whether the peer is a router peer

    setRouter

    public void setRouter(boolean aIsRouter)
    Sets whether the peer is a rendezvous peer

    getTcpConfig

    public TcpConfig getTcpConfig()
    Gets the contained TCP Transport configuration

    setTcpConfig

    public void setTcpConfig(TcpConfig aConfig)
    Sets the contained TCP Transport configuration

    getHttpConfig

    public HttpConfig getHttpConfig()
    Gets the contained Http Transport configuration

    setHttpConfig

    public void setHttpConfig(HttpConfig aConfig)
    Sets the contained Http Transport configuration

    getInitialPlatform

    public CodeDescriptor getInitialPlatform()
    Returns the descriptor of the initial class that is booted at startup

    setInitialPlatform

    public void setInitialPlatform(CodeDescriptor aInitialPlatform)
    Sets the classname of the initial class that is booted at startup

    getInitialApp

    public CodeDescriptor getInitialApp()
    Returns the classname of the initial class that is booted at startup

    setInitialApp

    public void setInitialApp(CodeDescriptor aInitialApp)
    Sets the classname of the initial class that is booted at startup

    addRendezvousPeer

    public void addRendezvousPeer(net.jxta.endpoint.EndpointAddress address)
    Adds a rendezvous peer

    getRendezvousPeers

    public java.util.Enumeration getRendezvousPeers()
    Returns an enumeration of rendezvous peers

    clearRendezvousPeers

    public void clearRendezvousPeers()
    Clears ou the list of rendezvous peers

    getShouldPropagate

    public boolean getShouldPropagate()
    Tells whether messages should be propagated.

    setShouldPropagate

    public void setShouldPropagate(boolean aShouldPropagate)
    Sets whether messages should be propagated.

    read

    public static Config read(java.io.InputStream aInStream)
                       throws ConfigurationException
    Reads the configuration file in aInStream and creates a new Configuration. This is a static method such that the Configuration object can be tightly controlled (notice that there are no public contructors).

    write

    public void write(java.io.Writer aWriter)
               throws ConfigurationException
    Writes configuration to a writer in XML format.

    Project JXTA