org.obe.spi.util
Class ApplicationEventUtil

java.lang.Object
  extended byorg.obe.spi.util.ApplicationEventUtil

public class ApplicationEventUtil
extends java.lang.Object

Provides utility methods for handling application events.

Author:
Adrian Price

Method Summary
static java.util.Date handleTimeout(ApplicationEventBroker.TemporalEventSubscription subscription, java.util.Date scheduledExecutionTime, ServiceManager svcMgr)
          Handles the timeout for a temporal event subscription.
static java.lang.Object[] toStrings(java.lang.Object[] array)
          Converts the elements of an array to strings.
static void validateSubscription(java.lang.String eventType, java.util.Date effective, java.util.Date expiry, int count, Duration interval, java.lang.String[] correlationKeys)
          Validates the parameters for a temporal event subscription.
static void validateSubscription(java.lang.String eventType, java.util.Date effective, java.util.Date expiry, int count, java.lang.String[] correlationKeys)
          Validates the parameters for an application event subscription.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

handleTimeout

public static java.util.Date handleTimeout(ApplicationEventBroker.TemporalEventSubscription subscription,
                                           java.util.Date scheduledExecutionTime,
                                           ServiceManager svcMgr)
Handles the timeout for a temporal event subscription. The method decrements the subscription's event count. Then, for a recurring subscription that hasn't expired, it computes the time at which the next event should occur, according to whether the subscription is recoverable. If the subscription will have expired before the next occurrence or if its event count has reached 0, the subscription is cancelled.

Finally, the listeners are notified asynchronously of the event occurrence.

Parameters:
subscription - The temporal event subscription.
scheduledExecutionTime - The time at which the timeout was scheduled to occur (not necessarily the time at which it actually occurred).
svcMgr - The service manager to use.
Returns:
For an unexpired recurring subscription, the time at which the next temporal event should occur, otherwise null.

validateSubscription

public static void validateSubscription(java.lang.String eventType,
                                        java.util.Date effective,
                                        java.util.Date expiry,
                                        int count,
                                        java.lang.String[] correlationKeys)
Validates the parameters for an application event subscription.

Parameters:
eventType -
effective -
expiry -
count -
correlationKeys -
Throws:
java.lang.IllegalArgumentException - if any of the parameter values are incorrect.

validateSubscription

public static void validateSubscription(java.lang.String eventType,
                                        java.util.Date effective,
                                        java.util.Date expiry,
                                        int count,
                                        Duration interval,
                                        java.lang.String[] correlationKeys)
Validates the parameters for a temporal event subscription.

Parameters:
eventType -
effective -
expiry -
count -
interval -
correlationKeys -
Throws:
java.lang.IllegalArgumentException - if any of the parameter values are incorrect.

toStrings

public static java.lang.Object[] toStrings(java.lang.Object[] array)
Converts the elements of an array to strings.

Parameters:
array - An array of objects.
Returns:
The input array, with all elements replaced by the result of calling toString() on each.


SourceForge.net Logo OBE-1.0 Copyright (c) 2002-2006 Adrian Price. All Rights Reserved.