|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.lang.Thread
org.jppf.server.app.JPPFApplicationServer
public class JPPFApplicationServer
Instances of this class listens for incoming connections from client applications.
For each incoming connection, a new connection thread is created. This thread listens to incoming
connection requests and puts them on the execution queue.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
protected List<org.jppf.server.app.JPPFConnection> |
connections
The list of connections accepted by this server. |
protected int |
port
The port this socket server is listening to. |
protected ServerSocket |
server
Server socket listening for requests on the configured port. |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
JPPFApplicationServer(int port)
Initialize this socket server with a specified execution service and port number. |
|
| Method Summary | |
|---|---|
protected org.jppf.server.app.JPPFConnection |
createConnection(Socket socket)
Instanciate a wrapper for the socket connection opened by this socket server. |
void |
end()
Close the underlying server socket and stop this socket server. |
protected void |
init(int port)
Initialize the underlying server socket with a specified port. |
protected boolean |
isStopped()
Get the stopped state of this server. |
void |
removeAllConnections()
Close and remove all connections accepted by this server. |
void |
removeConnection(org.jppf.server.app.JPPFConnection connection)
Remove the specified connection from the list of active connections of this server. |
void |
run()
Start the underlying server socket by making it accept incoming connections. |
protected void |
serve(Socket socket)
Start serving a new incoming connection. |
protected void |
setStopped(boolean stopped)
Set this server in the specified stopped state. |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected ServerSocket server
protected int port
protected List<org.jppf.server.app.JPPFConnection> connections
| Constructor Detail |
|---|
public JPPFApplicationServer(int port)
throws JPPFException
port - the port this socket server is listening to.
JPPFException - if the underlying server socket can't be opened.| Method Detail |
|---|
protected org.jppf.server.app.JPPFConnection createConnection(Socket socket)
throws JPPFException
socket - the socket connection obtained through a call to
ServerSocket.accept().
JPPFServerConnection instance.
JPPFException - if an exception is raised while creating the socket handler.public void run()
run in interface Runnablerun in class ThreadRunnable.run()
protected void serve(Socket socket)
throws Exception
socket - the socket connecting with this socket server.
Exception - if the new connection can't be initialized.
protected void init(int port)
throws JPPFException
port - the port the underlying server listens to.
JPPFException - if the server socket can't be opened on the specified port.public void end()
public void removeConnection(org.jppf.server.app.JPPFConnection connection)
connection - the connection to remove.public void removeAllConnections()
protected void setStopped(boolean stopped)
stopped - true if this server is stopped, false otherwise.protected boolean isStopped()
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||