Weld SVN: r6020 - in extensions/trunk: core and 11 other directories.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-03-09 13:46:45 -0500 (Tue, 09 Mar 2010)
New Revision: 6020
Added:
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/genericbeans/
extensions/trunk/core/src/main/resources/META-INF/services/
extensions/trunk/core/src/test/java/org/jboss/weld/extensions/
extensions/trunk/core/src/test/java/org/jboss/weld/extensions/genericbeans/
extensions/trunk/core/src/test/java/org/jboss/weld/extensions/genericbeans/test/
extensions/trunk/core/src/test/resources/META-INF/beans.xml
Removed:
extensions/trunk/genericbeans/src/main/java/org/jboss/weld/extensions/genericbeans/
extensions/trunk/genericbeans/src/main/resources/META-INF/services/
extensions/trunk/genericbeans/src/test/java/org/jboss/weld/extensions/genericbeans/test/
extensions/trunk/genericbeans/src/test/resources/META-INF/beans.xml
Modified:
extensions/trunk/bom/pom.xml
extensions/trunk/core/pom.xml
extensions/trunk/parent/pom.xml
Log:
start to merge down the projects to flat
Modified: extensions/trunk/bom/pom.xml
===================================================================
--- extensions/trunk/bom/pom.xml 2010-03-09 17:19:49 UTC (rev 6019)
+++ extensions/trunk/bom/pom.xml 2010-03-09 18:46:45 UTC (rev 6020)
@@ -1,10 +1,11 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-extensions-bom</artifactId>
<packaging>pom</packaging>
<version>1.0.1-SNAPSHOT</version>
-
+
<parent>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-parent</artifactId>
@@ -14,9 +15,13 @@
<name>Weld Extensions BOM</name>
<url>http://www.seamframework.org/Weld</url>
- <!-- Minimal project metadata, for more see parent/pom.xml -->
- <description>Weld Extensions "bill of materials" which can be imported by any project using the Weld Extensions. It provides dependency management for the extensions.</description>
+ <description>Portable extensions for CDI</description>
+ <issueManagement>
+ <system>JIRA</system>
+ <url>https://jira.jboss.org/jira/browse/WELDX/component/12312756</url>
+ </issueManagement>
+
<licenses>
<license>
<name>Apache License, Version 2.0</name>
@@ -25,58 +30,58 @@
</license>
</licenses>
+
<developers>
+
<developer>
- <name>Weld committers</name>
+ <name>Pete Muir</name>
+ <email>pete.muir(a)jboss.org</email>
+ <organization>Red Hat Inc.</organization>
+ <url>http://in.relation.to/Bloggers/Pete</url>
</developer>
+
+ <developer>
+ <name>Stuart Douglas</name>
+ </developer>
+
</developers>
- <properties>
- <weld.api.version>1.0</weld.api.version>
+ <inceptionYear>2008</inceptionYear>
+
+ <organization>
+ <name>Seam Framework</name>
+ <url>http://seamframework.org</url>
+ </organization>
+
+ <ciManagement>
+ <system>Hudson</system>
+ <url />
+ </ciManagement>
+
+ <properties>
+ <weld.api.version>1.0-SP1</weld.api.version>
<weld.core.version>1.0.1-Final</weld.core.version>
<slf4j.version>1.5.10</slf4j.version>
- <jta.version>1.1</jta.version>
+ <testng.version>5.10</testng.version>
+ <jboss.test.harness.version>1.1.0-CR3</jboss.test.harness.version>
</properties>
-
+
<!-- Dependency management, including extra repositories if needed -->
<repositories>
<repository>
- <id>repository.jboss.org</id>
- <name>JBoss Release Repository</name>
- <url>http://repository.jboss.org/maven2</url>
+ <id>oss.sonatype.org/jboss-snapshots</id>
+ <name>JBoss (Nexus) Snapshots Repository</name>
+ <url>http://oss.sonatype.org/content/repositories/jboss-snapshots</url>
<releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
<enabled>false</enabled>
- </snapshots>
- </repository>
- <repository>
- <id>snapshots.jboss.org</id>
- <name>JBoss Snapshots Repository</name>
- <url>http://snapshots.jboss.org/maven2</url>
- <releases>
- <enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
- <repository>
- <id>oss.sonatype.org/jboss-snapshots</id>
- <name>JBoss (Nexus) Snapshots Repository</name>
- <url>http://oss.sonatype.org/content/repositories/jboss-snapshots</url>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- </repository>
</repositories>
-
+
<!-- Import the BOMs -->
<dependencyManagement>
<dependencies>
@@ -105,16 +110,92 @@
<artifactId>weld-extensions</artifactId>
<version>${project.version}</version>
</dependency>
- <!-- Override bad dep in api -->
<dependency>
- <groupId>javax.transaction</groupId>
- <artifactId>jta</artifactId>
- <version>${jta.version}</version>
+ <groupId>org.jboss.test-harness</groupId>
+ <artifactId>jboss-test-harness</artifactId>
+ <version>${jboss.test.harness.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.jboss.test-harness</groupId>
+ <artifactId>jboss-test-harness-jboss-as-50</artifactId>
+ <version>${jboss.test.harness.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.test-harness</groupId>
+ <artifactId>jboss-test-harness-jboss-as-52</artifactId>
+ <version>${jboss.test.harness.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.test-harness</groupId>
+ <artifactId>jboss-test-harness-jboss-embedded</artifactId>
+ <version>${jboss.test.harness.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.test-harness</groupId>
+ <artifactId>jboss-test-harness-tomcat</artifactId>
+ <version>${jboss.test.harness.version}</version>
+ </dependency>
</dependencies>
</dependencyManagement>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <scope>test</scope>
+ <classifier>jdk15</classifier>
+ <exclusions>
+ <exclusion>
+ <artifactId>junit</artifactId>
+ <groupId>junit</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.test-harness</groupId>
+ <artifactId>jboss-test-harness</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-core-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-se</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-api</artifactId>
+ <scope>test</scope>
+ </dependency>
+
<scm>
<connection>scm:svn:http://anonsvn.jboss.org/repos/weld/extensions/trunk/bom</connection>
<developerConnection>scm:svn:https://svn.jboss.org/repos/weld/extensions/trunk/bom</developerConnection>
Modified: extensions/trunk/core/pom.xml
===================================================================
--- extensions/trunk/core/pom.xml 2010-03-09 17:19:49 UTC (rev 6019)
+++ extensions/trunk/core/pom.xml 2010-03-09 18:46:45 UTC (rev 6020)
@@ -20,61 +20,12 @@
</contributor>
</contributors>
- <issueManagement>
- <system>JIRA</system>
- <url>https://jira.jboss.org/jira/browse/WELDX/component/12312756</url>
- </issueManagement>
+
<dependencies>
- <dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- <scope>test</scope>
- <classifier>jdk15</classifier>
- <exclusions>
- <exclusion>
- <artifactId>junit</artifactId>
- <groupId>junit</groupId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>javax.enterprise</groupId>
- <artifactId>cdi-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.test-harness</groupId>
- <artifactId>jboss-test-harness</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.weld</groupId>
- <artifactId>weld-core</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.weld</groupId>
- <artifactId>weld-core-test</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.ejb3</groupId>
- <artifactId>jboss-ejb3-api</artifactId>
- <scope>test</scope>
- </dependency>
-
</dependencies>
<scm>
Copied: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/genericbeans (from rev 6019, extensions/trunk/genericbeans/src/main/java/org/jboss/weld/extensions/genericbeans)
Copied: extensions/trunk/core/src/main/resources/META-INF/services (from rev 6019, extensions/trunk/genericbeans/src/main/resources/META-INF/services)
Copied: extensions/trunk/core/src/test/java/org/jboss/weld/extensions/genericbeans/test (from rev 6019, extensions/trunk/genericbeans/src/test/java/org/jboss/weld/extensions/genericbeans/test)
Copied: extensions/trunk/core/src/test/resources/META-INF/beans.xml (from rev 6019, extensions/trunk/genericbeans/src/test/resources/META-INF/beans.xml)
===================================================================
--- extensions/trunk/core/src/test/resources/META-INF/beans.xml (rev 0)
+++ extensions/trunk/core/src/test/resources/META-INF/beans.xml 2010-03-09 18:46:45 UTC (rev 6020)
@@ -0,0 +1,5 @@
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+
+</beans>
Deleted: extensions/trunk/genericbeans/src/test/resources/META-INF/beans.xml
===================================================================
--- extensions/trunk/genericbeans/src/test/resources/META-INF/beans.xml 2010-03-09 17:19:49 UTC (rev 6019)
+++ extensions/trunk/genericbeans/src/test/resources/META-INF/beans.xml 2010-03-09 18:46:45 UTC (rev 6020)
@@ -1,5 +0,0 @@
-<beans xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
-
-</beans>
Modified: extensions/trunk/parent/pom.xml
===================================================================
--- extensions/trunk/parent/pom.xml 2010-03-09 17:19:49 UTC (rev 6019)
+++ extensions/trunk/parent/pom.xml 2010-03-09 18:46:45 UTC (rev 6020)
@@ -55,46 +55,14 @@
<properties>
<!-- Testing deps -->
- <testng.version>5.10</testng.version>
- <jboss.test.harness.version>1.1.0-CR3</jboss.test.harness.version>
- <apache.httpclient.version>3.1</apache.httpclient.version>
- <junit.version>4.7</junit.version>
- <htmlunit.version>2.4</htmlunit.version>
+
</properties>
<!-- Set up local dependecies -->
<dependencyManagement>
<dependencies>
- <dependency>
- <groupId>org.jboss.test-harness</groupId>
- <artifactId>jboss-test-harness</artifactId>
- <version>${jboss.test.harness.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.test-harness</groupId>
- <artifactId>jboss-test-harness-jboss-as-50</artifactId>
- <version>${jboss.test.harness.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.test-harness</groupId>
- <artifactId>jboss-test-harness-jboss-as-52</artifactId>
- <version>${jboss.test.harness.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.test-harness</groupId>
- <artifactId>jboss-test-harness-jboss-embedded</artifactId>
- <version>${jboss.test.harness.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.test-harness</groupId>
- <artifactId>jboss-test-harness-tomcat</artifactId>
- <version>${jboss.test.harness.version}</version>
- </dependency>
</dependencies>
</dependencyManagement>
14 years, 9 months
Weld SVN: r6019 - api/trunk/weld-spi/src/main/java/org/jboss/weld/ejb/api.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-03-09 12:19:49 -0500 (Tue, 09 Mar 2010)
New Revision: 6019
Modified:
api/trunk/weld-spi/src/main/java/org/jboss/weld/ejb/api/SessionObjectReference.java
Log:
clarify when isRemoved is true
Modified: api/trunk/weld-spi/src/main/java/org/jboss/weld/ejb/api/SessionObjectReference.java
===================================================================
--- api/trunk/weld-spi/src/main/java/org/jboss/weld/ejb/api/SessionObjectReference.java 2010-03-09 11:25:42 UTC (rev 6018)
+++ api/trunk/weld-spi/src/main/java/org/jboss/weld/ejb/api/SessionObjectReference.java 2010-03-09 17:19:49 UTC (rev 6019)
@@ -52,8 +52,11 @@
public void remove();
/**
- * Determine whether the session object has been removed
+ * Determine whether the session object has been removed.
*
+ * If the session object has yet to be referenced by {@link #getBusinessObject(Class)}
+ * then this method should not return true.
+ *
* @return true if the session object has been removed
*/
public boolean isRemoved();
14 years, 9 months
Weld SVN: r6018 - examples/trunk/se/numberguess.
by weld-commits@lists.jboss.org
Author: peteroyle
Date: 2010-03-09 06:25:42 -0500 (Tue, 09 Mar 2010)
New Revision: 6018
Modified:
examples/trunk/se/numberguess/pom.xml
Log:
This example only needs to depend on weld-se, not weld-core or jsr 250 (which are included in weld-se)
Modified: examples/trunk/se/numberguess/pom.xml
===================================================================
--- examples/trunk/se/numberguess/pom.xml 2010-03-09 11:21:13 UTC (rev 6017)
+++ examples/trunk/se/numberguess/pom.xml 2010-03-09 11:25:42 UTC (rev 6018)
@@ -25,14 +25,6 @@
<groupId>org.jboss.weld</groupId>
<artifactId>weld-se</artifactId>
</dependency>
- <dependency>
- <groupId>org.jboss.weld</groupId>
- <artifactId>weld-core</artifactId>
- </dependency>
- <dependency>
- <groupId>javax.annotation</groupId>
- <artifactId>jsr250-api</artifactId>
- </dependency>
</dependencies>
<build>
14 years, 9 months
Weld SVN: r6017 - examples/trunk/se/hello-world.
by weld-commits@lists.jboss.org
Author: peteroyle
Date: 2010-03-09 06:21:13 -0500 (Tue, 09 Mar 2010)
New Revision: 6017
Modified:
examples/trunk/se/hello-world/pom.xml
Log:
This example only needs to depend on weld-se, not weld-core (which is included in weld-se)
Modified: examples/trunk/se/hello-world/pom.xml
===================================================================
--- examples/trunk/se/hello-world/pom.xml 2010-03-07 10:32:05 UTC (rev 6016)
+++ examples/trunk/se/hello-world/pom.xml 2010-03-09 11:21:13 UTC (rev 6017)
@@ -59,10 +59,6 @@
<groupId>org.jboss.weld</groupId>
<artifactId>weld-se</artifactId>
</dependency>
- <dependency>
- <groupId>org.jboss.weld</groupId>
- <artifactId>weld-core</artifactId>
- </dependency>
</dependencies>
<build>
14 years, 9 months
Weld SVN: r6016 - core/trunk/impl/src/main/java/org/jboss/weld/servlet.
by weld-commits@lists.jboss.org
Author: dallen6
Date: 2010-03-07 05:32:05 -0500 (Sun, 07 Mar 2010)
New Revision: 6016
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/servlet/ServletLifecycle.java
Log:
Added in some missing edits from Nik due to earlier conflicts.
Modified: core/trunk/impl/src/main/java/org/jboss/weld/servlet/ServletLifecycle.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/servlet/ServletLifecycle.java 2010-03-06 22:51:41 UTC (rev 6015)
+++ core/trunk/impl/src/main/java/org/jboss/weld/servlet/ServletLifecycle.java 2010-03-07 10:32:05 UTC (rev 6016)
@@ -172,24 +172,38 @@
*/
public void endRequest(HttpServletRequest request)
{
- if (request.getAttribute(REQUEST_ATTRIBUTE_NAME) != null)
+ if (request.getAttribute(REQUEST_ATTRIBUTE_NAME) == null)
{
- HttpPassThruSessionBeanStore sessionBeanStore = (HttpPassThruSessionBeanStore) lifecycle.getSessionContext().getBeanStore();
- if ((sessionBeanStore != null) && (sessionBeanStore.isInvalidated()))
- {
- conversationManager(sessionBeanStore.getServletContext()).teardownContext();
- lifecycle.endSession(request.getRequestedSessionId(), sessionBeanStore);
- }
- lifecycle.getSessionContext().setBeanStore(null);
- lifecycle.getSessionContext().setActive(false);
- BeanStore beanStore = (BeanStore) request.getAttribute(REQUEST_ATTRIBUTE_NAME);
- if (beanStore == null)
- {
- throw new ForbiddenStateException(REQUEST_SCOPE_BEAN_STORE_MISSING);
- }
- lifecycle.endRequest(request.getRequestURI(), beanStore);
- request.removeAttribute(REQUEST_ATTRIBUTE_NAME);
+ return;
}
+ teardownSession(request);
+ teardownRequest(request);
+ lifecycle.getConversationContext().setBeanStore(null);
+ lifecycle.getConversationContext().setActive(false);
}
+
+ private void teardownSession(HttpServletRequest request)
+ {
+ HttpPassThruSessionBeanStore sessionBeanStore = (HttpPassThruSessionBeanStore) lifecycle.getSessionContext().getBeanStore();
+ if ((sessionBeanStore != null) && (sessionBeanStore.isInvalidated()))
+ {
+ conversationManager(sessionBeanStore.getServletContext()).teardownContext();
+ lifecycle.endSession(request.getRequestedSessionId(), sessionBeanStore);
+ }
+ lifecycle.getSessionContext().setActive(false);
+ lifecycle.getSessionContext().setBeanStore(null);
+
+ }
+
+ private void teardownRequest(HttpServletRequest request)
+ {
+ BeanStore beanStore = (BeanStore) request.getAttribute(REQUEST_ATTRIBUTE_NAME);
+ if (beanStore == null)
+ {
+ throw new ForbiddenStateException(REQUEST_SCOPE_BEAN_STORE_MISSING);
+ }
+ lifecycle.endRequest(request.getRequestURI(), beanStore);
+ request.removeAttribute(REQUEST_ATTRIBUTE_NAME);
+ }
}
14 years, 9 months
Weld SVN: r6015 - in core/trunk: impl/src/main/java/org/jboss/weld/logging/messages and 3 other directories.
by weld-commits@lists.jboss.org
Author: nickarls
Date: 2010-03-06 17:51:41 -0500 (Sat, 06 Mar 2010)
New Revision: 6015
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/conversation/AbstractConversationManager.java
core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/ConversationMessage.java
core/trunk/impl/src/main/java/org/jboss/weld/servlet/ServletLifecycle.java
core/trunk/impl/src/main/resources/org/jboss/weld/messages/conversation_en.properties
core/trunk/tests/src/test/java/org/jboss/weld/tests/contexts/sessionInvalidation/Storm.java
Log:
Fix an incontainer core test (http session injection)
rename ACM.destroyAllConversations -> destroyBackgroundConversations
Message for mode switching
Modified: core/trunk/impl/src/main/java/org/jboss/weld/conversation/AbstractConversationManager.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/conversation/AbstractConversationManager.java 2010-03-06 22:07:00 UTC (rev 6014)
+++ core/trunk/impl/src/main/java/org/jboss/weld/conversation/AbstractConversationManager.java 2010-03-06 22:51:41 UTC (rev 6015)
@@ -27,6 +27,7 @@
import static org.jboss.weld.logging.messages.ConversationMessage.LRC_COUNT;
import static org.jboss.weld.logging.messages.ConversationMessage.NO_CONVERSATION_TO_RESTORE;
import static org.jboss.weld.logging.messages.ConversationMessage.UNABLE_TO_RESTORE_CONVERSATION;
+import static org.jboss.weld.logging.messages.ConversationMessage.SWITCHING_MODE_RESETS_TIMEOUTS;
import java.io.Serializable;
import java.util.Collections;
@@ -88,7 +89,7 @@
}
if (!managedConversations.isEmpty())
{
- log.warn("Switching modes with non-transient conversations present resets the timeouts");
+ log.warn(SWITCHING_MODE_RESETS_TIMEOUTS);
}
if (asynchronous)
{
@@ -276,7 +277,7 @@
}
}
- public ConversationManager2 destroyAllConversations()
+ public ConversationManager2 destroyBackgroundConversations()
{
log.debug(DESTROY_ALL_LRC, "session ended");
log.trace(LRC_COUNT, managedConversations.size());
@@ -303,7 +304,7 @@
public ConversationManager2 teardownContext()
{
Container.instance().services().get(ContextLifecycle.class).teardownConversationContext();
- destroyAllConversations();
+ destroyBackgroundConversations();
return this;
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/ConversationMessage.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/ConversationMessage.java 2010-03-06 22:07:00 UTC (rev 6014)
+++ core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/ConversationMessage.java 2010-03-06 22:51:41 UTC (rev 6015)
@@ -57,7 +57,7 @@
@MessageId("000319") SWITCHED_CONVERSATION,
@MessageId("000214") BEGIN_CALLED_ON_LONG_RUNNING_CONVERSATION,
@MessageId("000215") END_CALLED_ON_TRANSIENT_CONVERSATION,
- @MessageId("000216") NULL_HTTP_SESSION;
- ;
+ @MessageId("000216") NULL_HTTP_SESSION,
+ @MessageId("000217") SWITCHING_MODE_RESETS_TIMEOUTS;
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/servlet/ServletLifecycle.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/servlet/ServletLifecycle.java 2010-03-06 22:07:00 UTC (rev 6014)
+++ core/trunk/impl/src/main/java/org/jboss/weld/servlet/ServletLifecycle.java 2010-03-06 22:51:41 UTC (rev 6015)
@@ -22,12 +22,10 @@
*/
package org.jboss.weld.servlet;
-import static org.jboss.weld.jsf.JsfHelper.getServletContext;
import static org.jboss.weld.logging.messages.ServletMessage.REQUEST_SCOPE_BEAN_STORE_MISSING;
import static org.jboss.weld.servlet.BeanProvider.conversationManager;
import static org.jboss.weld.servlet.BeanProvider.httpSessionManager;
-import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
@@ -107,7 +105,7 @@
else if (lifecycle.getRequestContext().isActive())
{
BeanStore store = restoreSessionContext(session);
- conversationManager.destroyAllConversations();
+ conversationManager.destroyBackgroundConversations();
lifecycle.endSession(session.getId(), store);
}
else
@@ -182,8 +180,8 @@
conversationManager(sessionBeanStore.getServletContext()).teardownContext();
lifecycle.endSession(request.getRequestedSessionId(), sessionBeanStore);
}
- lifecycle.getSessionContext().setActive(false);
lifecycle.getSessionContext().setBeanStore(null);
+ lifecycle.getSessionContext().setActive(false);
BeanStore beanStore = (BeanStore) request.getAttribute(REQUEST_ATTRIBUTE_NAME);
if (beanStore == null)
{
Modified: core/trunk/impl/src/main/resources/org/jboss/weld/messages/conversation_en.properties
===================================================================
--- core/trunk/impl/src/main/resources/org/jboss/weld/messages/conversation_en.properties 2010-03-06 22:07:00 UTC (rev 6014)
+++ core/trunk/impl/src/main/resources/org/jboss/weld/messages/conversation_en.properties 2010-03-06 22:51:41 UTC (rev 6015)
@@ -21,3 +21,4 @@
BEGIN_CALLED_ON_LONG_RUNNING_CONVERSATION=Attempt to call begin() on a long-running conversation
END_CALLED_ON_TRANSIENT_CONVERSATION=Attempt to call end() on a transient conversation
NULL_HTTP_SESSION=Cannot create ConversationBeanStore with a null HTTP session
+SWITCHING_MODE_RESETS_TIMEOUTS=Switching modes with non-transient conversations present resets the timeouts
Modified: core/trunk/tests/src/test/java/org/jboss/weld/tests/contexts/sessionInvalidation/Storm.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/contexts/sessionInvalidation/Storm.java 2010-03-06 22:07:00 UTC (rev 6014)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/contexts/sessionInvalidation/Storm.java 2010-03-06 22:51:41 UTC (rev 6015)
@@ -18,13 +18,14 @@
import javax.inject.Inject;
import javax.inject.Named;
-import javax.servlet.http.HttpSession;
+import org.jboss.weld.servlet.HttpSessionManager;
+
@Named
public class Storm
{
- @Inject HttpSession session;
+ @Inject HttpSessionManager sessionManager;
@Inject SomeBean someBean;
public static final String PROPERTY_VALUE = "some value";
@@ -32,7 +33,7 @@
public String invalidateSession()
{
someBean.setProp(PROPERTY_VALUE);
- session.invalidate();
+ sessionManager.getSession().invalidate();
return "success";
}
14 years, 9 months
Weld SVN: r6014 - in extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util: annotated and 1 other directory.
by weld-commits@lists.jboss.org
Author: swd847
Date: 2010-03-06 17:07:00 -0500 (Sat, 06 Mar 2010)
New Revision: 6014
Added:
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReflectionUtils.java
Modified:
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedTypeBuilder.java
Log:
updated NewAnnotatedTypeBuilder t read annotation data from all fields, not just public ones
Added: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReflectionUtils.java
===================================================================
--- extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReflectionUtils.java (rev 0)
+++ extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReflectionUtils.java 2010-03-06 22:07:00 UTC (rev 6014)
@@ -0,0 +1,118 @@
+package org.jboss.weld.extensions.util;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * class that provides a way of retrieving all methods and fields from a class
+ *
+ * @author stuart
+ *
+ */
+public class ReflectionUtils
+{
+
+ public static Set<Field> getFields(Class<?> clazz)
+ {
+ HashSet<Field> ret = new HashSet<Field>();
+ Class<?> p = clazz;
+ while (p != Object.class)
+ {
+ for (Field a : p.getDeclaredFields())
+ {
+ ret.add(a);
+ }
+ p = p.getSuperclass();
+ }
+ return ret;
+ }
+
+ public static Field getField(Class<?> parent, String name)
+ {
+ Class<?> p = parent;
+ while (p != Object.class)
+ {
+ try
+ {
+ return p.getDeclaredField(name);
+ }
+ catch (Exception e1)
+ {
+
+ }
+ p = p.getSuperclass();
+ }
+ return null;
+ }
+
+ public static boolean methodExists(Class<?> parent, String name)
+ {
+ Class<?> p = parent;
+ while (p != Object.class)
+ {
+ for (Method m : p.getDeclaredMethods())
+ {
+ if (m.getName().equals(name))
+ {
+ return true;
+ }
+ }
+ p = p.getSuperclass();
+ }
+ return false;
+ }
+
+ public static Set<Method> getMethods(Class<?> clazz)
+ {
+ HashSet<Method> ret = new HashSet<Method>();
+ Class<?> p = clazz;
+ while (p != Object.class)
+ {
+ for (Method a : p.getDeclaredMethods())
+ {
+ ret.add(a);
+ }
+ p = p.getSuperclass();
+ }
+ return ret;
+ }
+
+ public static Method getMethod(Class<?> parent, String name, Class<?>... args)
+ {
+ Class<?> p = parent;
+ while (p != Object.class)
+ {
+ try
+ {
+ return p.getDeclaredMethod(name, args);
+ }
+ catch (Exception e1)
+ {
+
+ }
+ p = p.getSuperclass();
+ }
+ return null;
+ }
+
+ public static Constructor<?> getConstructor(Class<?> parent, Class<?>... args)
+ {
+ Class<?> p = parent;
+ while (p != Object.class)
+ {
+ try
+ {
+ return p.getDeclaredConstructor(args);
+ }
+ catch (Exception e1)
+ {
+
+ }
+ p = p.getSuperclass();
+ }
+ return null;
+ }
+}
Modified: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedTypeBuilder.java
===================================================================
--- extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedTypeBuilder.java 2010-03-06 21:09:27 UTC (rev 6013)
+++ extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedTypeBuilder.java 2010-03-06 22:07:00 UTC (rev 6014)
@@ -15,6 +15,8 @@
import javax.enterprise.inject.spi.AnnotatedParameter;
import javax.enterprise.inject.spi.AnnotatedType;
+import org.jboss.weld.extensions.util.ReflectionUtils;
+
/**
* Class for constructing a new AnnotatedType. A new instance of builder must be
* used for each annotated type.
@@ -51,7 +53,7 @@
typeAnnotations.add(a);
}
- for (Field f : underlying.getFields())
+ for (Field f : ReflectionUtils.getFields(underlying))
{
AnnotationBuilder ab = new AnnotationBuilder();
fields.put(f, ab);
@@ -61,7 +63,7 @@
}
}
- for (Method m : underlying.getMethods())
+ for (Method m : ReflectionUtils.getMethods(underlying))
{
AnnotationBuilder ab = new AnnotationBuilder();
methods.put(m, ab);
14 years, 9 months
Weld SVN: r6013 - core/trunk/impl/src/main/java/org/jboss/weld/servlet.
by weld-commits@lists.jboss.org
Author: dallen6
Date: 2010-03-06 16:09:27 -0500 (Sat, 06 Mar 2010)
New Revision: 6013
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/servlet/HttpSessionBeanStore.java
core/trunk/impl/src/main/java/org/jboss/weld/servlet/ServletLifecycle.java
Log:
Fixed problem where ServletContext was lost with invalidated sessions for cleaning up the conversation store.
Modified: core/trunk/impl/src/main/java/org/jboss/weld/servlet/HttpSessionBeanStore.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/servlet/HttpSessionBeanStore.java 2010-03-06 06:25:30 UTC (rev 6012)
+++ core/trunk/impl/src/main/java/org/jboss/weld/servlet/HttpSessionBeanStore.java 2010-03-06 21:09:27 UTC (rev 6013)
@@ -18,6 +18,7 @@
import java.util.Enumeration;
+import javax.servlet.ServletContext;
import javax.servlet.http.HttpSession;
import org.jboss.weld.context.SessionContext;
@@ -36,8 +37,10 @@
private static final NamingScheme NAMING_SCHEME = new NamingScheme(SessionContext.class.getName(), "#");
- // The HTTP session context to use as backing map
+ // The HTTP session to use as backing map
private HttpSession session;
+ // The ServletContext associated with the session
+ private ServletContext servletContext;
/**
* Attaches this bean store to a session dynamically. This allows the session
@@ -50,6 +53,7 @@
public void attachToSession(HttpSession session)
{
this.session = session;
+ this.servletContext = session.getServletContext();
}
/**
@@ -100,4 +104,9 @@
return NAMING_SCHEME;
}
+ public ServletContext getServletContext()
+ {
+ return servletContext;
+ }
+
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/servlet/ServletLifecycle.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/servlet/ServletLifecycle.java 2010-03-06 06:25:30 UTC (rev 6012)
+++ core/trunk/impl/src/main/java/org/jboss/weld/servlet/ServletLifecycle.java 2010-03-06 21:09:27 UTC (rev 6013)
@@ -22,10 +22,12 @@
*/
package org.jboss.weld.servlet;
+import static org.jboss.weld.jsf.JsfHelper.getServletContext;
import static org.jboss.weld.logging.messages.ServletMessage.REQUEST_SCOPE_BEAN_STORE_MISSING;
import static org.jboss.weld.servlet.BeanProvider.conversationManager;
import static org.jboss.weld.servlet.BeanProvider.httpSessionManager;
+import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
@@ -172,38 +174,24 @@
*/
public void endRequest(HttpServletRequest request)
{
- if (request.getAttribute(REQUEST_ATTRIBUTE_NAME) == null)
+ if (request.getAttribute(REQUEST_ATTRIBUTE_NAME) != null)
{
- return;
+ HttpPassThruSessionBeanStore sessionBeanStore = (HttpPassThruSessionBeanStore) lifecycle.getSessionContext().getBeanStore();
+ if ((sessionBeanStore != null) && (sessionBeanStore.isInvalidated()))
+ {
+ conversationManager(sessionBeanStore.getServletContext()).teardownContext();
+ lifecycle.endSession(request.getRequestedSessionId(), sessionBeanStore);
+ }
+ lifecycle.getSessionContext().setActive(false);
+ lifecycle.getSessionContext().setBeanStore(null);
+ BeanStore beanStore = (BeanStore) request.getAttribute(REQUEST_ATTRIBUTE_NAME);
+ if (beanStore == null)
+ {
+ throw new ForbiddenStateException(REQUEST_SCOPE_BEAN_STORE_MISSING);
+ }
+ lifecycle.endRequest(request.getRequestURI(), beanStore);
+ request.removeAttribute(REQUEST_ATTRIBUTE_NAME);
}
- teardownSession(request);
- teardownRequest(request);
- lifecycle.getConversationContext().setBeanStore(null);
- lifecycle.getConversationContext().setActive(false);
}
-
- private void teardownSession(HttpServletRequest request)
- {
- HttpPassThruSessionBeanStore sessionBeanStore = (HttpPassThruSessionBeanStore) lifecycle.getSessionContext().getBeanStore();
- if ((sessionBeanStore != null) && (sessionBeanStore.isInvalidated()))
- {
- conversationManager(request.getSession().getServletContext()).teardownContext();
- lifecycle.endSession(request.getRequestedSessionId(), sessionBeanStore);
- }
- lifecycle.getSessionContext().setActive(false);
- lifecycle.getSessionContext().setBeanStore(null);
-
- }
-
- private void teardownRequest(HttpServletRequest request)
- {
- BeanStore beanStore = (BeanStore) request.getAttribute(REQUEST_ATTRIBUTE_NAME);
- if (beanStore == null)
- {
- throw new ForbiddenStateException(REQUEST_SCOPE_BEAN_STORE_MISSING);
- }
- lifecycle.endRequest(request.getRequestURI(), beanStore);
- request.removeAttribute(REQUEST_ATTRIBUTE_NAME);
- }
}
14 years, 9 months
Weld SVN: r6012 - extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated.
by weld-commits@lists.jboss.org
Author: swd847
Date: 2010-03-06 01:25:30 -0500 (Sat, 06 Mar 2010)
New Revision: 6012
Modified:
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedCallable.java
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedElement.java
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedMember.java
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedConstructor.java
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedField.java
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedMethod.java
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedParameter.java
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedType.java
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/TypeClosureBuilder.java
Log:
NewAnnotated* now handles paramtised fields/methods properly
Modified: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedCallable.java
===================================================================
--- extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedCallable.java 2010-03-05 21:42:52 UTC (rev 6011)
+++ extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedCallable.java 2010-03-06 06:25:30 UTC (rev 6012)
@@ -1,6 +1,7 @@
package org.jboss.weld.extensions.util.annotated;
import java.lang.reflect.Member;
+import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -20,9 +21,9 @@
private final List<AnnotatedParameter<X>> parameters;
- protected AbstractNewAnnotatedCallable(AnnotatedType<X> declaringType, Y member, Class<?> memberType, Class<?>[] parameterTypes, AnnotationStore annotations, Map<Integer, AnnotationStore> parameterAnnotations)
+ protected AbstractNewAnnotatedCallable(AnnotatedType<X> declaringType, Y member, Class<?> memberType, Class<?>[] parameterTypes, AnnotationStore annotations, Map<Integer, AnnotationStore> parameterAnnotations, Type genericType)
{
- super(declaringType, member, memberType, annotations);
+ super(declaringType, member, memberType, annotations, genericType);
this.parameters = getAnnotatedParameters(this, parameterTypes, parameterAnnotations);
}
Modified: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedElement.java
===================================================================
--- extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedElement.java 2010-03-05 21:42:52 UTC (rev 6011)
+++ extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedElement.java 2010-03-06 06:25:30 UTC (rev 6012)
@@ -16,13 +16,22 @@
abstract class AbstractNewAnnotatedElement implements Annotated
{
- private final Class<?> type;
+ private final Type type;
private final Set<Type> typeClosure;
private final AnnotationStore annotations;
- protected AbstractNewAnnotatedElement(Class<?> type, AnnotationStore annotations)
+ protected AbstractNewAnnotatedElement(Class<?> type, AnnotationStore annotations, Type genericType)
{
this.typeClosure = new TypeClosureBuilder().add(type).getTypes();
+ if (genericType != null)
+ {
+ typeClosure.add(genericType);
+ this.type = genericType;
+ }
+ else
+ {
+ this.type = type;
+ }
if (annotations == null)
{
this.annotations = new AnnotationStore();
@@ -31,7 +40,6 @@
{
this.annotations = annotations;
}
- this.type = type;
}
public <T extends Annotation> T getAnnotation(Class<T> annotationType)
Modified: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedMember.java
===================================================================
--- extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedMember.java 2010-03-05 21:42:52 UTC (rev 6011)
+++ extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedMember.java 2010-03-06 06:25:30 UTC (rev 6012)
@@ -2,6 +2,7 @@
import java.lang.reflect.Member;
import java.lang.reflect.Modifier;
+import java.lang.reflect.Type;
import javax.enterprise.inject.spi.AnnotatedMember;
import javax.enterprise.inject.spi.AnnotatedType;
@@ -16,9 +17,9 @@
private final AnnotatedType<X> declaringType;
private final M javaMember;
- protected AbstractNewAnnotatedMember(AnnotatedType<X> declaringType, M member, Class<?> memberType, AnnotationStore annotations)
+ protected AbstractNewAnnotatedMember(AnnotatedType<X> declaringType, M member, Class<?> memberType, AnnotationStore annotations, Type genericType)
{
- super(memberType, annotations);
+ super(memberType, annotations, genericType);
this.declaringType = declaringType;
this.javaMember = member;
}
Modified: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedConstructor.java
===================================================================
--- extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedConstructor.java 2010-03-05 21:42:52 UTC (rev 6011)
+++ extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedConstructor.java 2010-03-06 06:25:30 UTC (rev 6012)
@@ -15,7 +15,7 @@
NewAnnotatedConstructor(NewAnnotatedType<X> type, Constructor<?> constructor, AnnotationStore annotations, Map<Integer, AnnotationStore> parameterAnnotations)
{
- super(type, (Constructor<X>) constructor, constructor.getDeclaringClass(), constructor.getParameterTypes(), annotations, parameterAnnotations);
+ super(type, (Constructor<X>) constructor, constructor.getDeclaringClass(), constructor.getParameterTypes(), annotations, parameterAnnotations, null);
}
}
Modified: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedField.java
===================================================================
--- extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedField.java 2010-03-05 21:42:52 UTC (rev 6011)
+++ extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedField.java 2010-03-06 06:25:30 UTC (rev 6012)
@@ -15,7 +15,7 @@
NewAnnotatedField(AnnotatedType<X> declaringType, Field field, AnnotationStore annotations)
{
- super(declaringType, field, field.getType(), annotations);
+ super(declaringType, field, field.getType(), annotations, field.getGenericType());
}
}
Modified: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedMethod.java
===================================================================
--- extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedMethod.java 2010-03-05 21:42:52 UTC (rev 6011)
+++ extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedMethod.java 2010-03-06 06:25:30 UTC (rev 6012)
@@ -15,7 +15,7 @@
{
NewAnnotatedMethod(AnnotatedType<X> type, Method method, AnnotationStore annotations, Map<Integer, AnnotationStore> parameterAnnotations)
{
- super(type, method, method.getReturnType(), method.getParameterTypes(), annotations, parameterAnnotations);
+ super(type, method, method.getReturnType(), method.getParameterTypes(), annotations, parameterAnnotations, method.getGenericReturnType());
}
}
Modified: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedParameter.java
===================================================================
--- extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedParameter.java 2010-03-05 21:42:52 UTC (rev 6011)
+++ extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedParameter.java 2010-03-06 06:25:30 UTC (rev 6012)
@@ -16,7 +16,7 @@
NewAnnotatedParameter(AnnotatedCallable<X> declaringCallable, Class<?> type, int position, AnnotationStore annotations)
{
- super(type, annotations);
+ super(type, annotations, null);
this.declaringCallable = declaringCallable;
this.position = position;
}
Modified: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedType.java
===================================================================
--- extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedType.java 2010-03-05 21:42:52 UTC (rev 6011)
+++ extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedType.java 2010-03-06 06:25:30 UTC (rev 6012)
@@ -39,7 +39,7 @@
*/
NewAnnotatedType(Class<X> clazz, AnnotationStore typeAnnotations, Map<Field, AnnotationStore> fieldAnnotations, Map<Method, AnnotationStore> methodAnnotations, Map<Method, Map<Integer, AnnotationStore>> methodParameterAnnotations, Map<Constructor<X>, AnnotationStore> constructorAnnotations, Map<Constructor<X>, Map<Integer, AnnotationStore>> constructorParameterAnnotations)
{
- super(clazz, typeAnnotations);
+ super(clazz, typeAnnotations, null);
this.javaClass = clazz;
this.constructors = new HashSet<AnnotatedConstructor<X>>();
Set<Constructor<?>> cset = new HashSet<Constructor<?>>();
Modified: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/TypeClosureBuilder.java
===================================================================
--- extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/TypeClosureBuilder.java 2010-03-05 21:42:52 UTC (rev 6011)
+++ extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/TypeClosureBuilder.java 2010-03-06 06:25:30 UTC (rev 6012)
@@ -15,6 +15,12 @@
final Set<Type> types = new HashSet<Type>();
+ public TypeClosureBuilder add(Type type)
+ {
+ types.add(type);
+ return this;
+ }
+
public TypeClosureBuilder add(Class<?> beanType)
{
Class<?> c = beanType;
14 years, 10 months
Weld SVN: r6011 - extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated.
by weld-commits@lists.jboss.org
Author: swd847
Date: 2010-03-05 16:42:52 -0500 (Fri, 05 Mar 2010)
New Revision: 6011
Modified:
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedType.java
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedTypeBuilder.java
Log:
minor fixes to NewAnnotatedType
Modified: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedType.java
===================================================================
--- extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedType.java 2010-03-05 20:37:57 UTC (rev 6010)
+++ extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedType.java 2010-03-05 21:42:52 UTC (rev 6011)
@@ -83,7 +83,7 @@
}
for (Entry<Field, AnnotationStore> e : fieldAnnotations.entrySet())
{
- if (fset.contains(e.getKey()))
+ if (!fset.contains(e.getKey()))
{
fields.add(new NewAnnotatedField<X>(this, e.getKey(), e.getValue()));
}
Modified: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedTypeBuilder.java
===================================================================
--- extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedTypeBuilder.java 2010-03-05 20:37:57 UTC (rev 6010)
+++ extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedTypeBuilder.java 2010-03-05 21:42:52 UTC (rev 6011)
@@ -226,6 +226,10 @@
public NewAnnotatedTypeBuilder<X> addToMethodParameter(Method method, int parameter, Annotation a)
{
+ if (!methods.containsKey(method))
+ {
+ methods.put(method, new AnnotationBuilder());
+ }
Map<Integer, AnnotationBuilder> anmap = methodParameters.get(method);
if (anmap == null)
{
@@ -268,7 +272,7 @@
return this;
}
- public NewAnnotatedTypeBuilder<X> removeFromConstructor(Constructor constructor, Class<? extends Annotation> a)
+ public NewAnnotatedTypeBuilder<X> removeFromConstructor(Constructor<?> constructor, Class<? extends Annotation> a)
{
AnnotationBuilder annotations = constructors.get(constructor);
if (annotations != null)
@@ -280,6 +284,10 @@
public NewAnnotatedTypeBuilder<X> addToConstructorParameter(Constructor<X> constructor, int parameter, Annotation a)
{
+ if (!constructors.containsKey(constructor))
+ {
+ constructors.put(constructor, new AnnotationBuilder());
+ }
Map<Integer, AnnotationBuilder> anmap = constructorParameters.get(constructor);
if (anmap == null)
{
14 years, 10 months