com.joctopus.server
Class FileTransferServer
java.lang.Object
java.lang.Thread
com.joctopus.server.Server
com.joctopus.server.FileTransferServer
- All Implemented Interfaces:
- java.lang.Runnable
public class FileTransferServer
- extends Server
This class is a file transfer server, that sends file to client on recieving
specific message that describes the location of file on desktop where this server is running.
The message format is
\n
here,
file-path is full path of file.
All values are mandatory.
- Since:
- 1.0
Nested classes/interfaces inherited from class java.lang.Thread |
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Fields inherited from class com.joctopus.server.Server |
debug |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Methods inherited from class com.joctopus.server.Server |
addMessageRecieveListener, getChatServerSocket, getChatterConsole, getMessageRecieveListener, getPort, getRecievedClientSocket, getRecievedClientSocketChannel, getServerName, getServerSocketChannel, instantiateServer, isFailToRun, isStarted, setPort, setRecievedClientSocket, setServerName, stopService, writeOut |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, 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 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
FileTransferServer
public FileTransferServer(int port,
JOctopusConsole chatterConsole,
int poolSize)
- Parameters:
port
- at which the service will start and listen for client notification.chatterConsole
- is a console windowpoolSize
- can be logically thought as maximum no of active client requests that can be handled by server.
FileTransferServer
public FileTransferServer(JOctopusConsole chatterConsole,
int poolSize)
- Parameters:
chatterConsole
- JOctopusConsole object for writing debug outputpoolSize
- size of pool
startServer
public void startServer()
throws java.net.BindException
- Description copied from class:
Server
- starts server.
- Overrides:
startServer
in class Server
- Throws:
java.net.BindException
run
public void run()
- Specified by:
run
in interface java.lang.Runnable
- Overrides:
run
in class Server
getBusyPools
public java.util.Vector getBusyPools()
- Returns:
- busy pools
removeID
public void removeID(java.lang.Integer ID)
- removes the ID from the busy pools. To allow only one service thread to
access this method at a time it is synchronized
- Parameters:
ID
- the ID to be removed from busy pools.