All Packages Class Hierarchy This Package Previous Next Index
Class sun.server.ConnectionEndpoint
java.lang.Object
|
+----sun.server.EndpointDescriptor
|
+----sun.server.ConnectionEndpoint
- public class ConnectionEndpoint
- extends EndpointDescriptor
ConnectionEndpoint is a connection descriptor that exposes all the
configuration that a standard Java connection-based service can support.
For now, that means it exposes TCP configuration.
NOTE: this does not currently capture all network config data;
we're now setting timeouts, and they're not handled here.
-
backlogPropName
- Key for value controlling connection setup backlog.
-
interfacePropName
- Key for value controlling which network interface(s) are used
-
portPropName
- Key for value controlling which port is used
-
props
- Holds internal state of the endpoint descriptor.
-
ConnectionEndpoint()
-
-
getAdminAppletClass()
- Endpoints can have custom administrative applets.
-
getCriticalKeys()
- Lists the keys which initializeDescriptor absolutely
requires to be made available to it.
-
getDefault(Object)
- Returns the default value of a given defaultable key.
-
getDescriptorKeys()
- Lists the keys understood by initializeDescriptor;
these include ones which have default values, as well as ones
which do not have default values.
-
getInterface()
- Returns the address through which the service will be made available,
or "*" if all available network addresses should be used.
-
getPort()
- Returns the endpoint's port.
-
getServerSocket()
- Returns a server socket satisfying the constraints of the
descriptor.
-
getServerSocket(String, int, int)
- Entry point which will usually be overridden by subclasses.
-
getValue(Object)
- Returns the value of the specified object attribute.
-
initialize(Properties)
- Initializes the endpoint.
-
setValue(Object, Object)
- Assigns the value of the specified object attribute.
props
protected Properties props
- Holds internal state of the endpoint descriptor.
backlogPropName
public static final String backlogPropName
- Key for value controlling connection setup backlog.
interfacePropName
public static final String interfacePropName
- Key for value controlling which network interface(s) are used
portPropName
public static final String portPropName
- Key for value controlling which port is used
ConnectionEndpoint
public ConnectionEndpoint()
initialize
protected void initialize(Properties props) throws ConfigurationException
- Initializes the endpoint. The hashtable must hold a numeric
value for the port. It may optionally hold a string value for
the network interface to use (defaults to all interfaces), and
a numeric value for the TCP backlog (defaults to fifty).
Note that even on hosts which are not multihomed, there will
often be a difference between specifying "all interfaces" and
between specifying the hosts's (only) name. That is because of
the common use of fast "loopack" network interfaces.
- Parameters:
- props - set of properties from which to initialize the endpoint
- Throws: ConfigurationException
- if the endpoint was already
initialized, or if one of the configuration properties was invalid
- Overrides:
- initialize in class EndpointDescriptor
getServerSocket
public final ServerSocket getServerSocket() throws IOException, ConfigurationException
- Returns a server socket satisfying the constraints of the
descriptor. All connection based services support the standard
socket model of service establishment, where a passive server
thread waits for connections to be established to it by clients.
NOTE: This operation is specific to connection style
endpoints. Datagram and other styles of endpoints will have their
own methods for accessing network services.
- Throws: IOException
- if there's a network related problem
- Throws: ConfigurationException
- if the configuration information
is problematic
getServerSocket
protected ServerSocket getServerSocket(String ifname,
int port,
int backlog) throws IOException, ConfigurationException
- Entry point which will usually be overridden by subclasses.
This returns a socket, assuming that an interface name (which
may be "*", indicating any interface may be used) and a port
number are sufficient to identify it.
- Parameters:
- ifname - name of the interface on which to offer service,
or "*" if the service is to be offered on all interfaces of
a multihomed host
- port - port number to use for this service.
- backlog - how many network connections to queue up in
the system infrastructure.
- Throws: IOException
- in case of address binding errors
- Throws: ConfigurationException
- if the configuration information
is problematic
getValue
public Object getValue(Object k)
- Returns the value of the specified object attribute.
- Overrides:
- getValue in class EndpointDescriptor
setValue
public void setValue(Object k,
Object value) throws IOException
- Assigns the value of the specified object attribute.
- Overrides:
- setValue in class EndpointDescriptor
getPort
public int getPort()
- Returns the endpoint's port.
getInterface
public String getInterface()
- Returns the address through which the service will be made available,
or "*" if all available network addresses should be used. Names for
such addresses may also be returned, if supported by local network
administration policies.
For example, when using NIS each address must have a single name.
However, the Internet's DNS recognizes that all of a host's addresses
should normally be treated the same, mapping to the same canonical
host name. Only when a mulithomed host is being used for "virtual
hosting" will DNS assign different names to each of a host's network
addresses.
getCriticalKeys
public 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 require.
- Overrides:
- getCriticalKeys in class EndpointDescriptor
getDescriptorKeys
public Vector getDescriptorKeys()
- Lists the keys understood by initializeDescriptor;
these include ones which have default values, as well as ones
which do not have default values.
- Overrides:
- getDescriptorKeys in class EndpointDescriptor
getDefault
public Object getDefault(Object key)
- Returns the default value of a given defaultable key.
- Parameters:
- key - identifies which default value is requested
- Overrides:
- getDefault in class EndpointDescriptor
getAdminAppletClass
public String getAdminAppletClass()
- Endpoints can have custom administrative applets. This returns
the name of an applet class that understands how to administer the
properties of this particular kind of endpoint.
- Overrides:
- getAdminAppletClass in class EndpointDescriptor
All Packages Class Hierarchy This Package Previous Next Index