ppt
Class ImageServer

java.lang.Object
  extended by java.lang.Thread
      extended by ppt.ImageServer
All Implemented Interfaces:
java.lang.Runnable, net.contentobjects.jnotify.JNotifyListener

public class ImageServer
extends java.lang.Thread
implements net.contentobjects.jnotify.JNotifyListener

The ImageServer class is a stand alone application which opens socket, listens for a new client connection. The client is added to a list when connected. The server gets notified upon each PNG file creation in file system where Power Point Capture Show add-in stores slide as an image. The server streams the image file to currently connected clients.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
(package private) static java.util.List clients
           
(package private)  java.awt.image.BufferedImage currentImage
           
(package private) static org.apache.log4j.Logger logger
           
(package private) static int port
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ImageServer()
           
 
Method Summary
 void fileCreated(int wd, java.lang.String rootPath, java.lang.String name)
          The method reads newly created file from file system and assigns it to list of clients - ImageStreamer objects
 void fileDeleted(int wd, java.lang.String rootPath, java.lang.String name)
           
 void fileModified(int wd, java.lang.String rootPath, java.lang.String name)
           
 void fileRenamed(int wd, java.lang.String rootPath, java.lang.String oldName, java.lang.String newName)
           
static void main(java.lang.String[] args)
           
 void run()
           
 
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
 

Field Detail

logger

static org.apache.log4j.Logger logger

port

static int port

clients

static java.util.List clients

currentImage

java.awt.image.BufferedImage currentImage
Constructor Detail

ImageServer

public ImageServer()
Method Detail

main

public static void main(java.lang.String[] args)
Parameters:
args: - IMG_DIR and SENDER_PORT arguments can be sent

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread
See Also:
The metnod initializes client list, opens socket, and listens for a new client connection

fileCreated

public void fileCreated(int wd,
                        java.lang.String rootPath,
                        java.lang.String name)
The method reads newly created file from file system and assigns it to list of clients - ImageStreamer objects

Specified by:
fileCreated in interface net.contentobjects.jnotify.JNotifyListener
See Also:
JNotifyListener.fileCreated(int, java.lang.String, java.lang.String)

fileDeleted

public void fileDeleted(int wd,
                        java.lang.String rootPath,
                        java.lang.String name)
Specified by:
fileDeleted in interface net.contentobjects.jnotify.JNotifyListener

fileModified

public void fileModified(int wd,
                         java.lang.String rootPath,
                         java.lang.String name)
Specified by:
fileModified in interface net.contentobjects.jnotify.JNotifyListener

fileRenamed

public void fileRenamed(int wd,
                        java.lang.String rootPath,
                        java.lang.String oldName,
                        java.lang.String newName)
Specified by:
fileRenamed in interface net.contentobjects.jnotify.JNotifyListener