@Override public void close() { environmentFactoryCtxWireContext.fire(WireContext.EVENT_CLOSE, null); }
/** * fires the close event then removes the listeners, and cleans up the constructed objects of the context (cleans up * the object in the cache and the object in construction). * * @see #EVENT_CLOSE */ @Override public synchronized void close() { if (LOG.isLoggable(Level.FINE)) { LOG.fine("closing " + name + "..."); } // fire the close event fire(EVENT_CLOSE, null); }
/** * initializes the eager objects and then fires the create event. This method only needs to be called explicitly in * case <code>delayCreate</code> is true in {@link #WireContext(WireDefinition, String, Environment, boolean)}. */ public void create() { if (LOG.isLoggable(Level.FINE)) { LOG.fine("creating " + name); } initializeEagerObjects(); fire(EVENT_OPEN, null); }
/** fires a {@link WireObjectEventInfo}. */ protected void fireObjectEvent(final String eventName, final String objectName, final Object object) { WireObjectEventInfo wireEvent = null; // first fire the event on the descriptor for object specific listeners if (wireDefinition != null) { final Map<String, Descriptor> descriptors = wireDefinition.getDescriptors(); if (descriptors != null) { final Descriptor descriptor = descriptors.get(objectName); if (descriptor != null) { wireEvent = new WireObjectEventInfo(eventName, objectName, object); descriptor.fire(eventName, wireEvent); } } } // then fire the event on this wiring environment for global listeners if (listeners != null && wireEvent == null) { wireEvent = new WireObjectEventInfo(eventName, objectName, object); } fire(eventName, wireEvent); }