Compoze Software, Inc.

com.compoze.trigger
Class TriggerServer


java.lang.Object

  |

  +--com.compoze.trigger.TriggerServer

All Implemented Interfaces:
ITriggerPropertiesKeys

public class TriggerServer
extends java.lang.Object
implements ITriggerPropertiesKeys

This class implements a trigger server. The trigger server maintains a list of trigger events and executes actions for those events as they occur.


Inner Class Summary
 class TriggerServer.TcpMainThread
          This class implements the tcp main thread.
 class TriggerServer.TriggerThread
          This class implements the thread that triggers events.
 
Fields inherited from interface com.compoze.trigger.ITriggerPropertiesKeys
TRIGGER_BACKLOG_KEY, TRIGGER_BINDADDRESS_KEY, TRIGGER_DISCOVERY_GROUP_KEY, TRIGGER_DISCOVERY_MAGIC_KEY, TRIGGER_DISCOVERY_PORT_KEY, TRIGGER_DISCOVERY_SERVER_KEY, TRIGGER_DISCOVERY_TIMEOUT_KEY, TRIGGER_DISCOVERY_TTL_KEY, TRIGGER_EVENTLIST_KEY, TRIGGER_PORT_KEY, TRIGGER_STARTUP_DATASOURCE_NAME, TRIGGER_STARTUP_JDBC_DRIVER, TRIGGER_STARTUP_JDBC_PASSWORD, TRIGGER_STARTUP_JDBC_POOL_SIZE, TRIGGER_STARTUP_JDBC_URL, TRIGGER_STARTUP_JDBC_USERNAME, TRIGGER_STARTUP_KEY, TRIGGER_TIMEOUT_IMPLEMENTOR, TRIGGER_TIMEOUT_INITIAL, TRIGGER_TIMEOUT_NAGLEFACTOR, TRIGGER_TIMEOUT_RETRIES
 
Method Summary
 java.util.Date getNextTriggerDate()
          Gets the date of the next trigger.
 int getTriggerCount()
          Gets the number of triggers in the server.
 java.lang.Object handleRequest(java.lang.Object request, long lTimestamp)
          Handles requests.
static TriggerServer i()
          Gets the instance of this class.
static void main(java.lang.String[] args)
          Main.
 void start()
           
 boolean started()
          Checks for if trigger server is started.
 void stop()
          Stops main server loop.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

i


public static TriggerServer i()
                       throws TriggerSchedulerException
Gets the instance of this class.
Throws:
TriggerSchedulerException - if can not retrieve an instance of this class

handleRequest


public java.lang.Object handleRequest(java.lang.Object request,
                                      long lTimestamp)
                               throws TriggerSchedulerException
Handles requests.
Parameters:
request - the request to handle
lTimeStamp - timestamp of when request was sent
Throws:
TriggerSchedulerException - if request is not handled correctly

started


public boolean started()
Checks for if trigger server is started.

getTriggerCount


public int getTriggerCount()
Gets the number of triggers in the server.
Returns:
the number of triggers or -1 if server not started

getNextTriggerDate


public java.util.Date getNextTriggerDate()
Gets the date of the next trigger.
Returns:
the date of the next trigger or null if the server is not started

start


public void start()
           throws TriggerSchedulerException

stop


public void stop()
Stops main server loop.

main


public static void main(java.lang.String[] args)
Main.

Compoze Software, Inc.

Copyright ©1999-2001 Compoze Software, Inc. All rights reserved.