com.jthomas.mailfaces
Class FaceResolver

java.lang.Object
  |
  +--com.jthomas.mailfaces.FaceResolver
All Implemented Interfaces:
java.lang.Runnable

public class FaceResolver
extends java.lang.Object
implements java.lang.Runnable

Class to resolve which image should be displayed for a given mailmsg. FaceResolver implements Runnable and in the run method, it will do the following:
Get a mailmsg from the Queue (blocks if queue empty)
Determine the icon that goes with this mailmsg and fill it into the mailmsg
Queue the mailmsg to the FaceFrame queue
Repeat

Author:
John Thomas
Constructor Summary
FaceResolver()
          Default constructor for FaceResolver.
 
Method Summary
 void checkAddress()
          Method: checkAddress()
 void queuePut(java.lang.Object obj)
          queuePut will submit mailmsgs to the FaceResolver Queue.
 void refreshOptions()
          Method: refreshOptions() get control initially and when the user refreshes the Option file.
 boolean resolve(Mailmsg mailmsg, boolean usecache, boolean domainonly)
          Method: resolve(Mailmsg,useCacheFlag,domainOnlyFlag) will determine what icon should be displayed for the the specified mailmsg.
 void run()
          This method will get a Mailmsg Object from the queue and attempt to determine what Icon to use to represent it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FaceResolver

public FaceResolver()
Default constructor for FaceResolver. It will processs the Options, ask to be informed if the options change, setup the Queue and remember its own address in case anybody asks.

Method Detail

queuePut

public void queuePut(java.lang.Object obj)
queuePut will submit mailmsgs to the FaceResolver Queue.

This method is used by other objects to add mailmsgs to the Resolver queue so they can have the icon resolved.

Parameters:
obj - - A Mailmsg object

run

public void run()
This method will get a Mailmsg Object from the queue and attempt to determine what Icon to use to represent it. The mailmsg object may be scheduled for:
actionResolve This will use the Select and Kill lists to try to resolve the mailmsg into an icon. If not resolved then it is queued to the PiconDB queue. If it is resolved, then the mailmsg is queued to the FaceBoard queue.
actionResolveAfter this will use the SelectAfter list for resolution. if not resolved it will check if an image was defered because of the PiconDefer list. If it is resolved, then the mailmsg is queued to the FaceBoard queue.

Specified by:
run in interface java.lang.Runnable
Returns:
void

resolve

public boolean resolve(Mailmsg mailmsg,
                       boolean usecache,
                       boolean domainonly)
Method: resolve(Mailmsg,useCacheFlag,domainOnlyFlag) will determine what icon should be displayed for the the specified mailmsg.

It will search the Select statements and the KillSelect statements for a match and if found place a pointer to the image into the Mailmsg object. If it finds a selected icon that also has a audio file specified, it will place a pointer to the audio file into the Mailmsg object also.to be played.

Returns:
boolean - true if icon is selected for this mailmsg

refreshOptions

public void refreshOptions()
Method: refreshOptions() get control initially and when the user refreshes the Option file. It will invoke selectSetup to rebuild the Select lists and also refresh the default URLs used in the rest of the code

Returns:
void

checkAddress

public void checkAddress()
Method: checkAddress()

Returns:
void Bring up a dialog box and ask the user to enter a mail header line. Then build a mailmsg with that header line and simulate the processing of a real mailmsg.