protected void reset() { classes = new HashMap(); imports = new HashMap(); collections = new HashMap(); tables = new TreeMap(); namedQueries = new HashMap(); namedSqlQueries = new HashMap(); sqlResultSetMappings = new HashMap(); xmlHelper = new XMLHelper(); typeDefs = new HashMap(); propertyReferences = new ArrayList(); secondPasses = new ArrayList(); interceptor = EmptyInterceptor.INSTANCE; properties = Environment.getProperties(); entityResolver = XMLHelper.DEFAULT_DTD_RESOLVER; eventListeners = new EventListeners(); filterDefinitions = new HashMap(); // extendsQueue = new ArrayList(); extendsQueue = new HashMap(); auxiliaryDatabaseObjects = new ArrayList(); tableNameBinding = new HashMap(); columnNameBindingPerTable = new HashMap(); namingStrategy = DefaultNamingStrategy.INSTANCE; sqlFunctions = new HashMap(); }
private void configureListeners(Ejb3Configuration cfg) { EventListeners eventListeners = cfg.getEventListeners(); cfg.setListeners("post-load", concatListeners(PostLoadEventListener.class, _postLoadEventListeners, eventListeners.getPostLoadEventListeners())); cfg.setListeners("save-update", concatListeners(SaveOrUpdateEventListener.class, _saveOrUpdateEventListeners, eventListeners.getSaveOrUpdateEventListeners())); cfg.setListeners("merge", concatListeners(MergeEventListener.class, _mergeEventListeners, eventListeners.getMergeEventListeners())); cfg.setListeners("create", concatListeners(PersistEventListener.class, _persistEventListeners, eventListeners.getPersistEventListeners())); // TODO: do we also need create-on-flush event? }
private EventListeners getInitializedEventListeners() { EventListeners result = (EventListeners) eventListeners.shallowCopy(); result.initializeListeners( this ); return result; }
public EventListeners getEventListeners() { return eventListeners; }
public EventListeners getListeners() { return listeners; }
public EventListeners getListeners() { throw new UnsupportedOperationException(); }
private static void addEventListeners(PageContext pc, SessionFactoryData data, Key key) throws PageException { if(!data.getORMConfiguration().eventHandling()) return; String eventHandler = data.getORMConfiguration().eventHandler(); AllEventListener listener=null; if(!Util.isEmpty(eventHandler,true)){ //try { Component c = pc.loadComponent(eventHandler.trim()); listener = new AllEventListener(c); //config.setInterceptor(listener); //}catch (PageException e) {e.printStackTrace();} } Configuration conf = data.getConfiguration(key); conf.setInterceptor(new InterceptorImpl(listener)); EventListeners listeners = conf.getEventListeners(); Map<String, CFCInfo> cfcs = data.getCFCs(key); // post delete List<EventListener> list=merge(listener,cfcs,CommonUtil.POST_DELETE); listeners.setPostDeleteEventListeners(list.toArray(new PostDeleteEventListener[list.size()])); // post insert list=merge(listener,cfcs,CommonUtil.POST_INSERT); listeners.setPostInsertEventListeners(list.toArray(new PostInsertEventListener[list.size()])); // post update list=merge(listener,cfcs,CommonUtil.POST_UPDATE); listeners.setPostUpdateEventListeners(list.toArray(new PostUpdateEventListener[list.size()])); // post load list=merge(listener,cfcs,CommonUtil.POST_LOAD); listeners.setPostLoadEventListeners(list.toArray(new PostLoadEventListener[list.size()])); // pre delete list=merge(listener,cfcs,CommonUtil.PRE_DELETE); listeners.setPreDeleteEventListeners(list.toArray(new PreDeleteEventListener[list.size()])); // pre insert //list=merge(listener,cfcs,CommonUtil.PRE_INSERT); //listeners.setPreInsertEventListeners(list.toArray(new PreInsertEventListener[list.size()])); // pre load list=merge(listener,cfcs,CommonUtil.PRE_LOAD); listeners.setPreLoadEventListeners(list.toArray(new PreLoadEventListener[list.size()])); // pre update //list=merge(listener,cfcs,CommonUtil.PRE_UPDATE); //listeners.setPreUpdateEventListeners(list.toArray(new PreUpdateEventListener[list.size()])); }
/** * Retrieves the configured event listeners from this event source. * * @return The configured event listeners. */ public EventListeners getListeners();