org.apache.myfaces.config
Class ManagedBeanDestroyer

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

public class ManagedBeanDestroyer
extends java.lang.Object
implements javax.faces.event.SystemEventListener

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

Since:
2.0
Version:
$Revision$ $Date$
Author:
Jakob Korherr (latest modification by $Author$)

Constructor Summary
ManagedBeanDestroyer(LifecycleProvider lifecycleProvider, RuntimeConfig runtimeConfig)
          Creates the ManagedBeanDestroyer for the given RuntimeConfig and LifecycleProvider.
 
Method Summary
 void destroy(java.lang.String name, java.lang.Object instance)
          Destroys the given managed bean.
 boolean isListenerForSource(java.lang.Object source)
           
 boolean isManagedBean(java.lang.String name)
          Checks if the given managed bean exists in the RuntimeConfig.
 void processEvent(javax.faces.event.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(java.lang.Object source)
Specified by:
isListenerForSource in interface javax.faces.event.SystemEventListener

processEvent

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

Specified by:
processEvent in interface javax.faces.event.SystemEventListener

isManagedBean

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

Parameters:
name -
Returns:

destroy

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

Parameters:
name -
instance -


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