js.ea
Class EAHelper

java.lang.Object
  extended by js.ea.EAHelper

public class EAHelper
extends java.lang.Object

Provides some important methods used by the event agent.

Author:
Johannes Testori

Constructor Summary
EAHelper()
           
 
Method Summary
static boolean checkForSend(JSProducerEvent pEv, JSConsumerEvent cEv, java.lang.Object[] args)
          Checks if an event may be sent.
static EventAgent getEventAgent(java.lang.Object o)
           
static VA getVAforNA(NetworkAgent na, java.lang.String appId)
           
static boolean isEntity(java.lang.Object o)
           
static boolean isEventEnabled(int eventType, java.util.Properties props)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EAHelper

public EAHelper()
Method Detail

checkForSend

public static boolean checkForSend(JSProducerEvent pEv,
                                   JSConsumerEvent cEv,
                                   java.lang.Object[] args)
Checks if an event may be sent.

Parameters:
event - js.ea.JSProducerEvent
consumer - js.ea.JSEventConsumer
Returns:
true if the event can be produced

getEventAgent

public static EventAgent getEventAgent(java.lang.Object o)
Parameters:
o - java.lang.Object
Returns:
the EventAgent for the sepcified object, null if object has no reference to an EventAgent

getVAforNA

public static VA getVAforNA(NetworkAgent na,
                            java.lang.String appId)
Parameters:
na - js.na.NetworkAgent
Returns:
a VA that is on the specified NetworkAgent, or null, if none exists

isEntity

public static boolean isEntity(java.lang.Object o)
Parameters:
o - java.lang.Object
Returns:
true if the object can be used as source/destination of an event

isEventEnabled

public static boolean isEventEnabled(int eventType,
                                     java.util.Properties props)
Parameters:
eventType - int
props - java.util.Properties
Returns:
true if the specified eventType is enabled in the given properties.