org.apache.myfaces.config
Class ManagedBeanDestroyer

java.lang.Object
  extended by org.apache.myfaces.config.ManagedBeanDestroyer
All Implemented Interfaces:
EventListener, FacesListener, SystemEventListener

public class ManagedBeanDestroyer
extends Object
implements SystemEventListener

Destroyes managed beans with the current LifecycleProvider. This guarantees the invocation of the @PreDestroy methods.

Since:
2.0
Version:
$Revision: 1532605 $ $Date: 2013-10-15 19:06:28 -0500 (Tue, 15 Oct 2013) $
Author:
Jakob Korherr (latest modification by $Author: lu4242 $)

Constructor Summary
ManagedBeanDestroyer(LifecycleProvider lifecycleProvider, RuntimeConfig runtimeConfig)
          Creates the ManagedBeanDestroyer for the given RuntimeConfig and LifecycleProvider.
 
Method Summary
 void destroy(String name, Object instance)
          Destroys the given managed bean.
 boolean isListenerForSource(Object source)
           
 boolean isManagedBean(String name)
          Checks if the given managed bean exists in the RuntimeConfig.
 void processEvent(SystemEvent event)
          Listens to PreDestroyCustomScopeEvent and PreDestroyViewMapEvent and invokes destroy() for every managed bean in the associated scope.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ManagedBeanDestroyer

public ManagedBeanDestroyer(LifecycleProvider lifecycleProvider,
                            RuntimeConfig runtimeConfig)
Creates the ManagedBeanDestroyer for the given RuntimeConfig and LifecycleProvider.

Parameters:
lifecycleProvider -
runtimeConfig -
Method Detail

isListenerForSource

public boolean isListenerForSource(Object source)
Specified by:
isListenerForSource in interface SystemEventListener

processEvent

public void processEvent(SystemEvent event)
Listens to PreDestroyCustomScopeEvent and PreDestroyViewMapEvent and invokes destroy() for every managed bean in the associated scope.

Specified by:
processEvent in interface SystemEventListener

isManagedBean

public boolean isManagedBean(String name)
Checks if the given managed bean exists in the RuntimeConfig.

Parameters:
name -
Returns:

destroy

public void destroy(String name,
                    Object instance)
Destroys the given managed bean.

Parameters:
name -
instance -


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.