org.mmbase.core.event
Class NodeEventHelper

java.lang.Object
  extended by org.mmbase.core.event.NodeEventHelper

public class NodeEventHelper
extends Object

This is a utility class to create node event and relation event instances. the reason for it is that we want to references to core classes in the NodeEvent and RelationEvent classes, to keep them bridge-friendly, but we need a little help for easy instantiation.

Since:
MMBase-1.8
Version:
$Id: NodeEventHelper.java 42089 2010-05-03 13:49:10Z michiel $
Author:
Ernst Bunders

Constructor Summary
NodeEventHelper()
           
 
Method Summary
static NodeEvent createNodeEventInstance(MMObjectNode node, int eventType, String machineName)
          create an NodeEvent instance with an MMObjectNode
static NodeEvent createNodeEventInstance(Node node, int eventType, String machineName)
           
static RelationEvent createRelationEventInstance(MMObjectNode node, int eventType, String machineName)
          create an RelationEvent instnce with an MMObjectNode (builder should be specialization of insrel)
static RelationEvent createRelationEventInstance(Relation node, int eventType, String machineName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeEventHelper

public NodeEventHelper()
Method Detail

createNodeEventInstance

public static NodeEvent createNodeEventInstance(Node node,
                                                int eventType,
                                                String machineName)

createNodeEventInstance

public static NodeEvent createNodeEventInstance(MMObjectNode node,
                                                int eventType,
                                                String machineName)
create an NodeEvent instance with an MMObjectNode

Parameters:
node -
eventType -
machineName - or null to create a node event with local machine name
Returns:
new instance of NodeEvent

createRelationEventInstance

public static RelationEvent createRelationEventInstance(Relation node,
                                                        int eventType,
                                                        String machineName)

createRelationEventInstance

public static RelationEvent createRelationEventInstance(MMObjectNode node,
                                                        int eventType,
                                                        String machineName)
create an RelationEvent instnce with an MMObjectNode (builder should be specialization of insrel)

Parameters:
node -
eventType -
machineName -
Returns:
a new RelationEvetn instance
Throws:
IllegalArgumentException - when given node's builder is not a specialization of insrel


MMBase 2.0-SNAPSHOT - null