All Packages Class Hierarchy This Package Previous Next Index
Class sun.server.EndpointDescriptor
java.lang.Object
|
+----sun.server.EndpointDescriptor
- public class EndpointDescriptor
- extends Object
Endpoint descriptors are used to administer network services. Each
network service is made available at a particular transport address,
and with certain characteristics. Those characteristics are described
using an endpoint descriptor, administered as part of the service.
Characteristics of a transport endpoint include addressing information,
some kinds of security characteristics, compression, bandwidth, latency,
and more. In particular, there are different kinds of transport endpoints,
corresponding to different qualities of service, such as:
- Connection style service: The most commonly used
quality of service, providing at-most-once message delivery,
with order preserved and no duplicates. This is a pairwise
communication, for example client-to-server or peer-to-peer.
- Datagram style service: Used sometimes by system
services, messages may be deleted, duplicated, and delivered out
of order. This is also a pairwise service.
- Multicast service: This is like datagram service,
but interactions normally have more than two participants. This
is a generalization of "broadcast" service, as well as "manycast".
Higher level aspects of the configuration for a network service
are administered using different interfaces. Endpoint Descriptors
only affect provide administrative support for transport level
characteristics, and application protocols usually depend on having
a particular kind of transport protocol.
Endpoint descriptors usually need to be persistent. The strategy
used may be defined by the descriptor; it may come from a network
service, a hardware device, ROM, a file, or any other storage scheme.
A default implementation is provided, which initializes an internal
hashtable from properties or a properties file. That may then be saved
to a file, if desired. This default implementation may be completely
replaced by any given subclass, but clients of that subclass will need
to understand the persistence scheme being used.
In the atypical case that an EndpointDescriptor doesn't need to be
made persistent, the properties object may be created directly, and
not stored in any file.
-
file
- A File object to which the descriptor state may be saved.
-
header
- header to use on the optional properties file
-
properties
- A hashtable which may be used to hold properties of this endpoint.
-
propname
- Name of the property used to identify which classs is instantiated.
-
EndpointDescriptor()
-
-
fromFile(File)
- This initializes EndpointDescriptors created using the property set
representation (see fromProperties),
loading it from a file.
-
fromProperties(Properties)
-
-
getAdminAppletClass()
- Placeholder for the hook to administer these objects.
-
getCriticalKeys()
- Lists the keys which initializeDescriptor absolutely
requires to be made available to it.
-
getDefault(Object)
- Returns the default value of a given key.
-
getDescriptorKeys()
- Lists the keys understood by initializeDescriptor,
including ones which have default values.
-
getValue(Object)
- Returns the current value corresponding to a given key.
-
initialize(Hashtable)
- Initializes the descriptor from the key/value pairs found in a
hashtable.
-
save()
- Saves the endpoint descriptor to the persistent storage location
last used to store it.
-
save(File)
- Saves the endpoint descriptor to the named file.
-
setValue(Object, Object)
- Sets the value corresponding to a given key.
properties
protected Hashtable properties
- A hashtable which may be used to hold properties of this endpoint.
This does not need to be used by subclasses.
If there is a value for this member, and it corresponds to a
properties object, and a file member is non-null, the
save() operation saves the properties to that
file.
file
protected File file
- A File object to which the descriptor state may be saved.
Desirable to just use serialization of the entire server
configuration ...
header
protected String header
- header to use on the optional properties file
propname
public final static String propname
- Name of the property used to identify which classs is instantiated.
EndpointDescriptor
public EndpointDescriptor()
fromFile
public static EndpointDescriptor fromFile(File f) throws IOException, FileNotFoundException, ConfigurationException
- This initializes EndpointDescriptors created using the property set
representation (see fromProperties),
loading it from a file.
- Parameters:
- f - the file holding the property set
- Throws: IOException
- when there is a problem reading the file
- Throws: FileNotFoundException
- if the file does not exist
- Throws: ConfigurationException
- indicates that the data
in the hashtable has problems.
fromProperties
public static EndpointDescriptor fromProperties(Properties props) throws ConfigurationException
getAdminAppletClass
public abstract String getAdminAppletClass()
- Placeholder for the hook to administer these objects. The
assumption here is that it suffices to just return the name
of a class which can be instantiated by the admin applet and
then given a reference to the object it's administering.
getCriticalKeys
public abstract Vector getCriticalKeys()
- Lists the keys which initializeDescriptor absolutely
requires to be made available to it. All other keys have
default values. Note that subclasses may provide defaults for
values that superclasses provide.
getDescriptorKeys
public abstract Vector getDescriptorKeys()
- Lists the keys understood by initializeDescriptor,
including ones which have default values.
getDefault
public Object getDefault(Object key)
- Returns the default value of a given key.
- Parameters:
- key - identifies which default value is requested
getValue
public Object getValue(Object key)
- Returns the current value corresponding to a given key.
- Parameters:
- key - identifies which current value is requested
initialize
public void initialize(Hashtable props) throws ConfigurationException
- Initializes the descriptor from the key/value pairs found in a
hashtable. The keys and values understood by the descriptor are
specific to the kind of connection, although conventions are
defined for the following string-valued keys:
- port ... The value is a number describing the
the host-specific part of the server's address, such as the
TCP port. This value must always be provided.
- hostname ... If provided, this describes which
of multiple available network interfaces to use. This value
is only meaningful in environments which support "multihoming".
It may be used to provide selective service visibility, such
as offering a service on only one side of a firewall.
Keys provided in the hashtable must be understood by the
descriptor; it is an error to provide keys which are not
explicitly supported by the descriptor. Similarly, it is
an error not to provide values for the "critical" keys.
- Parameters:
- props - a set of key/value pairs used to initialize the
descriptor (CONSUMED).
- Throws: ConfigurationException
- indicates that the data
in the hashtable has problems.
- See Also:
- getDescriptorKeys, getCriticalKeys
save
public void save() throws IOException
- Saves the endpoint descriptor to the persistent storage location
last used to store it.
save
public void save(File f) throws IOException
- Saves the endpoint descriptor to the named file.
- Parameters:
- f - the file to which the descriptor will be saved
setValue
public void setValue(Object key,
Object value)
- Sets the value corresponding to a given key.
- Parameters:
- key - the key used to look up the value
- value - the value being set
All Packages Class Hierarchy This Package Previous Next Index