Expresso 5-6

com.jcorporate.expresso.core.misc
Class EventHandler

java.lang.Object
  extended byjava.lang.Thread
      extended bycom.jcorporate.expresso.core.registry.ExpressoThread
          extended bycom.jcorporate.expresso.core.misc.EventHandler
All Implemented Interfaces:
Runnable

public class EventHandler
extends com.jcorporate.expresso.core.registry.ExpressoThread

The EventHandler is an asynchronous handler for email Event notifications - it accepts requests to trigger an event, then sends them "eventually" in a seperate thread

Author:
Michael Nash

Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
EventHandler()
          Constructor
 
Method Summary
static void Event(String dbName, String theEvent, String theMessage, boolean success)
          Queue the requested event for later processing
static void flush()
           
static void notify(String dbName, int uid, String subject, String message)
          Send a user a notification via e-mail with virtual data source attachments.
static void notify(String dbName, int uid, String subject, String message, ByteArrayDataSource[] attachments)
          Send a user a notification via e-mail with virtual data source attachments.
 void run()
          Main thread process of the EventHandler process
static void startUp()
          Code to start up the event handler, which is normally run on framework thread.
 
Methods inherited from class com.jcorporate.expresso.core.registry.ExpressoThread
getThreadContext
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, 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

EventHandler

public EventHandler()
Constructor

Method Detail

Event

public static void Event(String dbName,
                         String theEvent,
                         String theMessage,
                         boolean success)
Queue the requested event for later processing

Parameters:
dbName - the database context
theEvent - the subject line of the event
theMessage - the message text
success - the boolean status flag

flush

public static void flush()
                  throws DBException
Throws:
DBException

notify

public static void notify(String dbName,
                          int uid,
                          String subject,
                          String message)
Send a user a notification via e-mail with virtual data source attachments.

Parameters:
dbName - data context name
uid - the user id
subject - Subject of the e-mail
message - Message to send in body of e-mail

notify

public static void notify(String dbName,
                          int uid,
                          String subject,
                          String message,
                          ByteArrayDataSource[] attachments)
Send a user a notification via e-mail with virtual data source attachments.

Parameters:
dbName - data context name
uid - the user id
subject - Subject of the e-mail
message - Message to send in body of e-mail
attachments - the array list of virtual byte array data sources

run

public void run()
Main thread process of the EventHandler process


startUp

public static void startUp()
Code to start up the event handler, which is normally run on framework thread.


Expresso 5-6

Please see www.jcorporate.com for information about new Expresso releases.