com.joctopus.server
Class FileRecieverServer

java.lang.Object
  extended by java.lang.Thread
      extended by com.joctopus.server.Server
          extended by com.joctopus.server.FileRecieverServer
All Implemented Interfaces:
java.lang.Runnable

public class FileRecieverServer
extends Server

This class is server for accepting File recieve notifications from others.This class manages the file recieve operation.

Since:
1.1

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class com.joctopus.server.Server
debug
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
FileRecieverServer(int port, JOctopusConsole chatterConsole, int poolSize)
           
 
Method Summary
 java.util.Vector<java.lang.Integer> getBusyPools()
           
 FileRecieverHandler[] getFileRecieverHandler()
           
 int getPoolSize()
           
 void removeID(java.lang.Integer ID)
          Removes the given ID from busy pools.
 void run()
           
 void setBusyPools(java.util.Vector<java.lang.Integer> busyPools)
           
 void setPoolSize(int poolSize)
           
 void startServer()
          starts server.
 
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
 

Constructor Detail

FileRecieverServer

public FileRecieverServer(int port,
                          JOctopusConsole chatterConsole,
                          int poolSize)
Parameters:
port - The port at which to start the server
chatterConsole - The system wide default chatter console object
poolSize - The capacity of server, means the number of file transfer operations can be performed by server for each client.
Method Detail

getBusyPools

public java.util.Vector<java.lang.Integer> getBusyPools()
Returns:
ID's of the file reciever handlers that are busy performing file recieve operations

setBusyPools

public void setBusyPools(java.util.Vector<java.lang.Integer> busyPools)
Parameters:
busyPools -

getFileRecieverHandler

public FileRecieverHandler[] getFileRecieverHandler()
Returns:
pool of file reciever handler instances

getPoolSize

public int getPoolSize()
Returns:
the pool size of file reciever handler.

setPoolSize

public void setPoolSize(int poolSize)
Parameters:
poolSize - Set the pool size for file reciever handler

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

removeID

public void removeID(java.lang.Integer ID)
Removes the given ID from busy pools.

Parameters:
ID - ID to be removed from busy pools maintained by this server