/** * PUBLIC: * Synanym for source. */ public Object getObject() { return getSource(); }
/** * INTERNAL: */ protected void invokeMethod(String event, DescriptorEvent descriptorEvent) { Object[] objectList = { descriptorEvent.getSource() }; invokeMethod(getEventMethod(event), m_listener, objectList, descriptorEvent); }
/** * INTERNAL: */ public String toString() { String eventName = "UnkownEvent"; if ((getEventCode() >= 0) && (getEventCode() < DescriptorEventManager.NumberOfEvents)) { eventName = eventNames[getEventCode()]; } return eventName + "(" + getSource().getClass() + ")"; }
/** * PUBLIC: * Re-populate the database row with the values from the source object based upon the * attribute's mapping. Provided as a helper method for modifying the row during event * handling. */ public void applyAttributeValuesIntoRow(String attributeName) { ClassDescriptor descriptor = getSession().getDescriptor(getSource()); DatabaseMapping mapping = descriptor.getMappingForAttributeName(attributeName); if (mapping == null) { throw ValidationException.missingMappingForAttribute(descriptor, attributeName, this.toString()); } if (getRecord() != null) { mapping.writeFromObjectIntoRow(getSource(), (AbstractRecord)getRecord(), getSession()); } }
notifyEJB30Listeners(event); if (event.getSource() instanceof DescriptorEventListener) { notifyListener((DescriptorEventListener)event.getSource(), event); return; if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){ try { AccessController.doPrivileged(new PrivilegedMethodInvoker(eventMethod, event.getSource(), runtimeParameters)); } catch (PrivilegedActionException exception) { Exception throwableException = exception.getException(); PrivilegedAccessHelper.invokeMethod(eventMethod, event.getSource(), runtimeParameters);
/** * PUBLIC: * The source object represents the object the event is being raised on, * some events also require a second object, for example the original object in a postClone. * * @see EventObject#getSource() */ public Object getOriginalObject() { // Compute the original for unit of work writes. if ((originalObject == null) && getSession().isUnitOfWork() && (getQuery() != null) && (getQuery().isObjectLevelModifyQuery())) { setOriginalObject(((UnitOfWorkImpl)getSession()).getOriginalVersionOfObject(getSource())); } return originalObject; }