Seam SVN: r12580 - modules/faces/tags.
by seam-commits@lists.jboss.org
Author: lincolnthree
Date: 2010-04-22 17:32:19 -0400 (Thu, 22 Apr 2010)
New Revision: 12580
Added:
modules/faces/tags/3.0.0.Alpha2/
Log:
[maven-scm] copy for tag 3.0.0.Alpha2
Copied: modules/faces/tags/3.0.0.Alpha2 (from rev 12579, modules/faces/trunk)
14 years, 9 months
Seam SVN: r12579 - in modules/faces/tags/3.0.0.Alpha1: api and 1 other directories.
by seam-commits@lists.jboss.org
Author: lincolnthree
Date: 2010-04-22 17:32:05 -0400 (Thu, 22 Apr 2010)
New Revision: 12579
Modified:
modules/faces/tags/3.0.0.Alpha1/api/pom.xml
modules/faces/tags/3.0.0.Alpha1/impl/pom.xml
modules/faces/tags/3.0.0.Alpha1/pom.xml
Log:
[maven-release-plugin] prepare release 3.0.0.Alpha2
Modified: modules/faces/tags/3.0.0.Alpha1/api/pom.xml
===================================================================
--- modules/faces/tags/3.0.0.Alpha1/api/pom.xml 2010-04-22 21:26:28 UTC (rev 12578)
+++ modules/faces/tags/3.0.0.Alpha1/api/pom.xml 2010-04-22 21:32:05 UTC (rev 12579)
@@ -4,11 +4,11 @@
<parent>
<artifactId>seam-faces-parent</artifactId>
<groupId>org.jboss.seam.faces</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.Alpha2</version>
</parent>
<artifactId>seam-faces-api</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.Alpha2</version>
<packaging>jar</packaging>
<name>Seam Faces Module API</name>
Modified: modules/faces/tags/3.0.0.Alpha1/impl/pom.xml
===================================================================
--- modules/faces/tags/3.0.0.Alpha1/impl/pom.xml 2010-04-22 21:26:28 UTC (rev 12578)
+++ modules/faces/tags/3.0.0.Alpha1/impl/pom.xml 2010-04-22 21:32:05 UTC (rev 12579)
@@ -4,11 +4,11 @@
<parent>
<artifactId>seam-faces-parent</artifactId>
<groupId>org.jboss.seam.faces</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.Alpha2</version>
</parent>
<artifactId>seam-faces</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.Alpha2</version>
<packaging>jar</packaging>
<name>Seam Faces Module Core Implementation</name>
Modified: modules/faces/tags/3.0.0.Alpha1/pom.xml
===================================================================
--- modules/faces/tags/3.0.0.Alpha1/pom.xml 2010-04-22 21:26:28 UTC (rev 12578)
+++ modules/faces/tags/3.0.0.Alpha1/pom.xml 2010-04-22 21:32:05 UTC (rev 12579)
@@ -9,7 +9,7 @@
<artifactId>seam-faces-parent</artifactId>
<groupId>org.jboss.seam.faces</groupId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.Alpha2</version>
<packaging>pom</packaging>
<name>Seam Faces Module Parent POM</name>
@@ -178,11 +178,11 @@
</developers>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/seam/modules/faces/trunk
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/seam/modules/faces/tags/3.0.0.Alpha2
</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/seam/modules/faces/trunk
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/seam/modules/faces/tags/3.0.0.Alpha2
</developerConnection>
- <url>http://fisheye.jboss.org/browse/Seam/modules/faces/trunk</url>
+ <url>http://fisheye.jboss.org/browse/Seam/modules/faces/tags/3.0.0.Alpha2</url>
</scm>
<build>
14 years, 9 months
Seam SVN: r12578 - in modules/faces/tags/3.0.0.Alpha1: api and 1 other directories.
by seam-commits@lists.jboss.org
Author: lincolnthree
Date: 2010-04-22 17:26:28 -0400 (Thu, 22 Apr 2010)
New Revision: 12578
Modified:
modules/faces/tags/3.0.0.Alpha1/api/pom.xml
modules/faces/tags/3.0.0.Alpha1/impl/pom.xml
modules/faces/tags/3.0.0.Alpha1/pom.xml
Log:
[maven-release-plugin] rollback the release of 3.0.0.Alpha2
Modified: modules/faces/tags/3.0.0.Alpha1/api/pom.xml
===================================================================
--- modules/faces/tags/3.0.0.Alpha1/api/pom.xml 2010-04-22 20:19:43 UTC (rev 12577)
+++ modules/faces/tags/3.0.0.Alpha1/api/pom.xml 2010-04-22 21:26:28 UTC (rev 12578)
@@ -4,11 +4,11 @@
<parent>
<artifactId>seam-faces-parent</artifactId>
<groupId>org.jboss.seam.faces</groupId>
- <version>3.0.0.Alpha1</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<artifactId>seam-faces-api</artifactId>
- <version>3.0.0.Alpha1</version>
+ <version>3.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Seam Faces Module API</name>
Modified: modules/faces/tags/3.0.0.Alpha1/impl/pom.xml
===================================================================
--- modules/faces/tags/3.0.0.Alpha1/impl/pom.xml 2010-04-22 20:19:43 UTC (rev 12577)
+++ modules/faces/tags/3.0.0.Alpha1/impl/pom.xml 2010-04-22 21:26:28 UTC (rev 12578)
@@ -4,11 +4,11 @@
<parent>
<artifactId>seam-faces-parent</artifactId>
<groupId>org.jboss.seam.faces</groupId>
- <version>3.0.0.Alpha1</version>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<artifactId>seam-faces</artifactId>
- <version>3.0.0.Alpha1</version>
+ <version>3.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Seam Faces Module Core Implementation</name>
Modified: modules/faces/tags/3.0.0.Alpha1/pom.xml
===================================================================
--- modules/faces/tags/3.0.0.Alpha1/pom.xml 2010-04-22 20:19:43 UTC (rev 12577)
+++ modules/faces/tags/3.0.0.Alpha1/pom.xml 2010-04-22 21:26:28 UTC (rev 12578)
@@ -9,7 +9,7 @@
<artifactId>seam-faces-parent</artifactId>
<groupId>org.jboss.seam.faces</groupId>
- <version>3.0.0.Alpha1</version>
+ <version>3.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Seam Faces Module Parent POM</name>
@@ -178,11 +178,11 @@
</developers>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/seam/modules/faces/tags/3.0.0.Alpha1
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/seam/modules/faces/trunk
</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/seam/modules/faces/tags/3.0.0.Alpha1
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/seam/modules/faces/trunk
</developerConnection>
- <url>http://fisheye.jboss.org/browse/Seam/modules/faces/tags/3.0.0.Alpha1</url>
+ <url>http://fisheye.jboss.org/browse/Seam/modules/faces/trunk</url>
</scm>
<build>
14 years, 9 months
Seam SVN: r12577 - branches/enterprise/JBPAPP_4_3_FP01/build.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-04-22 16:19:43 -0400 (Thu, 22 Apr 2010)
New Revision: 12577
Modified:
branches/enterprise/JBPAPP_4_3_FP01/build/root.pom.xml
Log:
reverting rev #12576 - commit on wrong project
Modified: branches/enterprise/JBPAPP_4_3_FP01/build/root.pom.xml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/build/root.pom.xml 2010-04-22 19:22:48 UTC (rev 12576)
+++ branches/enterprise/JBPAPP_4_3_FP01/build/root.pom.xml 2010-04-22 20:19:43 UTC (rev 12577)
@@ -19,11 +19,6 @@
<name>JBoss Repository</name>
<url>http://repository.jboss.org/maven2-brew</url>
</pluginRepository>
- <pluginRepository>
- <id>jboss.proxy</id>
- <name>JBoss Nexus Repository</name>
- <url>https://repository.jboss.org/nexus/content/groups/public/</url>
- </pluginRepository>
<!--
<pluginRepository> <snapshots /> <id>snapshots.jboss.org</id>
<name>JBoss Snapshot Repository</name>
14 years, 9 months
Seam SVN: r12576 - branches/enterprise/JBPAPP_4_3_FP01/build.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-04-22 15:22:48 -0400 (Thu, 22 Apr 2010)
New Revision: 12576
Modified:
branches/enterprise/JBPAPP_4_3_FP01/build/root.pom.xml
Log:
JBPAPP-3531 - upgraded richfaces to 3.3.1.SP1
Modified: branches/enterprise/JBPAPP_4_3_FP01/build/root.pom.xml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/build/root.pom.xml 2010-04-22 19:16:47 UTC (rev 12575)
+++ branches/enterprise/JBPAPP_4_3_FP01/build/root.pom.xml 2010-04-22 19:22:48 UTC (rev 12576)
@@ -19,6 +19,11 @@
<name>JBoss Repository</name>
<url>http://repository.jboss.org/maven2-brew</url>
</pluginRepository>
+ <pluginRepository>
+ <id>jboss.proxy</id>
+ <name>JBoss Nexus Repository</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ </pluginRepository>
<!--
<pluginRepository> <snapshots /> <id>snapshots.jboss.org</id>
<name>JBoss Snapshot Repository</name>
14 years, 9 months
Seam SVN: r12575 - in modules/faces/trunk/impl/src: main/java/org/jboss/seam/faces/beanManager and 3 other directories.
by seam-commits@lists.jboss.org
Author: nickarls
Date: 2010-04-22 15:16:47 -0400 (Thu, 22 Apr 2010)
New Revision: 12575
Added:
modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/beanManager/
modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/beanManager/FacesServletContextBeanManagerProvider.java
modules/faces/trunk/impl/src/main/resources/META-INF/services/org.jboss.weld.extensions.beanManager.BeanManagerProvider
Removed:
modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/cdi/
Modified:
modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/DelegatingPhaseListener.java
modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/DelegatingSystemEventListener.java
modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/PhaseEventBridge.java
modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/SystemEventBridge.java
modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/event/PhaseEventBridgeTest.java
modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/event/SystemEventBridgeTest.java
Log:
BeanManagerAware infra II
Added: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/beanManager/FacesServletContextBeanManagerProvider.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/beanManager/FacesServletContextBeanManagerProvider.java (rev 0)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/beanManager/FacesServletContextBeanManagerProvider.java 2010-04-22 19:16:47 UTC (rev 12575)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.faces.beanManager;
+
+import javax.enterprise.inject.spi.BeanManager;
+import javax.faces.context.FacesContext;
+import javax.servlet.ServletContext;
+
+import org.jboss.weld.extensions.beanManager.BeanManagerProvider;
+
+/**
+ * A BeanManager provider for the FacesContext-acquired Servlet Context attribute
+ * "javax.enterprise.inject.spi.BeanManager"
+ *
+ * @author Nicklas Karlsson
+ *
+ */
+public class FacesServletContextBeanManagerProvider implements BeanManagerProvider
+{
+ public static final FacesServletContextBeanManagerProvider DEFAULT = new FacesServletContextBeanManagerProvider();
+
+ public BeanManager getBeanManager()
+ {
+ ServletContext servletContext = (ServletContext) FacesContext.getCurrentInstance().getExternalContext().getContext();
+ return (BeanManager) servletContext.getAttribute(BeanManager.class.getName());
+ }
+
+ public int getPrecedence()
+ {
+ return 0;
+ }
+
+}
Modified: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/DelegatingPhaseListener.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/DelegatingPhaseListener.java 2010-04-22 19:15:01 UTC (rev 12574)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/DelegatingPhaseListener.java 2010-04-22 19:16:47 UTC (rev 12575)
@@ -31,7 +31,7 @@
import javax.faces.event.PhaseId;
import javax.faces.event.PhaseListener;
-import org.jboss.seam.faces.cdi.BeanManagerAware;
+import org.jboss.weld.extensions.beanManager.BeanManagerAware;
/**
* Provide CDI injection to PhaseListener artifacts by delegating through this
Modified: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/DelegatingSystemEventListener.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/DelegatingSystemEventListener.java 2010-04-22 19:15:01 UTC (rev 12574)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/DelegatingSystemEventListener.java 2010-04-22 19:16:47 UTC (rev 12575)
@@ -31,7 +31,7 @@
import javax.faces.event.SystemEvent;
import javax.faces.event.SystemEventListener;
-import org.jboss.seam.faces.cdi.BeanManagerAware;
+import org.jboss.weld.extensions.beanManager.BeanManagerAware;
/**
* Provide CDI injection to SystemEventListener artifacts by delegating through
Modified: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/PhaseEventBridge.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/PhaseEventBridge.java 2010-04-22 19:15:01 UTC (rev 12574)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/PhaseEventBridge.java 2010-04-22 19:16:47 UTC (rev 12575)
@@ -31,7 +31,6 @@
import javax.faces.event.PhaseListener;
import javax.inject.Inject;
-import org.jboss.seam.faces.cdi.BeanManagerAware;
import org.jboss.seam.faces.event.qualifier.After;
import org.jboss.seam.faces.event.qualifier.ApplyRequestValues;
import org.jboss.seam.faces.event.qualifier.Before;
@@ -40,6 +39,7 @@
import org.jboss.seam.faces.event.qualifier.RenderResponse;
import org.jboss.seam.faces.event.qualifier.RestoreView;
import org.jboss.seam.faces.event.qualifier.UpdateModelValues;
+import org.jboss.weld.extensions.beanManager.BeanManagerAware;
import org.slf4j.Logger;
/**
Modified: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/SystemEventBridge.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/SystemEventBridge.java 2010-04-22 19:15:01 UTC (rev 12574)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/SystemEventBridge.java 2010-04-22 19:16:47 UTC (rev 12575)
@@ -36,9 +36,9 @@
import javax.faces.event.SystemEvent;
import javax.faces.event.SystemEventListener;
-import org.jboss.seam.faces.cdi.BeanManagerAware;
import org.jboss.seam.faces.event.qualifier.Component;
import org.jboss.seam.faces.event.qualifier.View;
+import org.jboss.weld.extensions.beanManager.BeanManagerAware;
/**
* A SystemEventListener used to bridge JSF system events to the CDI event
Added: modules/faces/trunk/impl/src/main/resources/META-INF/services/org.jboss.weld.extensions.beanManager.BeanManagerProvider
===================================================================
--- modules/faces/trunk/impl/src/main/resources/META-INF/services/org.jboss.weld.extensions.beanManager.BeanManagerProvider (rev 0)
+++ modules/faces/trunk/impl/src/main/resources/META-INF/services/org.jboss.weld.extensions.beanManager.BeanManagerProvider 2010-04-22 19:16:47 UTC (rev 12575)
@@ -0,0 +1 @@
+org.jboss.seam.faces.beanManager.FacesServletContextBeanManagerProvider
Modified: modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/event/PhaseEventBridgeTest.java
===================================================================
--- modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/event/PhaseEventBridgeTest.java 2010-04-22 19:15:01 UTC (rev 12574)
+++ modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/event/PhaseEventBridgeTest.java 2010-04-22 19:16:47 UTC (rev 12575)
@@ -31,13 +31,13 @@
import org.jboss.arquillian.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.seam.faces.MockLogger;
-import org.jboss.seam.faces.cdi.BeanManagerAware;
import org.jboss.shrinkwrap.api.ArchivePaths;
import org.jboss.shrinkwrap.api.Archives;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
import org.jboss.test.faces.mock.context.MockFacesContext;
import org.jboss.test.faces.mock.lifecycle.MockLifecycle;
+import org.jboss.weld.extensions.beanManager.BeanManagerAware;
import org.junit.Test;
import org.junit.runner.RunWith;
Modified: modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/event/SystemEventBridgeTest.java
===================================================================
--- modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/event/SystemEventBridgeTest.java 2010-04-22 19:15:01 UTC (rev 12574)
+++ modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/event/SystemEventBridgeTest.java 2010-04-22 19:16:47 UTC (rev 12575)
@@ -47,13 +47,13 @@
import org.jboss.arquillian.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.seam.faces.cdi.BeanManagerAware;
import org.jboss.shrinkwrap.api.ArchivePaths;
import org.jboss.shrinkwrap.api.Archives;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
import org.jboss.test.faces.mock.application.MockApplication;
import org.jboss.test.faces.mock.context.MockFacesContext;
+import org.jboss.weld.extensions.beanManager.BeanManagerAware;
import org.junit.Test;
import org.junit.runner.RunWith;
14 years, 9 months
Seam SVN: r12574 - in modules/servlet/trunk: impl/src/main/java/org/jboss/seam/servlet and 4 other directories.
by seam-commits@lists.jboss.org
Author: nickarls
Date: 2010-04-22 15:15:01 -0400 (Thu, 22 Apr 2010)
New Revision: 12574
Added:
modules/servlet/trunk/api/src/main/java/org/jboss/seam/servlet/http/DefaultValue.java
modules/servlet/trunk/api/src/main/java/org/jboss/seam/servlet/http/HttpParam.java
modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/beanManager/
modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/beanManager/ServletContextBeanManagerProvider.java
modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/http/HttpParamProducer.java
modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/http/HttpServletEnvironmentProducer.java
modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/http/HttpSessionStatus.java
modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/http/ServletContextHelper.java
modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/http/ServletContextProducer.java
modules/servlet/trunk/impl/src/main/resources/META-INF/services/
modules/servlet/trunk/impl/src/main/resources/META-INF/services/org.jboss.weld.extensions.beanManager.BeanManagerProvider
Removed:
modules/servlet/trunk/api/src/main/java/org/jboss/seam/servlet/http/RequestParameter.java
modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/http/HttpArtifacts.java
modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/http/HttpUserArtifacts.java
Log:
BeanManagerAware infrastructure
Added: modules/servlet/trunk/api/src/main/java/org/jboss/seam/servlet/http/DefaultValue.java
===================================================================
--- modules/servlet/trunk/api/src/main/java/org/jboss/seam/servlet/http/DefaultValue.java (rev 0)
+++ modules/servlet/trunk/api/src/main/java/org/jboss/seam/servlet/http/DefaultValue.java 2010-04-22 19:15:01 UTC (rev 12574)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.servlet.http;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.util.Nonbinding;
+import javax.inject.Qualifier;
+
+/**
+ * Sets the default value for a {@link HttpParam}
+ *
+ * @author Nicklas Karlsson
+ *
+ */
+@Qualifier
+@Retention(RUNTIME)
+@Target( { FIELD, PARAMETER, METHOD })
+public @interface DefaultValue
+{
+ @Nonbinding
+ public String value();
+}
\ No newline at end of file
Copied: modules/servlet/trunk/api/src/main/java/org/jboss/seam/servlet/http/HttpParam.java (from rev 12541, modules/servlet/trunk/api/src/main/java/org/jboss/seam/servlet/http/RequestParameter.java)
===================================================================
--- modules/servlet/trunk/api/src/main/java/org/jboss/seam/servlet/http/HttpParam.java (rev 0)
+++ modules/servlet/trunk/api/src/main/java/org/jboss/seam/servlet/http/HttpParam.java 2010-04-22 19:15:01 UTC (rev 12574)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.servlet.http;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.util.Nonbinding;
+import javax.inject.Qualifier;
+
+/**
+ * Qualifies injection points that should have their values fetched from a HTTP request attribute
+ *
+ * @author Nicklas Karlsson
+ *
+ */
+@Qualifier
+@Retention(RUNTIME)
+@Target( { FIELD, PARAMETER, METHOD })
+public @interface HttpParam
+{
+ @Nonbinding
+ public String value();
+}
\ No newline at end of file
Deleted: modules/servlet/trunk/api/src/main/java/org/jboss/seam/servlet/http/RequestParameter.java
===================================================================
--- modules/servlet/trunk/api/src/main/java/org/jboss/seam/servlet/http/RequestParameter.java 2010-04-22 18:12:04 UTC (rev 12573)
+++ modules/servlet/trunk/api/src/main/java/org/jboss/seam/servlet/http/RequestParameter.java 2010-04-22 19:15:01 UTC (rev 12574)
@@ -1,48 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.seam.servlet.http;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import javax.enterprise.util.Nonbinding;
-import javax.inject.Qualifier;
-
-/**
- * Qualifies injection points that should have their values fetched from a HTTP request attribute
- *
- * @author Nicklas Karlsson
- *
- */
-@Qualifier
-@Retention(RUNTIME)
-@Target( { FIELD, PARAMETER, METHOD })
-public @interface RequestParameter
-{
- @Nonbinding
- public String value();
-}
\ No newline at end of file
Added: modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/beanManager/ServletContextBeanManagerProvider.java
===================================================================
--- modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/beanManager/ServletContextBeanManagerProvider.java (rev 0)
+++ modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/beanManager/ServletContextBeanManagerProvider.java 2010-04-22 19:15:01 UTC (rev 12574)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.servlet.beanManager;
+
+import javax.enterprise.inject.spi.BeanManager;
+
+import org.jboss.seam.servlet.http.ServletContextHelper;
+import org.jboss.weld.extensions.beanManager.BeanManagerProvider;
+
+/**
+ * A BeanManager provider for the Servlet Context attribute
+ * "javax.enterprise.inject.spi.BeanManager"
+ *
+ * @author Nicklas Karlsson
+ *
+ */
+public class ServletContextBeanManagerProvider implements BeanManagerProvider
+{
+ public BeanManager getBeanManager()
+ {
+ return (BeanManager) ServletContextHelper.getCurrentInstance().getAttribute(BeanManager.class.getName());
+ }
+
+ public int getPrecedence()
+ {
+ return 0;
+ }
+
+}
Deleted: modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/http/HttpArtifacts.java
===================================================================
--- modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/http/HttpArtifacts.java 2010-04-22 18:12:04 UTC (rev 12573)
+++ modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/http/HttpArtifacts.java 2010-04-22 19:15:01 UTC (rev 12574)
@@ -1,74 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.seam.servlet.http;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.enterprise.event.Observes;
-import javax.enterprise.inject.Produces;
-import javax.enterprise.inject.spi.BeanManager;
-import javax.inject.Inject;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletContextEvent;
-
-import org.jboss.seam.servlet.event.qualifier.Destroyed;
-import org.jboss.seam.servlet.event.qualifier.Initialized;
-import org.slf4j.Logger;
-
-/**
- *
- * @author Nicklas Karlsson
- *
- * A source for HTTP artifacts. It observes for and stores the
- * ServletContext and provides the HttpSession and ServletRequest
- * objects
- */
-@ApplicationScoped
-public class HttpArtifacts
-{
- private ServletContext servletContext;
-
- @Inject
- BeanManager beanManager;
-
- @Inject Logger log;
-
- protected void contextInitialized(@Observes @Initialized ServletContextEvent e)
- {
- log.debug("Servlet context initialized with event #0", e);
- servletContext = e.getServletContext();
- servletContext.setAttribute(BeanManager.class.getName(), beanManager);
- }
-
- protected void contextDestroyed(@Observes @Destroyed ServletContextEvent e)
- {
- log.debug("Servlet context destroyed with event #0", e);
- servletContext = null;
- }
-
- @Produces
- @ApplicationScoped
- public ServletContext getServletContext()
- {
- return servletContext;
- }
-
-}
\ No newline at end of file
Added: modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/http/HttpParamProducer.java
===================================================================
--- modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/http/HttpParamProducer.java (rev 0)
+++ modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/http/HttpParamProducer.java 2010-04-22 19:15:01 UTC (rev 12574)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.servlet.http;
+
+import javax.enterprise.inject.Produces;
+import javax.enterprise.inject.spi.InjectionPoint;
+import javax.inject.Inject;
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * A producer for {@link HttpParam}
+ *
+ * @author Nicklas Karlsson
+ *
+ */
+public class HttpParamProducer
+{
+ @Inject
+ private HttpServletRequest request;
+
+ @Produces
+ @HttpParam("")
+ protected String getParamValue(InjectionPoint ip)
+ {
+ String parameterName = getParameterName(ip);
+ return getParameterValue(parameterName, ip);
+ }
+
+ private String getParameterName(InjectionPoint ip)
+ {
+ String parameterName = ip.getAnnotated().getAnnotation(HttpParam.class).value();
+ if ("".equals(parameterName))
+ {
+ parameterName = ip.getMember().getName();
+ }
+ return parameterName;
+ }
+
+ private String getParameterValue(String parameterName, InjectionPoint ip)
+ {
+ return isParameterInRequest(parameterName) ? request.getParameter(parameterName) : getDefaultValue(ip);
+ }
+
+ private boolean isParameterInRequest(String parameterName)
+ {
+ return request.getParameterMap().containsKey(parameterName);
+ }
+
+ private String getDefaultValue(InjectionPoint ip)
+ {
+ DefaultValue defaultValueAnnotation = ip.getAnnotated().getAnnotation(DefaultValue.class);
+ return defaultValueAnnotation == null ? null : defaultValueAnnotation.value();
+ }
+}
Copied: modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/http/HttpServletEnvironmentProducer.java (from rev 12541, modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/http/HttpUserArtifacts.java)
===================================================================
--- modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/http/HttpServletEnvironmentProducer.java (rev 0)
+++ modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/http/HttpServletEnvironmentProducer.java 2010-04-22 19:15:01 UTC (rev 12574)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.servlet.http;
+
+import java.io.Serializable;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.Produces;
+import javax.inject.Inject;
+import javax.servlet.ServletRequestEvent;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+import javax.servlet.http.HttpSessionEvent;
+
+import org.jboss.seam.servlet.event.qualifier.Created;
+import org.jboss.seam.servlet.event.qualifier.Destroyed;
+import org.jboss.seam.servlet.event.qualifier.Initialized;
+import org.slf4j.Logger;
+
+/**
+ * A manager for acquiring HTTP artifacts
+ *
+ * @author Nicklas Karlsson
+ *
+ */
+@RequestScoped
+public class HttpServletEnvironmentProducer implements Serializable
+{
+ private static final long serialVersionUID = 1L;
+
+ private HttpSession session;
+ private HttpServletRequest request;
+
+ @Inject
+ private Logger log;
+
+ protected void requestInitialized(@Observes @Initialized ServletRequestEvent e)
+ {
+ log.trace("Servlet request initialized with event #0", e);
+ request = (HttpServletRequest) e.getServletRequest();
+ session = request.getSession();
+ }
+
+ protected void requestDestroyed(@Observes @Destroyed ServletRequestEvent e)
+ {
+ log.trace("Servlet request destroyed with event #0", e);
+ request = null;
+ }
+
+ @Produces
+ @RequestScoped
+ protected HttpSession getSession()
+ {
+ return session;
+ }
+
+ @Produces
+ @RequestScoped
+ protected HttpServletRequest getRequest()
+ {
+ return request;
+ }
+
+}
Added: modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/http/HttpSessionStatus.java
===================================================================
--- modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/http/HttpSessionStatus.java (rev 0)
+++ modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/http/HttpSessionStatus.java 2010-04-22 19:15:01 UTC (rev 12574)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.servlet.http;
+
+import javax.enterprise.context.RequestScoped;
+import javax.inject.Inject;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
+/**
+ * A helper bean that can be injected to check the status of the HttpSession and acquiring it
+ *
+ * @author Nicklas Karlsson
+ *
+ */
+@RequestScoped
+public class HttpSessionStatus
+{
+ @Inject
+ private HttpServletRequest request;
+
+ public boolean isActive()
+ {
+ HttpSession session = request.getSession(false);
+ try
+ {
+ return session != null && (session.getMaxInactiveInterval() > 0);
+ }
+ catch (IllegalStateException e)
+ {
+ return false;
+ }
+ }
+
+ public HttpSession getOrCreate()
+ {
+ return request.getSession();
+ }
+
+}
Deleted: modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/http/HttpUserArtifacts.java
===================================================================
--- modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/http/HttpUserArtifacts.java 2010-04-22 18:12:04 UTC (rev 12573)
+++ modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/http/HttpUserArtifacts.java 2010-04-22 19:15:01 UTC (rev 12574)
@@ -1,103 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.seam.servlet.http;
-
-import java.io.Serializable;
-
-import javax.enterprise.context.RequestScoped;
-import javax.enterprise.event.Observes;
-import javax.enterprise.inject.Produces;
-import javax.enterprise.inject.spi.InjectionPoint;
-import javax.inject.Inject;
-import javax.servlet.ServletRequestEvent;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-import javax.servlet.http.HttpSessionEvent;
-
-import org.jboss.seam.servlet.event.qualifier.Created;
-import org.jboss.seam.servlet.event.qualifier.Destroyed;
-import org.jboss.seam.servlet.event.qualifier.Initialized;
-import org.slf4j.Logger;
-
-/**
- * A manager for acquiring HTTP artifacts
- *
- * @author Nicklas Karlsson
- *
- */
-@RequestScoped
-public class HttpUserArtifacts implements Serializable
-{
- private static final long serialVersionUID = 1L;
-
- private HttpSession session;
- private HttpServletRequest request;
-
- @Inject
- private Logger log;
-
- protected void requestInitialized(@Observes @Initialized ServletRequestEvent e)
- {
- log.trace("Servlet request initialized with event #0", e);
- request = (HttpServletRequest) e.getServletRequest();
- }
-
- protected void requestDestroyed(@Observes @Destroyed ServletRequestEvent e)
- {
- log.trace("Servlet request destroyed with event #0", e);
- request = null;
- }
-
- protected void sessionInitialized(@Observes @Created HttpSessionEvent e)
- {
- log.trace("HTTP session initalized with event #0", e);
- session = e.getSession();
- }
-
- protected void sessionDestroyed(@Observes @Destroyed HttpSessionEvent e)
- {
- log.trace("HTTP session destroyed with event #0", e);
- session = null;
- }
-
- @Produces
- @RequestScoped
- protected HttpSession getSession()
- {
- return session;
- }
-
- @Produces
- @RequestScoped
- protected HttpServletRequest getRequest()
- {
- return request;
- }
-
- @Produces
- @RequestParameter("")
- protected String getParamValue(InjectionPoint ip)
- {
- return getRequest().getParameter(ip.getAnnotated().getAnnotation(RequestParameter.class).value());
- }
-
-}
Added: modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/http/ServletContextHelper.java
===================================================================
--- modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/http/ServletContextHelper.java (rev 0)
+++ modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/http/ServletContextHelper.java 2010-04-22 19:15:01 UTC (rev 12574)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.servlet.http;
+
+import javax.servlet.ServletContext;
+
+/**
+ * A ThreadLocal storage for the ServletContext. The current instance is set in
+ * ServletContextProducer and used in the ServletContextBeanManagerProvider.
+ *
+ * @author Nicklas Karlsson
+ *
+ */
+public class ServletContextHelper
+{
+ private static ThreadLocal<ServletContext> servletContext = new ThreadLocal<ServletContext>()
+ {
+ protected ServletContext initialValue()
+ {
+ return null;
+ }
+ };
+
+ /**
+ * Returns the current instance of the ServletContext, if any
+ *
+ * @return The servet context or null if none is currently set
+ */
+ public static ServletContext getCurrentInstance()
+ {
+ return (servletContext.get());
+ }
+
+
+ /**
+ * Sets the current instance of the ServletContext
+ *
+ * @param sc The Servlet Context
+ */
+ public static void setCurrentInstance(ServletContext sc)
+ {
+ servletContext.set(sc);
+ }
+}
Copied: modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/http/ServletContextProducer.java (from rev 12541, modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/http/HttpArtifacts.java)
===================================================================
--- modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/http/ServletContextProducer.java (rev 0)
+++ modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/http/ServletContextProducer.java 2010-04-22 19:15:01 UTC (rev 12574)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.servlet.http;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.Produces;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.inject.Inject;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletContextEvent;
+
+import org.jboss.seam.servlet.event.qualifier.Destroyed;
+import org.jboss.seam.servlet.event.qualifier.Initialized;
+import org.slf4j.Logger;
+
+/**
+ *
+ * @author Nicklas Karlsson
+ *
+ * A source for HTTP artifacts. It observes for and stores the
+ * ServletContext and provides the HttpSession and ServletRequest
+ * objects
+ */
+@ApplicationScoped
+public class ServletContextProducer
+{
+ private ServletContext servletContext;
+
+ @Inject
+ private BeanManager beanManager;
+
+ @Inject
+ private Logger log;
+
+ protected void contextInitialized(@Observes @Initialized ServletContextEvent e)
+ {
+ log.debug("Servlet context initialized with event #0", e);
+ servletContext = e.getServletContext();
+ servletContext.setAttribute(BeanManager.class.getName(), beanManager);
+ ServletContextHelper.setCurrentInstance(servletContext);
+ }
+
+ protected void contextDestroyed(@Observes @Destroyed ServletContextEvent e)
+ {
+ log.debug("Servlet context destroyed with event #0", e);
+ servletContext = null;
+ }
+
+ @Produces
+ @ApplicationScoped
+ public ServletContext getServletContext()
+ {
+ return servletContext;
+ }
+
+}
\ No newline at end of file
Added: modules/servlet/trunk/impl/src/main/resources/META-INF/services/org.jboss.weld.extensions.beanManager.BeanManagerProvider
===================================================================
--- modules/servlet/trunk/impl/src/main/resources/META-INF/services/org.jboss.weld.extensions.beanManager.BeanManagerProvider (rev 0)
+++ modules/servlet/trunk/impl/src/main/resources/META-INF/services/org.jboss.weld.extensions.beanManager.BeanManagerProvider 2010-04-22 19:15:01 UTC (rev 12574)
@@ -0,0 +1 @@
+org.jboss.seam.servlet.beanManager.ServletContextBeanManagerProvider
14 years, 9 months
Seam SVN: r12573 - branches/enterprise/JBPAPP_5_0/build.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-04-22 14:12:04 -0400 (Thu, 22 Apr 2010)
New Revision: 12573
Modified:
branches/enterprise/JBPAPP_5_0/build/root.pom.xml
Log:
JBPAPP-3531 - upgraded richfaces to 3.3.1.SP1
Modified: branches/enterprise/JBPAPP_5_0/build/root.pom.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/build/root.pom.xml 2010-04-22 17:43:54 UTC (rev 12572)
+++ branches/enterprise/JBPAPP_5_0/build/root.pom.xml 2010-04-22 18:12:04 UTC (rev 12573)
@@ -21,6 +21,11 @@
<name>JBoss Snapshot Repository</name>
<url>http://snapshots.jboss.org/maven2</url>
</pluginRepository>
+ <pluginRepository>
+ <id>maven_eap5</id>
+ <name>EAP5 Central Repository</name>
+ <url>http://repository.jboss.org/maven2-brew</url>
+ </pluginRepository>
</pluginRepositories>
<repositories>
<repository>
14 years, 9 months
Seam SVN: r12572 - modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/util.
by seam-commits@lists.jboss.org
Author: lincolnthree
Date: 2010-04-22 13:43:54 -0400 (Thu, 22 Apr 2010)
New Revision: 12572
Added:
modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/util/BeanManagerUtils.java
Log:
* A utility for bean manager operations, must be @Injected
Added: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/util/BeanManagerUtils.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/util/BeanManagerUtils.java (rev 0)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/util/BeanManagerUtils.java 2010-04-22 17:43:54 UTC (rev 12572)
@@ -0,0 +1,90 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.seam.faces.util;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.InjectionTarget;
+import javax.inject.Inject;
+
+/**
+ * A utility providing common functions to simply use of {@link BeanManager}
+ *
+ * @author <a href="mailto:lincolnbaxter@gmail.com>Lincoln Baxter, III</a>
+ *
+ */
+public class BeanManagerUtils
+{
+ @Inject
+ private BeanManager manager;
+
+ /**
+ * Perform @{@link Inject} on an object as if it were a bean managed by CDI.
+ *
+ * @param instance
+ */
+ @SuppressWarnings("unchecked")
+ public void injectNonContextualInstance(final Object instance)
+ {
+ CreationalContext<Object> creationalContext = manager.createCreationalContext(null);
+ InjectionTarget<Object> injectionTarget = (InjectionTarget<Object>) manager.createInjectionTarget(manager.createAnnotatedType(instance.getClass()));
+ injectionTarget.inject(instance, creationalContext);
+ }
+
+ /**
+ * Get a single CDI managed instance of a specific class. Return only the
+ * first result if multiple beans are available.
+ *
+ * @param type The class for which to return an instance.
+ */
+ @SuppressWarnings("unchecked")
+ public <T> T getContextualInstance(final Class<T> type)
+ {
+ Bean<T> bean = (Bean<T>) manager.resolve(manager.getBeans(type));
+ CreationalContext<T> context = manager.createCreationalContext(bean);
+ T result = (T) manager.getReference(bean, type, context);
+ return result;
+ }
+
+ /**
+ * Get all CDI managed instances of a specific class. Return results in a
+ * {@link List} in no specific order.
+ *
+ * @param type The class for which to return instances.
+ */
+ @SuppressWarnings("unchecked")
+ public <T> List<T> getContextualInstances(final Class<T> type)
+ {
+ List<T> result = new ArrayList<T>();
+ for (Bean<?> bean : manager.getBeans(type))
+ {
+ CreationalContext<T> context = (CreationalContext<T>) manager.createCreationalContext(bean);
+ result.add((T) manager.getReference(bean, type, context));
+ }
+ return result;
+ }
+}
14 years, 9 months
Seam SVN: r12571 - modules/wicket/trunk.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-04-22 13:28:45 -0400 (Thu, 22 Apr 2010)
New Revision: 12571
Modified:
modules/wicket/trunk/
Log:
ignores
Property changes on: modules/wicket/trunk
___________________________________________________________________
Name: svn:ignore
+
.settings
.project
target
14 years, 9 months