public void onApplicationEvent( ApplicationEvent event ) {
if ( !( event instanceof LifecycleApplicationEvent ) ) {
return;
}
LifecycleApplicationEvent lifecycleApplicationEvent = ( LifecycleApplicationEvent ) event;
if ( !shouldHandleEvent( lifecycleApplicationEvent ) ) {
return;
}
if ( !type.isAssignableFrom( lifecycleApplicationEvent.getObject().getClass() ) ) {
return;
}
T eventObject = ( T ) lifecycleApplicationEvent.getObject();
if ( LifecycleApplicationEvent.CREATED.equals( lifecycleApplicationEvent.getEventType() ) ) {
handleNewObject( eventObject );
} else if ( LifecycleApplicationEvent.MODIFIED.equals( lifecycleApplicationEvent.getEventType() ) ) {
handleUpdatedObject( eventObject );
} else if ( LifecycleApplicationEvent.DELETED.equals( lifecycleApplicationEvent.getEventType() ) ) {
handleDeletedObject( eventObject );
}
}