Parsing Engine

danbikel.switchboard
Interface Server

All Superinterfaces:
Remote, SwitchboardUser
All Known Subinterfaces:
DecoderServerRemote
All Known Implementing Classes:
AbstractServer, CachingDecoderServer, DecoderServer

public interface Server
extends SwitchboardUser

A semantic marker for those switchboard users that are servers; also, specifies server-specific methods for the switchboard to use. Servers are assigned Client objects by the switchboard.

A note on fault tolerance: In order to ensure the fault-tolerance of clients, implementors should ensure that they use socket factories that set the SO_TIMEOUT values of their TCP/IP sockets to some integer greater than 0, by providing custom socket factories that provide at least the functionality of TimeoutSocketFactory. Subclasses that use sockets other than TCP/IP sockets should have similar non-infinite timeouts.

See Also:
Client, SwitchboardRemote, AbstractServer

Field Summary
static int acceptUnlimitedClients
           
 
Method Summary
 boolean acceptClientsOnlyByRequest()
          Returns whether this server is only willing to accept clients that request it.
 int id()
          Returns the ID number of this server.
 int maxClients()
          The maximum number of clients this server is willing to accept, or acceptUnlimitedClients if this server is willing to accept a virtually unlimited number of clients (a large maximum value may be used by the switchboard).
 
Methods inherited from interface danbikel.switchboard.SwitchboardUser
alive, die, host
 

Field Detail

acceptUnlimitedClients

static final int acceptUnlimitedClients
See Also:
Constant Field Values
Method Detail

maxClients

int maxClients()
               throws RemoteException
The maximum number of clients this server is willing to accept, or acceptUnlimitedClients if this server is willing to accept a virtually unlimited number of clients (a large maximum value may be used by the switchboard). It is an error for this method to return any number other than a non-zero positive integer or the special value.

Note that a server may change the return value of this method over time; this method is guaranteed to be called and its value cached every time a client is assigned to this server.

Throws:
RemoteException
See Also:
SwitchboardRemote.register(Server)

acceptClientsOnlyByRequest

boolean acceptClientsOnlyByRequest()
                                   throws RemoteException
Returns whether this server is only willing to accept clients that request it. This is the method by which a client can "arrange" to be hooked up to a specific server, such as when it is desirable to have a single server per client.

Note that a server may change the return value of this method over time; this method is guaranteed to be called and its value cached every time a client is assigned to this server.

Throws:
RemoteException
See Also:
SwitchboardRemote.register(Server), SwitchboardRemote.getServer(int,int)

id

int id()
       throws RemoteException
Returns the ID number of this server.

Specified by:
id in interface SwitchboardUser
Throws:
RemoteException

Parsing Engine

Author: Dan Bikel.