Inheritance diagram for ClusterServer:
Public Member Functions | |
this (InternetAddress bind, int threads, ILogger logger=null) | |
void | enroll (ILogger logger) |
void | addCacheLoader (IPayload loader, bool enroll=false) |
void | start () |
void | setCache (ClusterCache cache) |
ClusterCache | getCache () |
void | setQueue (ClusterQueue queue) |
char[] | getProtocol () |
void | notify (IEvent event, IPayload payload) |
char[] | toString () |
ServerSocket | createSocket (InternetAddress bind, int backlog) |
ServerThread | createThread (ServerSocket socket) |
void | service (ServerThread st, IConduit conduit) |
Private Member Functions | |
this (InternetAddress bind, int threads, int backlog, ILogger logger=null) | |
char[] | getRemoteAddress (IConduit conduit) |
char[] | getRemoteHost (IConduit conduit) |
int | getPort () |
char[] | getHost () |
ILogger | getLogger () |
Private Attributes | |
ClusterCache | cache |
ClusterQueue | queue |
Cluster | cluster |
IChannel | channel |
RollCall | rollcall |
CacheServer | taskServer |
Definition at line 71 of file ClusterServer.d.
|
Construct this server with the requisite attributes. The 'bind' address is the local address we'll be listening on, 'threads' represents the number of socket-accept threads, and backlog is the number of "simultaneous" connection requests that a socket layer will buffer on our behalf. We also set up a listener for client discovery-requests, and lastly, we tell active clients that we're available for work. Clients should be listening on the appropriate channel for an instance of the RollCall payload. Definition at line 95 of file ClusterServer.d. References Cluster, Cluster::createChannel(), Cluster::createConsumer(), enroll(), AbstractServer::getLogger(), RollCall, rollcall, taskServer, and version. |
|
Definition at line 127 of file ClusterServer.d. Referenced by this(). |
|
Definition at line 135 of file ClusterServer.d. References IPickle::getGuid(), Cluster::getLogger(), and ILogger::info(). |
|
Start this server Reimplemented from AbstractServer. Definition at line 151 of file ClusterServer.d. References Cluster::broadcast(), ClusterCache, queue, rollcall, AbstractServer::start(), taskServer, and version. Referenced by testClusterServer(). |
|
Use this before starting the server Definition at line 178 of file ClusterServer.d. |
|
Definition at line 187 of file ClusterServer.d. |
|
Use this before starting the server Definition at line 198 of file ClusterServer.d. |
|
Return the protocol in use. Reimplemented from IServer. Definition at line 209 of file ClusterServer.d. Referenced by toString(). |
|
Interface method that's invoked when a client is making discovery requests. We just send back our identity in a reply. Reimplemented from IEventListener. Definition at line 222 of file ClusterServer.d. References Cluster::broadcast(), RollCall::request, and rollcall. |
|
Return a text string identifying this server Implements AbstractServer. Definition at line 237 of file ClusterServer.d. References getProtocol(). |
|
Create a ServerSocket instance. Implements AbstractServer. Definition at line 248 of file ClusterServer.d. References ServerSocket. |
|
Create a ServerThread instance. This can be overridden to create other thread-types, perhaps with additional thread- level data attached. Implements AbstractServer. Definition at line 261 of file ClusterServer.d. References ServerThread. |
|
Factory method for servicing a request. We just create a new ClusterThread to handle requests from the client. The thread does not exit until the socket connection is broken by the client, or some other exception occurs. Reimplemented from AbstractServer. Definition at line 275 of file ClusterServer.d. References ClusterThread, queue, and thread. |
|
Setup this server with the requisite attributes. The number of threads specified dictate exactly that. You might have anything between 1 thread and several hundred, dependent upon the underlying O/S and hardware. Parameter 'backlog' specifies the max number of"simultaneous" connection requests to be handled by an underlying socket implementation. Definition at line 81 of file AbstractServer.d. References AbstractServer::backlog, AbstractServer::bind, and AbstractServer::threads. |
|
Provide support for figuring out the remote address Reimplemented from IServer. Definition at line 134 of file AbstractServer.d. References InternetAddress::toAddrString(). |
|
Provide support for figuring out the remote host. Not currently implemented. Reimplemented from IServer. Definition at line 151 of file AbstractServer.d. |
|
Return the local port we're attached to Reimplemented from IServer. Definition at line 162 of file AbstractServer.d. References InternetAddress::port(). |
|
Return the local address we're attached to Reimplemented from IServer. Definition at line 174 of file AbstractServer.d. References InternetAddress::toAddrString(). |
|
Return the logger associated with this server Definition at line 186 of file AbstractServer.d. Referenced by ServerThread::run(), CacheServer::LoaderThread::this(), and this(). |
|
Definition at line 73 of file ClusterServer.d. |
|
Definition at line 74 of file ClusterServer.d. |
|
Definition at line 75 of file ClusterServer.d. |
|
Definition at line 76 of file ClusterServer.d. |
|
Definition at line 77 of file ClusterServer.d. |
|
Definition at line 78 of file ClusterServer.d. |