FileDocCategorySizeDatePackage
MetadataEntityClassListener.javaAPI DocGlassfish v2 API4043Tue May 22 16:54:26 BST 2007oracle.toplink.essentials.internal.ejb.cmp3.metadata.listeners

MetadataEntityClassListener

public class MetadataEntityClassListener extends MetadataEntityListener
A callback listener for those entities that define callback methods. Callback methods on an entity must be signatureless, hence, this class overrides behavior from CBListener.
author
Guy Pelletier
since
TopLink 10.1.3/EJB 3.0 Preview

Fields Summary
Constructors Summary
public MetadataEntityClassListener(Class entityClass)
INTERNAL:

        super(entityClass);
    
Methods Summary
public voidaddEventMethod(java.lang.String event, java.lang.reflect.Method method)
INTERNAL: For entity classes listener methods, they need to override listeners from mapped superclasses for the same method. So we need to override this method and make the override check instead of it throwing an exception for multiple lifecycle methods for the same event.

        if (! hasOverriddenEventMethod(method, event)) {
            super.addEventMethod(event, method);
        }
    
public java.lang.ClassgetListenerClass()
INTERNAL:

        return getEntityClass();
    
protected voidinvokeMethod(java.lang.String event, oracle.toplink.essentials.descriptors.DescriptorEvent descriptorEvent)
INTERNAL:

        Object[] objectList = {};
        invokeMethod(getEventMethod(event), descriptorEvent.getObject(), objectList, descriptorEvent);
    
public booleanisEntityClassListener()
INTERNAL:

        return true;
    
protected voidvalidateMethod(java.lang.reflect.Method method)
INTERNAL:

        if (method.getParameterTypes().length > 0) {
            throw ValidationException.invalidEntityCallbackMethodArguments(getEntityClass(), method.getName());
        } else {
            // So far so good, now check the method modifiers.
            validateMethodModifiers(method);
        }