org.compass.core.events
Class CompassEventManager

java.lang.Object
  extended by org.compass.core.events.CompassEventManager
All Implemented Interfaces:
CompassConfigurable, PostCreateEventListener, PostCreateResourceEventListener, PostDeleteEventListener, PostDeleteResourceEventListener, PostSaveEventListener, PostSaveResourceEventListener, PreCreateEventListener, PreCreateResourceEventListener, PreDeleteEventListener, PreDeleteResourceEventListener, PreSaveEventListener, PreSaveResourceEventListener

public class CompassEventManager
extends Object
implements CompassConfigurable, PreCreateEventListener, PreDeleteEventListener, PreSaveEventListener, PostCreateEventListener, PostDeleteEventListener, PostSaveEventListener, PreCreateResourceEventListener, PreSaveResourceEventListener, PreDeleteResourceEventListener, PostCreateResourceEventListener, PostSaveResourceEventListener, PostDeleteResourceEventListener

The event manager responsible for delegation of a specific event to one or more event listeners.

Author:
kimchy

Constructor Summary
CompassEventManager(Compass compass, CompassMapping mapping)
           
 
Method Summary
 void configure(CompassSettings settings)
          Configure using the given settings.
 void onPostCreate(Resource resource)
          An event called after an object is created and accepts the Resource that represents it.
 void onPostCreate(String alias, Object obj)
          An event called after an object is created.
 void onPostDelete(Class clazz, Object obj)
           
 void onPostDelete(Resource resource)
          An event called after an object is delteted and accepts the Resource that represents it.
 void onPostDelete(String alias, Object obj)
          An event called after an object is deleted.
 void onPostSave(Resource resource)
          An event called after an object is saved and accepts the Resource that represents it.
 void onPostSave(String alias, Object obj)
          An event called after an object is saved.
 FilterOperation onPreCreate(Resource resource)
          An event called before an object is created and accepts the Resource that represents it.
 FilterOperation onPreCreate(String alias, Object obj)
          An event called before an object is created.
 FilterOperation onPreDelete(Class clazz, Object obj)
           
 FilterOperation onPreDelete(Resource resource)
          An event called before an object is deleted and accepts the Resource that represents it.
 FilterOperation onPreDelete(String alias, Object obj)
          An event called before an object is created.
 FilterOperation onPreSave(Resource resource)
          An event called before an object is saved and accepts the Resource that represents it.
 FilterOperation onPreSave(String alias, Object obj)
          An event called before an object is saved.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompassEventManager

public CompassEventManager(Compass compass,
                           CompassMapping mapping)
Method Detail

configure

public void configure(CompassSettings settings)
               throws CompassException
Description copied from interface: CompassConfigurable
Configure using the given settings.

Specified by:
configure in interface CompassConfigurable
Parameters:
settings - The settings for the configured object
Throws:
CompassException

onPreCreate

public FilterOperation onPreCreate(String alias,
                                   Object obj)
Description copied from interface: PreCreateEventListener
An event called before an object is created. Maps to the create opeation on the session. Returns if this operation should be filtered or not.

Specified by:
onPreCreate in interface PreCreateEventListener

onPreCreate

public FilterOperation onPreCreate(Resource resource)
Description copied from interface: PreCreateResourceEventListener
An event called before an object is created and accepts the Resource that represents it. Maps to the create opeation on the session. Returns if this operation should be filtered or not.

Specified by:
onPreCreate in interface PreCreateResourceEventListener

onPreDelete

public FilterOperation onPreDelete(String alias,
                                   Object obj)
Description copied from interface: PreDeleteEventListener
An event called before an object is created. Maps to the delete opeation on the session. Returns if this operation should be filtered or not.

Specified by:
onPreDelete in interface PreDeleteEventListener

onPreDelete

public FilterOperation onPreDelete(Class clazz,
                                   Object obj)

onPreDelete

public FilterOperation onPreDelete(Resource resource)
Description copied from interface: PreDeleteResourceEventListener
An event called before an object is deleted and accepts the Resource that represents it. Maps to the delete opeation on the session. Returns if this operation should be filtered or not.

Specified by:
onPreDelete in interface PreDeleteResourceEventListener

onPreSave

public FilterOperation onPreSave(String alias,
                                 Object obj)
Description copied from interface: PreSaveEventListener
An event called before an object is saved. Maps to the save opeation on the session. Returns if this operation should be filtered or not.

Specified by:
onPreSave in interface PreSaveEventListener

onPreSave

public FilterOperation onPreSave(Resource resource)
Description copied from interface: PreSaveResourceEventListener
An event called before an object is saved and accepts the Resource that represents it. Maps to the save opeation on the session. Returns if this operation should be filtered or not.

Specified by:
onPreSave in interface PreSaveResourceEventListener

onPostCreate

public void onPostCreate(String alias,
                         Object obj)
Description copied from interface: PostCreateEventListener
An event called after an object is created. Maps to the create opeation on the session.

Specified by:
onPostCreate in interface PostCreateEventListener

onPostCreate

public void onPostCreate(Resource resource)
Description copied from interface: PostCreateResourceEventListener
An event called after an object is created and accepts the Resource that represents it. Maps to the create opeation on the session.

Specified by:
onPostCreate in interface PostCreateResourceEventListener

onPostDelete

public void onPostDelete(String alias,
                         Object obj)
Description copied from interface: PostDeleteEventListener
An event called after an object is deleted. Maps to the delete opeation on the session.

Specified by:
onPostDelete in interface PostDeleteEventListener

onPostDelete

public void onPostDelete(Class clazz,
                         Object obj)

onPostDelete

public void onPostDelete(Resource resource)
Description copied from interface: PostDeleteResourceEventListener
An event called after an object is delteted and accepts the Resource that represents it. Maps to the delete opeation on the session.

Specified by:
onPostDelete in interface PostDeleteResourceEventListener

onPostSave

public void onPostSave(String alias,
                       Object obj)
Description copied from interface: PostSaveEventListener
An event called after an object is saved. Maps to the save opeation on the session.

Specified by:
onPostSave in interface PostSaveEventListener

onPostSave

public void onPostSave(Resource resource)
Description copied from interface: PostSaveResourceEventListener
An event called after an object is saved and accepts the Resource that represents it. Maps to the save opeation on the session.

Specified by:
onPostSave in interface PostSaveResourceEventListener


Copyright (c) 2004-2008 The Compass Project.