/** * Returns a {@link ListenerMap} for the component. A ListenerMap contains a number of * synthetic read-only properties that implement the {@link IActionListener}interface, but in * fact, cause public instance methods to be invoked. * * @since 1.0.2 */ public ListenerMap getListeners() { // This is what's called a violation of the Law of Demeter! // This should probably be converted over to some kind of injection, as with // getMessages(), etc. if (_listeners == null) _listeners = getPage().getEngine().getInfrastructure().getListenerMapSource().getListenerMapForObject(this); return _listeners; }
/** * Returns a {@link ListenerMap} for the component. A ListenerMap contains a number of * synthetic read-only properties that implement the {@link IActionListener}interface, but in * fact, cause public instance methods to be invoked. * * @since 1.0.2 */ public ListenerMap getListeners() { // This is what's called a violation of the Law of Demeter! // This should probably be converted over to some kind of injection, as with // getMessages(), etc. if (_listeners == null) _listeners = getPage().getEngine().getInfrastructure().getListenerMapSource().getListenerMapForObject(this); return _listeners; }
/** * Gets the page from a pool, or otherwise loads the page. This operation is threadsafe. */ public IPage getPage(IRequestCycle cycle, String pageName) { IEngine engine = cycle.getEngine(); Object key = buildKey(engine, pageName); IPage result; // lock our page specific key lock first // This is only a temporary measure until a more robust // page pool implementation can be created. try { result = (IPage) _pool.borrowObject(key); } catch (Exception ex) { if (RuntimeException.class.isInstance(ex)) throw (RuntimeException)ex; else throw new ApplicationRuntimeException(PageloadMessages.errorPagePoolGet(key), ex); } if (result.getEngine() == null) { // This call will also fire events to any PageAttachListeners result.attach(engine, cycle); } return result; }
/** * Gets the page from a pool, or otherwise loads the page. This operation is threadsafe. */ public IPage getPage(IRequestCycle cycle, String pageName) { IEngine engine = cycle.getEngine(); Object key = buildKey(engine, pageName); IPage result; // lock our page specific key lock first // This is only a temporary measure until a more robust // page pool implementation can be created. try { result = (IPage) _pool.borrowObject(key); } catch (Exception ex) { if (RuntimeException.class.isInstance(ex)) throw (RuntimeException)ex; else throw new ApplicationRuntimeException(PageloadMessages.errorPagePoolGet(key), ex); } if (result.getEngine() == null) { // This call will also fire events to any PageAttachListeners result.attach(engine, cycle); } return result; }