[seam-commits] Seam SVN: r11533 - modules/trunk/web/src/main/java/org/jboss/seam/web.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Sat Oct 3 13:10:27 EDT 2009
Author: shane.bryzak at jboss.com
Date: 2009-10-03 13:10:27 -0400 (Sat, 03 Oct 2009)
New Revision: 11533
Modified:
modules/trunk/web/src/main/java/org/jboss/seam/web/SeamFilter.java
modules/trunk/web/src/main/java/org/jboss/seam/web/SeamListener.java
Log:
remove dependency on seam-bridge
Modified: modules/trunk/web/src/main/java/org/jboss/seam/web/SeamFilter.java
===================================================================
--- modules/trunk/web/src/main/java/org/jboss/seam/web/SeamFilter.java 2009-10-03 08:05:50 UTC (rev 11532)
+++ modules/trunk/web/src/main/java/org/jboss/seam/web/SeamFilter.java 2009-10-03 17:10:27 UTC (rev 11533)
@@ -3,6 +3,7 @@
import java.io.IOException;
import javax.enterprise.inject.spi.BeanManager;
+import javax.inject.Inject;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
@@ -14,7 +15,6 @@
import javax.servlet.http.HttpSession;
import org.jboss.seam.beans.BeanManagerHelper;
-import org.jboss.seam.bridge.ManagerBridge;
/**
* Filter all requests to an application using Seam and perform pre- and post-request
@@ -24,6 +24,7 @@
*/
public class SeamFilter implements Filter
{
+ @Inject BeanManager beanManager;
public void init(FilterConfig config) throws ServletException
{
@@ -62,8 +63,8 @@
private void registerSession(HttpSession session)
{
- BeanManager manager = ManagerBridge.getProvider().getCurrentManager();
- HttpSessionManager sessionManager = BeanManagerHelper.getInstanceByType(manager, HttpSessionManager.class);
+ HttpSessionManager sessionManager = BeanManagerHelper.getInstanceByType(
+ beanManager, HttpSessionManager.class);
sessionManager.setSession(session);
registeredSession = session;
}
Modified: modules/trunk/web/src/main/java/org/jboss/seam/web/SeamListener.java
===================================================================
--- modules/trunk/web/src/main/java/org/jboss/seam/web/SeamListener.java 2009-10-03 08:05:50 UTC (rev 11532)
+++ modules/trunk/web/src/main/java/org/jboss/seam/web/SeamListener.java 2009-10-03 17:10:27 UTC (rev 11533)
@@ -2,15 +2,17 @@
import javax.enterprise.inject.AnnotationLiteral;
import javax.enterprise.inject.spi.BeanManager;
+import javax.inject.Inject;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
import org.jboss.seam.beans.Created;
import org.jboss.seam.beans.Destroyed;
-import org.jboss.seam.bridge.ManagerBridge;
public class SeamListener implements HttpSessionListener //, ServletContextListener, ServletRequestListener
{
+ @Inject BeanManager beanManager;
+
public void sessionCreated(HttpSessionEvent event)
{
getBeanManager().fireEvent(event.getSession(), new AnnotationLiteral<Created>() {});
@@ -23,6 +25,6 @@
protected BeanManager getBeanManager()
{
- return ManagerBridge.getProvider().getCurrentManager();
+ return beanManager;
}
}
More information about the seam-commits
mailing list