Skip to content

Commit

Permalink
call beforeshutdown for all bean archives in the deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
pmuir committed Jan 10, 2010
1 parent d37e9c7 commit 18bdb3e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
Expand Up @@ -39,8 +39,8 @@
import javax.enterprise.inject.spi.Extension;

import org.jboss.weld.Container;
import org.jboss.weld.ContextualStoreImpl;
import org.jboss.weld.ContainerState;
import org.jboss.weld.ContextualStoreImpl;
import org.jboss.weld.bean.builtin.BeanManagerBean;
import org.jboss.weld.bootstrap.api.Bootstrap;
import org.jboss.weld.bootstrap.api.Environment;
Expand Down Expand Up @@ -438,7 +438,7 @@ public void shutdown()
{
try
{
BeforeShutdownImpl.fire(deploymentManager);
BeforeShutdownImpl.fire(deploymentManager, beanDeployments);
}
finally
{
Expand Down
Expand Up @@ -16,8 +16,12 @@
*/
package org.jboss.weld.bootstrap.events;

import java.util.Map;

import javax.enterprise.inject.spi.BeforeShutdown;

import org.jboss.weld.bootstrap.BeanDeployment;
import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
import org.jboss.weld.manager.BeanManagerImpl;

/**
Expand All @@ -27,9 +31,17 @@
public class BeforeShutdownImpl extends AbstractContainerEvent implements BeforeShutdown
{

public static void fire(BeanManagerImpl beanManager)
public static void fire(BeanManagerImpl beanManager, Map<BeanDeploymentArchive, BeanDeployment> beanDeployments)
{
new BeforeShutdownImpl(beanManager).fire();
if (beanDeployments == null)
{
// Shutdown may have been called with an early-failure, before beanDeployments is built
new BeforeShutdownImpl(beanManager).fire();
}
else
{
new BeforeShutdownImpl(beanManager).fire(beanDeployments);
}
}

public BeforeShutdownImpl(BeanManagerImpl beanManager)
Expand Down

0 comments on commit 18bdb3e

Please sign in to comment.