com.joctopus.work
Class FileRecieverHandler

java.lang.Object
  extended by java.lang.Thread
      extended by com.joctopus.work.FileRecieverHandler
All Implemented Interfaces:
java.awt.event.ActionListener, java.lang.Runnable, java.util.EventListener

public class FileRecieverHandler
extends java.lang.Thread
implements java.awt.event.ActionListener

This class is a handler that performs 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 java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
FileRecieverHandler(FileRecieverServer fileRecieverServer, java.lang.Integer ID, java.lang.StringBuffer message, java.lang.String senderipaddress)
          initialize the file reciever handler thread.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Handling events generated by RecieveFileChatter.
 void confirmStopFileTransfer(java.lang.String message)
          Asks the user wheather to stop the file transfer, If true then > set download status flag to false > show download cancelled label to user > hide progress bar,cancel and accept button.
 void newDownloadQueue(int index)
          Starts a new download queue at given index in pools of FileReciever thread
 void releaseResources()
          removes the class ID from busypools in FileRecieverServer and shuts the subfilerecieverserver
 void run()
          start the file transfer operation
 void startDownloadQueue()
          Starts download Queue This method is called only once in entire file reception operation.
 
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

FileRecieverHandler

public FileRecieverHandler(FileRecieverServer fileRecieverServer,
                           java.lang.Integer ID,
                           java.lang.StringBuffer message,
                           java.lang.String senderipaddress)
initialize the file reciever handler thread.

Parameters:
fileRecieverServer - FileRecieverServer Thread
ID - uniquely identifies the thread in pool of threads maintained by FileRecieverServer
message - The message recieved from sender.
senderipaddress - IP Address of sender.
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Handling events generated by RecieveFileChatter.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - ActionEvent

confirmStopFileTransfer

public void confirmStopFileTransfer(java.lang.String message)
Asks the user wheather to stop the file transfer, If true then > set download status flag to false > show download cancelled label to user > hide progress bar,cancel and accept button. > stop sub file reciever service.

Parameters:
message - Message to be displayed on confirm dialog.

startDownloadQueue

public void startDownloadQueue()
Starts download Queue This method is called only once in entire file reception operation.


newDownloadQueue

public void newDownloadQueue(int index)
Starts a new download queue at given index in pools of FileReciever thread

Parameters:
index - index.

run

public void run()
start the file transfer operation

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

releaseResources

public void releaseResources()
removes the class ID from busypools in FileRecieverServer and shuts the subfilerecieverserver