org.apache.sling.commons.testing.jcr
Class EventHelper

java.lang.Object
  extended by org.apache.sling.commons.testing.jcr.EventHelper
All Implemented Interfaces:
javax.jcr.observation.EventListener

public class EventHelper
extends Object
implements javax.jcr.observation.EventListener

Used by tests to wait until JCR notification events have been delivered.


Field Summary
static String WAIT_NODE_FOLDER
           
static String WAIT_NODE_NODE
           
 
Constructor Summary
EventHelper(javax.jcr.Session s)
           
 
Method Summary
 void dispose()
          Remove the event listener from the observation listener.
 void onEvent(javax.jcr.observation.EventIterator it)
           
 void waitForEvents(long timeoutMsec)
          To make sure observation events have been delivered, create or delete a a node and wait for the corresponding events to be received.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WAIT_NODE_FOLDER

public static final String WAIT_NODE_FOLDER
See Also:
Constant Field Values

WAIT_NODE_NODE

public static final String WAIT_NODE_NODE
Constructor Detail

EventHelper

public EventHelper(javax.jcr.Session s)
            throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException
Method Detail

onEvent

public void onEvent(javax.jcr.observation.EventIterator it)
Specified by:
onEvent in interface javax.jcr.observation.EventListener

waitForEvents

public void waitForEvents(long timeoutMsec)
                   throws javax.jcr.RepositoryException
To make sure observation events have been delivered, create or delete a a node and wait for the corresponding events to be received.

Throws:
javax.jcr.RepositoryException

dispose

public void dispose()
Remove the event listener from the observation listener.



Copyright © 2007-2011 The Apache Software Foundation. All Rights Reserved.