org.datanucleus.metadata
Class EventListenerMetaData

java.lang.Object
  extended by org.datanucleus.metadata.MetaData
      extended by org.datanucleus.metadata.EventListenerMetaData
All Implemented Interfaces:
java.io.Serializable

public class EventListenerMetaData
extends MetaData

Listener for events, following the JPA1 model.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.datanucleus.metadata.MetaData
extensions, LOCALISER, METADATA_CREATED_STATE, METADATA_INITIALISED_STATE, METADATA_POPULATED_STATE, METADATA_USED_STATE, metaDataState, parent, VENDOR_NAME, VENDOR_NAME_OLD
 
Constructor Summary
EventListenerMetaData(java.lang.String className)
          Constructor for an EventListener MetaData
 
Method Summary
 void addCallback(java.lang.String callbackClassName, java.lang.String methodName)
          Method to add a method name for this EventListener.
 void addCallback(java.lang.String callbackClassName, java.lang.String className, java.lang.String methodName)
          Method to add a method name for this EventListener.
 java.lang.String getClassName()
          Accessor for the name of the EventListener class
 java.lang.String getMethodNameForCallbackClass(java.lang.String callbackClassName)
          Accessor for the method name in the EventListener class that handles the specified callback event
 
Methods inherited from class org.datanucleus.metadata.MetaData
addExtension, addExtension, assertIfInitialised, getExtensions, getNoOfExtensions, getParent, getValueForExtension, getValuesForExtension, hasExtension, initialise, isInitialised, isPopulated, isUsed, newExtensionMetaData, removeExtension, setParent, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EventListenerMetaData

public EventListenerMetaData(java.lang.String className)
Constructor for an EventListener MetaData

Parameters:
className - Name of the EventListener class
Method Detail

getClassName

public java.lang.String getClassName()
Accessor for the name of the EventListener class

Returns:
Name of the EventListener

addCallback

public void addCallback(java.lang.String callbackClassName,
                        java.lang.String methodName)
Method to add a method name for this EventListener.

Parameters:
callbackClassName - Name of the callback type (javax.persistence.PrePersist etc)
methodName - The method in the EventListener class that handles it

addCallback

public void addCallback(java.lang.String callbackClassName,
                        java.lang.String className,
                        java.lang.String methodName)
Method to add a method name for this EventListener.

Parameters:
callbackClassName - Name of the callback class
className - Name of the class declaring the method
methodName - The method in the className class that handles it

getMethodNameForCallbackClass

public java.lang.String getMethodNameForCallbackClass(java.lang.String callbackClassName)
Accessor for the method name in the EventListener class that handles the specified callback event

Parameters:
callbackClassName - Name of the callback class
Returns:
The method name (if any). Fully-qualified


Copyright © 2011. All Rights Reserved.