Search in sources :

Example 1 with SystemEventListener

use of javax.faces.event.SystemEventListener in project liferay-faces-bridge-impl by liferay.

the class ApplicationCompatImpl method subscribeToJSF2SystemEvent.

protected void subscribeToJSF2SystemEvent(ConfiguredSystemEventListener configuredSystemEventListener) {
    try {
        ClassLoader classLoader = TCCLUtil.getThreadContextClassLoaderOrDefault(getClass());
        @SuppressWarnings("unchecked") Class<? extends SystemEvent> systemEventClass = (Class<? extends SystemEvent>) classLoader.loadClass(configuredSystemEventListener.getSystemEventClass());
        @SuppressWarnings("unchecked") Class<? extends SystemEventListener> systemEventListenerClass = (Class<? extends SystemEventListener>) classLoader.loadClass(configuredSystemEventListener.getSystemEventListenerClass());
        SystemEventListener systemEventListener = systemEventListenerClass.newInstance();
        logger.debug("Subscribing UIViewRootBridgeImpl for systemEventClass=[{0}] systemEventListener=[{1}]", systemEventClass, systemEventListener);
        subscribeToEvent(systemEventClass, UIViewRootBridgeImpl.class, systemEventListener);
    } catch (Exception e) {
        logger.error(e);
    }
}
Also used : SystemEvent(javax.faces.event.SystemEvent) SystemEventListener(javax.faces.event.SystemEventListener) ConfiguredSystemEventListener(com.liferay.faces.util.config.ConfiguredSystemEventListener)

Aggregations

ConfiguredSystemEventListener (com.liferay.faces.util.config.ConfiguredSystemEventListener)1 SystemEvent (javax.faces.event.SystemEvent)1 SystemEventListener (javax.faces.event.SystemEventListener)1