[weld-commits] Weld SVN: r6940 - in java-se: trunk and 39 other directories.
weld-commits at lists.jboss.org
weld-commits at lists.jboss.org
Thu Aug 5 18:17:38 EDT 2010
Author: pete.muir at jboss.org
Date: 2010-08-05 18:17:21 -0400 (Thu, 05 Aug 2010)
New Revision: 6940
Added:
java-se/branches/
java-se/trunk/
java-se/trunk/pom.xml
java-se/trunk/src/
java-se/trunk/src/etc/
java-se/trunk/src/etc/header.txt
java-se/trunk/src/main/
java-se/trunk/src/main/java/
java-se/trunk/src/main/java/org/
java-se/trunk/src/main/java/org/jboss/
java-se/trunk/src/main/java/org/jboss/weld/
java-se/trunk/src/main/java/org/jboss/weld/environment/
java-se/trunk/src/main/java/org/jboss/weld/environment/se/
java-se/trunk/src/main/java/org/jboss/weld/environment/se/ShutdownManager.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/StartMain.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/Weld.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/WeldContainer.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/WeldSEBeanRegistrant.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/beans/
java-se/trunk/src/main/java/org/jboss/weld/environment/se/beans/InstanceManager.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/beans/ParametersFactory.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/bindings/
java-se/trunk/src/main/java/org/jboss/weld/environment/se/bindings/Parameters.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/contexts/
java-se/trunk/src/main/java/org/jboss/weld/environment/se/contexts/ThreadContext.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/contexts/ThreadScoped.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/
java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/AbstractWeldSEBeanDeploymentArchive.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/AbstractWeldSEDeployment.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/ImmutableBeanDeploymentArchive.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/MutableBeanDeploymentArchive.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/
java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/ClasspathScanningException.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/FileSystemURLHandler.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/URLScanner.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/WeldSEResourceLoader.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/WeldSEUrlDeployment.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/events/
java-se/trunk/src/main/java/org/jboss/weld/environment/se/events/ContainerInitialized.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/threading/
java-se/trunk/src/main/java/org/jboss/weld/environment/se/threading/RunnableDecorator.java
java-se/trunk/src/main/resources/
java-se/trunk/src/main/resources/META-INF/
java-se/trunk/src/main/resources/META-INF/services/
java-se/trunk/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
java-se/trunk/src/main/resources/log4j.xml
java-se/trunk/src/test/
java-se/trunk/src/test/java/
java-se/trunk/src/test/java/org/
java-se/trunk/src/test/java/org/jboss/
java-se/trunk/src/test/java/org/jboss/webbeans/
java-se/trunk/src/test/java/org/jboss/webbeans/environment/
java-se/trunk/src/test/java/org/jboss/webbeans/environment/se/
java-se/trunk/src/test/java/org/jboss/webbeans/environment/se/test/
java-se/trunk/src/test/java/org/jboss/weld/
java-se/trunk/src/test/java/org/jboss/weld/environment/
java-se/trunk/src/test/java/org/jboss/weld/environment/se/
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/DecoratorsTest.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/EventsTest.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/InterceptorsTest.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/ScopesTest.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/StartMainTest.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/ThreadContextTest.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/WeldMainTest.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/CustomEvent.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/InitObserverTestBean.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/InterceptorTestBean.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/MainTestBean.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/ObserverTestBean.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/ParametersTestBean.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/Counter.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/SingletonCounter.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/ThreadCounter.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/ThreadRunner.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/AbstractDoor.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/CarDoor.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/CarDoorAlarm.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/Door.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/HouseDoor.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/Bar.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/EventQualifier1.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/EventQualifier2.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/Foo.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/Aggregated.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/AggregatingInterceptor.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/Recorded.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/RecordingInterceptor.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/Tracked.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/scopes/
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/scopes/Bar.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/scopes/Foo.java
java-se/trunk/src/test/resources/
java-se/trunk/src/test/resources/META-INF/
java-se/trunk/src/test/resources/META-INF/beans.xml
java-se/trunk/src/test/resources/META-INF/services/
java-se/trunk/src/test/resources/META-INF/services/javax.enterprise.inject.spi.Extension
Removed:
java-se/README
java-se/trunk/pom.xml
java-se/trunk/src/
java-se/trunk/src/etc/
java-se/trunk/src/etc/header.txt
java-se/trunk/src/main/
java-se/trunk/src/main/java/
java-se/trunk/src/main/java/org/
java-se/trunk/src/main/java/org/jboss/
java-se/trunk/src/main/java/org/jboss/weld/
java-se/trunk/src/main/java/org/jboss/weld/environment/
java-se/trunk/src/main/java/org/jboss/weld/environment/se/
java-se/trunk/src/main/java/org/jboss/weld/environment/se/ShutdownManager.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/StartMain.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/Weld.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/WeldContainer.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/WeldSEBeanRegistrant.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/beans/
java-se/trunk/src/main/java/org/jboss/weld/environment/se/beans/InstanceManager.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/beans/ParametersFactory.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/bindings/
java-se/trunk/src/main/java/org/jboss/weld/environment/se/bindings/Parameters.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/contexts/
java-se/trunk/src/main/java/org/jboss/weld/environment/se/contexts/ThreadContext.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/contexts/ThreadScoped.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/
java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/AbstractWeldSEBeanDeploymentArchive.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/AbstractWeldSEDeployment.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/ImmutableBeanDeploymentArchive.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/MutableBeanDeploymentArchive.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/
java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/ClasspathScanningException.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/FileSystemURLHandler.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/URLScanner.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/WeldSEResourceLoader.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/WeldSEUrlDeployment.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/events/
java-se/trunk/src/main/java/org/jboss/weld/environment/se/events/ContainerInitialized.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/threading/
java-se/trunk/src/main/java/org/jboss/weld/environment/se/threading/RunnableDecorator.java
java-se/trunk/src/main/resources/
java-se/trunk/src/main/resources/META-INF/
java-se/trunk/src/main/resources/META-INF/services/
java-se/trunk/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
java-se/trunk/src/main/resources/log4j.xml
java-se/trunk/src/test/
java-se/trunk/src/test/java/
java-se/trunk/src/test/java/org/
java-se/trunk/src/test/java/org/jboss/
java-se/trunk/src/test/java/org/jboss/webbeans/
java-se/trunk/src/test/java/org/jboss/webbeans/environment/
java-se/trunk/src/test/java/org/jboss/webbeans/environment/se/
java-se/trunk/src/test/java/org/jboss/webbeans/environment/se/test/
java-se/trunk/src/test/java/org/jboss/weld/
java-se/trunk/src/test/java/org/jboss/weld/environment/
java-se/trunk/src/test/java/org/jboss/weld/environment/se/
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/DecoratorsTest.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/EventsTest.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/InterceptorsTest.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/ScopesTest.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/StartMainTest.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/ThreadContextTest.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/WeldMainTest.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/CustomEvent.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/InitObserverTestBean.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/InterceptorTestBean.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/MainTestBean.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/ObserverTestBean.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/ParametersTestBean.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/Counter.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/SingletonCounter.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/ThreadCounter.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/ThreadRunner.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/AbstractDoor.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/CarDoor.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/CarDoorAlarm.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/Door.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/HouseDoor.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/Bar.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/EventQualifier1.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/EventQualifier2.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/Foo.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/Aggregated.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/AggregatingInterceptor.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/Recorded.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/RecordingInterceptor.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/Tracked.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/scopes/
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/scopes/Bar.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/scopes/Foo.java
java-se/trunk/src/test/resources/
java-se/trunk/src/test/resources/META-INF/
java-se/trunk/src/test/resources/META-INF/beans.xml
java-se/trunk/src/test/resources/META-INF/services/
java-se/trunk/src/test/resources/META-INF/services/javax.enterprise.inject.spi.Extension
Log:
oops
Deleted: java-se/README
===================================================================
--- java-se/README 2010-08-05 20:33:03 UTC (rev 6939)
+++ java-se/README 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,5 +0,0 @@
-The is the legacy repository for the Weld Java SE support. It contains tags for Weld 1.0.x Java SE support.
-
-Since Weld 1.1 Java SE support has been merged into Weld Core. New development and tags for the later series of
-Weld Java SE support is at http://github.com/weld/core in environments/se
-
Copied: java-se/branches (from rev 6914, java-se/branches)
Copied: java-se/trunk (from rev 6914, java-se/trunk)
Property changes on: java-se/trunk
___________________________________________________________________
Name: svn:ignore
+ target
.classpath
.settings
.project
test-output
Deleted: java-se/trunk/pom.xml
===================================================================
--- java-se/trunk/pom.xml 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/pom.xml 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,203 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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">
- <parent>
- <artifactId>weld-parent</artifactId>
- <groupId>org.jboss.weld</groupId>
- <version>12</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.weld</groupId>
- <artifactId>weld-se</artifactId>
- <version>1.0.2-SNAPSHOT</version>
- <packaging>jar</packaging>
- <name>Weld SE Support</name>
-
- <description>Weld support for Java SE</description>
-
- <url>http://www.seamframework.org/Weld</url>
- <licenses>
- <license>
- <name>Apache License, Version 2.0</name>
- <distribution>repo</distribution>
- <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
- </license>
- </licenses>
-
- <developers>
- <developer>
- <name>Pete Royle</name>
- <roles>
- <role>Module lead</role>
- </roles>
- </developer>
- </developers>
-
-
- <properties>
- <!-- Testing deps -->
- <testng.version>5.10</testng.version>
- <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>
- </properties>
-
- <!-- Dependency management, including extra repositories if needed -->
- <repositories>
- <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>
- <dependency>
- <groupId>org.jboss.weld</groupId>
- <artifactId>weld-api-bom</artifactId>
- <version>${weld.api.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.weld</groupId>
- <artifactId>weld-core-bom</artifactId>
- <version>${weld.core.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- <dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- <classifier>jdk15</classifier>
- <version>${testng.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.weld</groupId>
- <artifactId>weld-se</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-jdk14</artifactId>
- <version>${slf4j.version}</version>
- </dependency>
- </dependencies>
- </dependencyManagement>
- <!-- Set up local dependecies -->
-
- <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>org.jboss.weld</groupId>
- <artifactId>weld-spi</artifactId>
- <exclusions>
- <exclusion>
- <groupId>javax.jms</groupId>
- <artifactId>jms</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.ejb</groupId>
- <artifactId>ejb-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.jta</groupId>
- <artifactId>transaction-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.weld</groupId>
- <artifactId>weld-core</artifactId>
- </dependency>
-
- <dependency>
- <groupId>javax.enterprise</groupId>
- <artifactId>cdi-api</artifactId>
- </dependency>
-
- <dependency>
- <groupId>javax.el</groupId>
- <artifactId>el-api</artifactId>
- </dependency>
-
- <!-- WELD-203 -->
- <dependency>
- <groupId>javax.annotation</groupId>
- <artifactId>jsr250-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- </configuration>
- </execution>
- </executions>
- <configuration>
- <artifactSet>
- <excludes>
- <exclude>org.slf4j:slf4j-simple</exclude>
- </excludes>
- </artifactSet>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifest>
- <mainClass>org.jboss.weld.environment.se.StartMain</mainClass>
- </manifest>
- </archive>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/weld/java-se/trunk</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/weld/java-se/trunk</developerConnection>
- <url>http://fisheye.jboss.org/browse/weld/java-se/trunk</url>
- </scm>
-
-
-</project>
-
-
-
Copied: java-se/trunk/pom.xml (from rev 6914, java-se/trunk/pom.xml)
===================================================================
--- java-se/trunk/pom.xml (rev 0)
+++ java-se/trunk/pom.xml 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,203 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+ <parent>
+ <artifactId>weld-parent</artifactId>
+ <groupId>org.jboss.weld</groupId>
+ <version>12</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-se</artifactId>
+ <version>1.0.2-SNAPSHOT</version>
+ <packaging>jar</packaging>
+ <name>Weld SE Support</name>
+
+ <description>Weld support for Java SE</description>
+
+ <url>http://www.seamframework.org/Weld</url>
+ <licenses>
+ <license>
+ <name>Apache License, Version 2.0</name>
+ <distribution>repo</distribution>
+ <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
+ </license>
+ </licenses>
+
+ <developers>
+ <developer>
+ <name>Pete Royle</name>
+ <roles>
+ <role>Module lead</role>
+ </roles>
+ </developer>
+ </developers>
+
+
+ <properties>
+ <!-- Testing deps -->
+ <testng.version>5.10</testng.version>
+ <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>
+ </properties>
+
+ <!-- Dependency management, including extra repositories if needed -->
+ <repositories>
+ <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>
+ <dependency>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-api-bom</artifactId>
+ <version>${weld.api.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-core-bom</artifactId>
+ <version>${weld.core.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <classifier>jdk15</classifier>
+ <version>${testng.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-se</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-jdk14</artifactId>
+ <version>${slf4j.version}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ <!-- Set up local dependecies -->
+
+ <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>org.jboss.weld</groupId>
+ <artifactId>weld-spi</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.jms</groupId>
+ <artifactId>jms</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.ejb</groupId>
+ <artifactId>ejb-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.jta</groupId>
+ <artifactId>transaction-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-core</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ </dependency>
+
+ <!-- WELD-203 -->
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ <configuration>
+ </configuration>
+ </execution>
+ </executions>
+ <configuration>
+ <artifactSet>
+ <excludes>
+ <exclude>org.slf4j:slf4j-simple</exclude>
+ </excludes>
+ </artifactSet>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <mainClass>org.jboss.weld.environment.se.StartMain</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/weld/java-se/trunk</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/weld/java-se/trunk</developerConnection>
+ <url>http://fisheye.jboss.org/browse/weld/java-se/trunk</url>
+ </scm>
+
+
+</project>
+
+
+
Copied: java-se/trunk/src (from rev 6914, java-se/trunk/src)
Copied: java-se/trunk/src/etc (from rev 6914, java-se/trunk/src/etc)
Deleted: java-se/trunk/src/etc/header.txt
===================================================================
--- java-se/trunk/src/etc/header.txt 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/etc/header.txt 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,14 +0,0 @@
-JBoss, Home of Professional Open Source
-Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
-contributors by the @authors tag. See the copyright.txt in the
-distribution for a full listing of individual contributors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-http://www.apache.org/licenses/LICENSE-2.0
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
Copied: java-se/trunk/src/etc/header.txt (from rev 6914, java-se/trunk/src/etc/header.txt)
===================================================================
--- java-se/trunk/src/etc/header.txt (rev 0)
+++ java-se/trunk/src/etc/header.txt 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,14 @@
+JBoss, Home of Professional Open Source
+Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+contributors by the @authors tag. See the copyright.txt in the
+distribution for a full listing of individual contributors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
Copied: java-se/trunk/src/main (from rev 6914, java-se/trunk/src/main)
Copied: java-se/trunk/src/main/java (from rev 6914, java-se/trunk/src/main/java)
Copied: java-se/trunk/src/main/java/org (from rev 6914, java-se/trunk/src/main/java/org)
Copied: java-se/trunk/src/main/java/org/jboss (from rev 6914, java-se/trunk/src/main/java/org/jboss)
Copied: java-se/trunk/src/main/java/org/jboss/weld (from rev 6914, java-se/trunk/src/main/java/org/jboss/weld)
Copied: java-se/trunk/src/main/java/org/jboss/weld/environment (from rev 6914, java-se/trunk/src/main/java/org/jboss/weld/environment)
Copied: java-se/trunk/src/main/java/org/jboss/weld/environment/se (from rev 6914, java-se/trunk/src/main/java/org/jboss/weld/environment/se)
Deleted: java-se/trunk/src/main/java/org/jboss/weld/environment/se/ShutdownManager.java
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/ShutdownManager.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/ShutdownManager.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,61 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se;
-
-import javax.enterprise.context.ApplicationScoped;
-import org.jboss.weld.bootstrap.api.Bootstrap;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
- at ApplicationScoped
-public class ShutdownManager
-{
-
- private static Logger log = LoggerFactory.getLogger(ShutdownManager.class);
-
- private boolean hasShutdownBeenCalled = false;
-
- private Bootstrap bootstrap;
-
- /**
- * Shutdown Weld SE gracefully.
- */
- public void shutdown()
- {
- synchronized (this)
- {
-
- if (!hasShutdownBeenCalled)
- {
- hasShutdownBeenCalled = true;
- bootstrap.shutdown();
- }
- else
- {
- log.debug("Skipping spurious call to shutdown");
- log.trace("Spurious call to shutdown from: ",
- Thread.currentThread().getStackTrace());
- }
- }
- }
-
- public void setBootstrap(Bootstrap bootstrap)
- {
- this.bootstrap = bootstrap;
- }
-
-}
Copied: java-se/trunk/src/main/java/org/jboss/weld/environment/se/ShutdownManager.java (from rev 6914, java-se/trunk/src/main/java/org/jboss/weld/environment/se/ShutdownManager.java)
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/ShutdownManager.java (rev 0)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/ShutdownManager.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,61 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se;
+
+import javax.enterprise.context.ApplicationScoped;
+import org.jboss.weld.bootstrap.api.Bootstrap;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+ at ApplicationScoped
+public class ShutdownManager
+{
+
+ private static Logger log = LoggerFactory.getLogger(ShutdownManager.class);
+
+ private boolean hasShutdownBeenCalled = false;
+
+ private Bootstrap bootstrap;
+
+ /**
+ * Shutdown Weld SE gracefully.
+ */
+ public void shutdown()
+ {
+ synchronized (this)
+ {
+
+ if (!hasShutdownBeenCalled)
+ {
+ hasShutdownBeenCalled = true;
+ bootstrap.shutdown();
+ }
+ else
+ {
+ log.debug("Skipping spurious call to shutdown");
+ log.trace("Spurious call to shutdown from: ",
+ Thread.currentThread().getStackTrace());
+ }
+ }
+ }
+
+ public void setBootstrap(Bootstrap bootstrap)
+ {
+ this.bootstrap = bootstrap;
+ }
+
+}
Deleted: java-se/trunk/src/main/java/org/jboss/weld/environment/se/StartMain.java
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/StartMain.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/StartMain.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,65 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se;
-
-
-import org.jboss.weld.environment.se.events.ContainerInitialized;
-
-/**
- * This is the main class that can be called from the command line for
- * a WeldContainer SE app which makes use of the ContainerInitialized event.
- * Something like:
- * <code>
- * java -cp weld-se.jar:my-app.jar org.jboss.weld.environment.se.StartMain arg1 arg2
- * </code>
- *
- * @author Peter Royle
- * @author Pete Muir
- */
-public class StartMain
-{
-
- public static String[] PARAMETERS;
-
- public StartMain(String[] commandLineArgs)
- {
- PARAMETERS = commandLineArgs;
- }
-
- public WeldContainer go()
- {
- WeldContainer weld = new Weld().initialize();
- weld.event().select(ContainerInitialized.class).fire(new ContainerInitialized());
- return weld;
- }
-
- /**
- * The main method called from the command line.
- *
- * @param args the command line arguments
- */
- public static void main(String[] args)
- {
- new StartMain(args).go();
- }
-
- public static String[] getParameters()
- {
- // TODO(PR): make immutable
- return PARAMETERS;
- }
-}
Copied: java-se/trunk/src/main/java/org/jboss/weld/environment/se/StartMain.java (from rev 6914, java-se/trunk/src/main/java/org/jboss/weld/environment/se/StartMain.java)
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/StartMain.java (rev 0)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/StartMain.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,65 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se;
+
+
+import org.jboss.weld.environment.se.events.ContainerInitialized;
+
+/**
+ * This is the main class that can be called from the command line for
+ * a WeldContainer SE app which makes use of the ContainerInitialized event.
+ * Something like:
+ * <code>
+ * java -cp weld-se.jar:my-app.jar org.jboss.weld.environment.se.StartMain arg1 arg2
+ * </code>
+ *
+ * @author Peter Royle
+ * @author Pete Muir
+ */
+public class StartMain
+{
+
+ public static String[] PARAMETERS;
+
+ public StartMain(String[] commandLineArgs)
+ {
+ PARAMETERS = commandLineArgs;
+ }
+
+ public WeldContainer go()
+ {
+ WeldContainer weld = new Weld().initialize();
+ weld.event().select(ContainerInitialized.class).fire(new ContainerInitialized());
+ return weld;
+ }
+
+ /**
+ * The main method called from the command line.
+ *
+ * @param args the command line arguments
+ */
+ public static void main(String[] args)
+ {
+ new StartMain(args).go();
+ }
+
+ public static String[] getParameters()
+ {
+ // TODO(PR): make immutable
+ return PARAMETERS;
+ }
+}
Deleted: java-se/trunk/src/main/java/org/jboss/weld/environment/se/Weld.java
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/Weld.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/Weld.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,175 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se;
-
-import java.lang.annotation.Annotation;
-import java.util.Arrays;
-
-import javax.enterprise.context.spi.CreationalContext;
-import javax.enterprise.inject.UnsatisfiedResolutionException;
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.BeanManager;
-
-import org.jboss.weld.bootstrap.api.Bootstrap;
-import org.jboss.weld.bootstrap.api.Environments;
-import org.jboss.weld.bootstrap.spi.Deployment;
-import org.jboss.weld.context.api.BeanStore;
-import org.jboss.weld.context.api.helpers.ConcurrentHashMapBeanStore;
-import org.jboss.weld.environment.se.discovery.url.WeldSEResourceLoader;
-import org.jboss.weld.environment.se.discovery.url.WeldSEUrlDeployment;
-import org.jboss.weld.resources.spi.ResourceLoader;
-
-/**
- * <p>
- * The preferred method of booting Weld SE.
- * </p>
- *
- * <p>
- * Typical usage of this API looks like this:
- * </p>
- *
- * <pre>
- * WeldContainer weld = new Weld().initialize();
- * weld.instance().select(Foo.class).get();
- * weld.event().select(Bar.class).fire(new Bar());
- * weld.shutdown();
- * </pre>
- *
- * @author Peter Royle
- * @author Pete Muir
- */
-public class Weld
-{
-
- private static final String BOOTSTRAP_IMPL_CLASS_NAME = "org.jboss.weld.bootstrap.WeldBootstrap";
-
- private ShutdownManager shutdownManager;
-
- /**
- * Boots Weld and creates and returns a WeldContainer instance, through which
- * beans and events can be accessed.
- */
- public WeldContainer initialize()
- {
-
- BeanStore applicationBeanStore = new ConcurrentHashMapBeanStore();
- Deployment deployment = createDeployment();
-
- Bootstrap bootstrap = null;
- try
- {
- bootstrap = (Bootstrap) deployment.getServices().get(ResourceLoader.class).classForName(BOOTSTRAP_IMPL_CLASS_NAME).newInstance();
- }
- catch (InstantiationException ex)
- {
- throw new IllegalStateException("Error loading Weld bootstrap, check that Weld is on the classpath", ex);
- }
- catch (IllegalAccessException ex)
- {
- throw new IllegalStateException("Error loading Weld bootstrap, check that Weld is on the classpath", ex);
- }
-
- // Set up the container
- bootstrap.startContainer(Environments.SE, deployment, applicationBeanStore);
-
- // Start the container
- bootstrap.startInitialization();
- bootstrap.deployBeans();
- getInstanceByType(bootstrap.getManager(deployment.loadBeanDeploymentArchive(ShutdownManager.class)), ShutdownManager.class).setBootstrap(bootstrap);
- bootstrap.validateBeans();
- bootstrap.endInitialization();
-
- // Set up the ShutdownManager for later
- this.shutdownManager = getInstanceByType(bootstrap.getManager(deployment.loadBeanDeploymentArchive(ShutdownManager.class)), ShutdownManager.class);
-
- return getInstanceByType(bootstrap.getManager(deployment.loadBeanDeploymentArchive(WeldContainer.class)), WeldContainer.class);
- }
-
- /**
- * <p>
- * Extensions to Weld SE can subclass and override this method to customise
- * the deployment before weld boots up. For example, to add a custom
- * ResourceLoader, you would subclass Weld like so:
- * </p>
- *
- * <pre>
- * public class MyWeld extends Weld
- * {
- * protected Deployment createDeployment()
- * {
- * Deployment deployment = super.createDeployment();
- * deployment.getServices().add(ResourceLoader.class, new MyResourceLoader());
- * return deployment;
- * }
- * }
- *</pre>
- *
- * <p>
- * This could then be used as normal:
- * </p>
- *
- * <pre>
- * WeldContainer container = new MyWeld().initialize();
- * </pre>
- *
- */
- protected Deployment createDeployment()
- {
- return new WeldSEUrlDeployment(new WeldSEResourceLoader());
- }
-
- /**
- * Utility method allowing managed instances of beans to provide entry points
- * for non-managed beans (such as {@link WeldContainer}). Should only called
- * once Weld has finished booting.
- *
- * @param manager the BeanManager to use to access the managed instance
- * @param type the type of the Bean
- * @param bindings the bean's qualifiers
- * @return a managed instance of the bean
- * @throws IllegalArgumentException if the given type represents a type
- * variable
- * @throws IllegalArgumentException if two instances of the same qualifier
- * type are given
- * @throws IllegalArgumentException if an instance of an annotation that is
- * not a qualifier type is given
- * @throws UnsatisfiedResolutionException if no beans can be resolved * @throws
- * AmbiguousResolutionException if the ambiguous dependency
- * resolution rules fail
- * @throws IllegalArgumentException if the given type is not a bean type of
- * the given bean
- *
- */
- protected <T> T getInstanceByType(BeanManager manager, Class<T> type, Annotation... bindings)
- {
- final Bean<?> bean = manager.resolve(manager.getBeans(type));
- if (bean == null)
- {
- throw new UnsatisfiedResolutionException("Unable to resolve a bean for " + type + " with bindings " + Arrays.asList(bindings));
- }
- CreationalContext<?> cc = manager.createCreationalContext(bean);
- return type.cast(manager.getReference(bean, type, cc));
- }
-
- /**
- * Shuts down Weld.
- */
- public void shutdown()
- {
- shutdownManager.shutdown();
- }
-}
Copied: java-se/trunk/src/main/java/org/jboss/weld/environment/se/Weld.java (from rev 6914, java-se/trunk/src/main/java/org/jboss/weld/environment/se/Weld.java)
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/Weld.java (rev 0)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/Weld.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,175 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se;
+
+import java.lang.annotation.Annotation;
+import java.util.Arrays;
+
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.UnsatisfiedResolutionException;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.BeanManager;
+
+import org.jboss.weld.bootstrap.api.Bootstrap;
+import org.jboss.weld.bootstrap.api.Environments;
+import org.jboss.weld.bootstrap.spi.Deployment;
+import org.jboss.weld.context.api.BeanStore;
+import org.jboss.weld.context.api.helpers.ConcurrentHashMapBeanStore;
+import org.jboss.weld.environment.se.discovery.url.WeldSEResourceLoader;
+import org.jboss.weld.environment.se.discovery.url.WeldSEUrlDeployment;
+import org.jboss.weld.resources.spi.ResourceLoader;
+
+/**
+ * <p>
+ * The preferred method of booting Weld SE.
+ * </p>
+ *
+ * <p>
+ * Typical usage of this API looks like this:
+ * </p>
+ *
+ * <pre>
+ * WeldContainer weld = new Weld().initialize();
+ * weld.instance().select(Foo.class).get();
+ * weld.event().select(Bar.class).fire(new Bar());
+ * weld.shutdown();
+ * </pre>
+ *
+ * @author Peter Royle
+ * @author Pete Muir
+ */
+public class Weld
+{
+
+ private static final String BOOTSTRAP_IMPL_CLASS_NAME = "org.jboss.weld.bootstrap.WeldBootstrap";
+
+ private ShutdownManager shutdownManager;
+
+ /**
+ * Boots Weld and creates and returns a WeldContainer instance, through which
+ * beans and events can be accessed.
+ */
+ public WeldContainer initialize()
+ {
+
+ BeanStore applicationBeanStore = new ConcurrentHashMapBeanStore();
+ Deployment deployment = createDeployment();
+
+ Bootstrap bootstrap = null;
+ try
+ {
+ bootstrap = (Bootstrap) deployment.getServices().get(ResourceLoader.class).classForName(BOOTSTRAP_IMPL_CLASS_NAME).newInstance();
+ }
+ catch (InstantiationException ex)
+ {
+ throw new IllegalStateException("Error loading Weld bootstrap, check that Weld is on the classpath", ex);
+ }
+ catch (IllegalAccessException ex)
+ {
+ throw new IllegalStateException("Error loading Weld bootstrap, check that Weld is on the classpath", ex);
+ }
+
+ // Set up the container
+ bootstrap.startContainer(Environments.SE, deployment, applicationBeanStore);
+
+ // Start the container
+ bootstrap.startInitialization();
+ bootstrap.deployBeans();
+ getInstanceByType(bootstrap.getManager(deployment.loadBeanDeploymentArchive(ShutdownManager.class)), ShutdownManager.class).setBootstrap(bootstrap);
+ bootstrap.validateBeans();
+ bootstrap.endInitialization();
+
+ // Set up the ShutdownManager for later
+ this.shutdownManager = getInstanceByType(bootstrap.getManager(deployment.loadBeanDeploymentArchive(ShutdownManager.class)), ShutdownManager.class);
+
+ return getInstanceByType(bootstrap.getManager(deployment.loadBeanDeploymentArchive(WeldContainer.class)), WeldContainer.class);
+ }
+
+ /**
+ * <p>
+ * Extensions to Weld SE can subclass and override this method to customise
+ * the deployment before weld boots up. For example, to add a custom
+ * ResourceLoader, you would subclass Weld like so:
+ * </p>
+ *
+ * <pre>
+ * public class MyWeld extends Weld
+ * {
+ * protected Deployment createDeployment()
+ * {
+ * Deployment deployment = super.createDeployment();
+ * deployment.getServices().add(ResourceLoader.class, new MyResourceLoader());
+ * return deployment;
+ * }
+ * }
+ *</pre>
+ *
+ * <p>
+ * This could then be used as normal:
+ * </p>
+ *
+ * <pre>
+ * WeldContainer container = new MyWeld().initialize();
+ * </pre>
+ *
+ */
+ protected Deployment createDeployment()
+ {
+ return new WeldSEUrlDeployment(new WeldSEResourceLoader());
+ }
+
+ /**
+ * Utility method allowing managed instances of beans to provide entry points
+ * for non-managed beans (such as {@link WeldContainer}). Should only called
+ * once Weld has finished booting.
+ *
+ * @param manager the BeanManager to use to access the managed instance
+ * @param type the type of the Bean
+ * @param bindings the bean's qualifiers
+ * @return a managed instance of the bean
+ * @throws IllegalArgumentException if the given type represents a type
+ * variable
+ * @throws IllegalArgumentException if two instances of the same qualifier
+ * type are given
+ * @throws IllegalArgumentException if an instance of an annotation that is
+ * not a qualifier type is given
+ * @throws UnsatisfiedResolutionException if no beans can be resolved * @throws
+ * AmbiguousResolutionException if the ambiguous dependency
+ * resolution rules fail
+ * @throws IllegalArgumentException if the given type is not a bean type of
+ * the given bean
+ *
+ */
+ protected <T> T getInstanceByType(BeanManager manager, Class<T> type, Annotation... bindings)
+ {
+ final Bean<?> bean = manager.resolve(manager.getBeans(type));
+ if (bean == null)
+ {
+ throw new UnsatisfiedResolutionException("Unable to resolve a bean for " + type + " with bindings " + Arrays.asList(bindings));
+ }
+ CreationalContext<?> cc = manager.createCreationalContext(bean);
+ return type.cast(manager.getReference(bean, type, cc));
+ }
+
+ /**
+ * Shuts down Weld.
+ */
+ public void shutdown()
+ {
+ shutdownManager.shutdown();
+ }
+}
Deleted: java-se/trunk/src/main/java/org/jboss/weld/environment/se/WeldContainer.java
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/WeldContainer.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/WeldContainer.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,80 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se;
-
-import javax.enterprise.event.Event;
-import javax.enterprise.inject.Instance;
-import javax.enterprise.inject.spi.BeanManager;
-import javax.inject.Inject;
-
-import org.jboss.weld.environment.se.beans.InstanceManager;
-
-/**
- * Provides convenient access to beans and events, particularly helpful when
- * bootstrapping an application in Java SE.
- * <p>
- * An instance of this class can be obtained using the Weld class by calling:
- * <code>
- * WeldContainer weld = new Weld().initialize();
- * </code>
- * @see Weld
- *
- * @author Peter Royle
- */
-public class WeldContainer
-{
-
- private final InstanceManager instanceManager;
- private final BeanManager beanManager;
-
- @Inject
- protected WeldContainer(InstanceManager instanceManager, BeanManager beanManager)
- {
- this.instanceManager = instanceManager;
- this.beanManager = beanManager;
- }
-
- /**
- * Provides access to all beans within the application. For example:
- * <code>
- * Foo foo = weld.instance().select(Foo.class).get();
- * </code>
- */
- public Instance<Object> instance()
- {
- return instanceManager.getInstances();
- }
-
- /**
- * Provides access to all events within the application. For example:
- * <code>
- * weld.event().select(Bar.class).fire(new Bar());
- * </code>
- */
- public Event<Object> event()
- {
- return instanceManager.getEvents();
- }
-
- /**
- * Provides direct access to the BeanManager.
- */
- public BeanManager getBeanManager()
- {
- return beanManager;
- }
-}
Copied: java-se/trunk/src/main/java/org/jboss/weld/environment/se/WeldContainer.java (from rev 6914, java-se/trunk/src/main/java/org/jboss/weld/environment/se/WeldContainer.java)
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/WeldContainer.java (rev 0)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/WeldContainer.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,80 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se;
+
+import javax.enterprise.event.Event;
+import javax.enterprise.inject.Instance;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.inject.Inject;
+
+import org.jboss.weld.environment.se.beans.InstanceManager;
+
+/**
+ * Provides convenient access to beans and events, particularly helpful when
+ * bootstrapping an application in Java SE.
+ * <p>
+ * An instance of this class can be obtained using the Weld class by calling:
+ * <code>
+ * WeldContainer weld = new Weld().initialize();
+ * </code>
+ * @see Weld
+ *
+ * @author Peter Royle
+ */
+public class WeldContainer
+{
+
+ private final InstanceManager instanceManager;
+ private final BeanManager beanManager;
+
+ @Inject
+ protected WeldContainer(InstanceManager instanceManager, BeanManager beanManager)
+ {
+ this.instanceManager = instanceManager;
+ this.beanManager = beanManager;
+ }
+
+ /**
+ * Provides access to all beans within the application. For example:
+ * <code>
+ * Foo foo = weld.instance().select(Foo.class).get();
+ * </code>
+ */
+ public Instance<Object> instance()
+ {
+ return instanceManager.getInstances();
+ }
+
+ /**
+ * Provides access to all events within the application. For example:
+ * <code>
+ * weld.event().select(Bar.class).fire(new Bar());
+ * </code>
+ */
+ public Event<Object> event()
+ {
+ return instanceManager.getEvents();
+ }
+
+ /**
+ * Provides direct access to the BeanManager.
+ */
+ public BeanManager getBeanManager()
+ {
+ return beanManager;
+ }
+}
Deleted: java-se/trunk/src/main/java/org/jboss/weld/environment/se/WeldSEBeanRegistrant.java
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/WeldSEBeanRegistrant.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/WeldSEBeanRegistrant.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,62 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se;
-
-import javax.enterprise.event.Observes;
-import javax.enterprise.inject.spi.AfterBeanDiscovery;
-import javax.enterprise.inject.spi.BeanManager;
-import javax.enterprise.inject.spi.BeforeBeanDiscovery;
-import javax.enterprise.inject.spi.Extension;
-
-import org.jboss.weld.context.api.BeanStore;
-import org.jboss.weld.context.beanstore.HashMapBeanStore;
-import org.jboss.weld.environment.se.beans.InstanceManager;
-import org.jboss.weld.environment.se.beans.ParametersFactory;
-import org.jboss.weld.environment.se.contexts.ThreadContext;
-import org.jboss.weld.environment.se.threading.RunnableDecorator;
-
-/**
- * Explicitly registers all of the 'built-in' Java SE related beans and contexts.
- * @author Peter Royle
- */
-public class WeldSEBeanRegistrant implements Extension
-{
-
- public static ThreadContext THREAD_CONTEXT = null;
-
- public void registerWeldSEBeans(@Observes BeforeBeanDiscovery event, BeanManager manager)
- {
- event.addAnnotatedType(manager.createAnnotatedType(ShutdownManager.class));
- event.addAnnotatedType(manager.createAnnotatedType(ParametersFactory.class));
- event.addAnnotatedType(manager.createAnnotatedType(InstanceManager.class));
- event.addAnnotatedType(manager.createAnnotatedType(RunnableDecorator.class));
- event.addAnnotatedType(manager.createAnnotatedType(WeldContainer.class));
- }
-
- public void registerWeldSEContexts(@Observes AfterBeanDiscovery event)
- {
- // set up this thread's bean store
- BeanStore beanStore = new HashMapBeanStore();
- final ThreadContext threadContext = new ThreadContext();
- threadContext.setBeanStore(beanStore);
-
- // activate and add context
- threadContext.setActive(true);
- event.addContext(threadContext);
- THREAD_CONTEXT = threadContext;
- }
-}
Copied: java-se/trunk/src/main/java/org/jboss/weld/environment/se/WeldSEBeanRegistrant.java (from rev 6914, java-se/trunk/src/main/java/org/jboss/weld/environment/se/WeldSEBeanRegistrant.java)
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/WeldSEBeanRegistrant.java (rev 0)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/WeldSEBeanRegistrant.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.AfterBeanDiscovery;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.BeforeBeanDiscovery;
+import javax.enterprise.inject.spi.Extension;
+
+import org.jboss.weld.context.api.BeanStore;
+import org.jboss.weld.context.beanstore.HashMapBeanStore;
+import org.jboss.weld.environment.se.beans.InstanceManager;
+import org.jboss.weld.environment.se.beans.ParametersFactory;
+import org.jboss.weld.environment.se.contexts.ThreadContext;
+import org.jboss.weld.environment.se.threading.RunnableDecorator;
+
+/**
+ * Explicitly registers all of the 'built-in' Java SE related beans and contexts.
+ * @author Peter Royle
+ */
+public class WeldSEBeanRegistrant implements Extension
+{
+
+ public static ThreadContext THREAD_CONTEXT = null;
+
+ public void registerWeldSEBeans(@Observes BeforeBeanDiscovery event, BeanManager manager)
+ {
+ event.addAnnotatedType(manager.createAnnotatedType(ShutdownManager.class));
+ event.addAnnotatedType(manager.createAnnotatedType(ParametersFactory.class));
+ event.addAnnotatedType(manager.createAnnotatedType(InstanceManager.class));
+ event.addAnnotatedType(manager.createAnnotatedType(RunnableDecorator.class));
+ event.addAnnotatedType(manager.createAnnotatedType(WeldContainer.class));
+ }
+
+ public void registerWeldSEContexts(@Observes AfterBeanDiscovery event)
+ {
+ // set up this thread's bean store
+ BeanStore beanStore = new HashMapBeanStore();
+ final ThreadContext threadContext = new ThreadContext();
+ threadContext.setBeanStore(beanStore);
+
+ // activate and add context
+ threadContext.setActive(true);
+ event.addContext(threadContext);
+ THREAD_CONTEXT = threadContext;
+ }
+}
Copied: java-se/trunk/src/main/java/org/jboss/weld/environment/se/beans (from rev 6914, java-se/trunk/src/main/java/org/jboss/weld/environment/se/beans)
Deleted: java-se/trunk/src/main/java/org/jboss/weld/environment/se/beans/InstanceManager.java
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/beans/InstanceManager.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/beans/InstanceManager.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,52 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se.beans;
-
-import javax.enterprise.event.Event;
-import javax.enterprise.inject.Instance;
-import javax.inject.Inject;
-
-import org.jboss.weld.environment.se.WeldContainer;
-
-/**
- * A managed bean which holds all of the injected instances of managed beans and
- * events. It is primarily used as a delegate for the {@link WeldContainer} class's instance()
- * and event() methods.
- *
- * @see WeldContainer
- * @author Peter Royle
- */
-public class InstanceManager
-{
-
- @Inject Instance<Object> instances;
- @Inject Event<Object> events;
-
- public InstanceManager()
- {
- }
-
- public Instance<Object> getInstances()
- {
- return instances;
- }
-
- public Event<Object> getEvents()
- {
- return events;
- }
-}
Copied: java-se/trunk/src/main/java/org/jboss/weld/environment/se/beans/InstanceManager.java (from rev 6914, java-se/trunk/src/main/java/org/jboss/weld/environment/se/beans/InstanceManager.java)
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/beans/InstanceManager.java (rev 0)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/beans/InstanceManager.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,52 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se.beans;
+
+import javax.enterprise.event.Event;
+import javax.enterprise.inject.Instance;
+import javax.inject.Inject;
+
+import org.jboss.weld.environment.se.WeldContainer;
+
+/**
+ * A managed bean which holds all of the injected instances of managed beans and
+ * events. It is primarily used as a delegate for the {@link WeldContainer} class's instance()
+ * and event() methods.
+ *
+ * @see WeldContainer
+ * @author Peter Royle
+ */
+public class InstanceManager
+{
+
+ @Inject Instance<Object> instances;
+ @Inject Event<Object> events;
+
+ public InstanceManager()
+ {
+ }
+
+ public Instance<Object> getInstances()
+ {
+ return instances;
+ }
+
+ public Event<Object> getEvents()
+ {
+ return events;
+ }
+}
Deleted: java-se/trunk/src/main/java/org/jboss/weld/environment/se/beans/ParametersFactory.java
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/beans/ParametersFactory.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/beans/ParametersFactory.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,88 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se.beans;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.enterprise.inject.Produces;
-
-import org.jboss.weld.environment.se.StartMain;
-import org.jboss.weld.environment.se.bindings.Parameters;
-
-/**
- * The simple bean that will hold the command line arguments and make them
- * available by injection (using the @Parameters binding). It's initialised by
- * the StartMain class before your main app is initialised.
- *
- * @author Peter Royle
- */
- at ApplicationScoped
-public class ParametersFactory
-{
- private String[] args;
- private List<String> argsList;
-
- public ParametersFactory()
- {
- this.setArgs(StartMain.PARAMETERS);
- }
-
- /**
- * Producer method for the injectable command line args.
- *
- * @return The command line arguments.
- */
- @Produces
- @Parameters
- public List<String> getArgs()
- {
- return argsList;
- }
-
- /**
- * Producer method for the injectable command line args.
- *
- * @return The command line arguments.
- */
- @Produces
- @Parameters
- public String[] getArgsAsArray()
- {
- return this.args;
- }
-
- /**
- * StartMain passes in the command line args here.
- *
- * @param args The command line arguments. If null is given then an empty
- * array will be used instead.
- */
- public void setArgs(String[] args)
- {
- if (args == null)
- {
- args = new String[] {};
- }
- this.args = args;
- this.argsList = Collections.unmodifiableList(new ArrayList<String>(Arrays.asList(args)));
- }
-
-}
Copied: java-se/trunk/src/main/java/org/jboss/weld/environment/se/beans/ParametersFactory.java (from rev 6914, java-se/trunk/src/main/java/org/jboss/weld/environment/se/beans/ParametersFactory.java)
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/beans/ParametersFactory.java (rev 0)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/beans/ParametersFactory.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,88 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se.beans;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Produces;
+
+import org.jboss.weld.environment.se.StartMain;
+import org.jboss.weld.environment.se.bindings.Parameters;
+
+/**
+ * The simple bean that will hold the command line arguments and make them
+ * available by injection (using the @Parameters binding). It's initialised by
+ * the StartMain class before your main app is initialised.
+ *
+ * @author Peter Royle
+ */
+ at ApplicationScoped
+public class ParametersFactory
+{
+ private String[] args;
+ private List<String> argsList;
+
+ public ParametersFactory()
+ {
+ this.setArgs(StartMain.PARAMETERS);
+ }
+
+ /**
+ * Producer method for the injectable command line args.
+ *
+ * @return The command line arguments.
+ */
+ @Produces
+ @Parameters
+ public List<String> getArgs()
+ {
+ return argsList;
+ }
+
+ /**
+ * Producer method for the injectable command line args.
+ *
+ * @return The command line arguments.
+ */
+ @Produces
+ @Parameters
+ public String[] getArgsAsArray()
+ {
+ return this.args;
+ }
+
+ /**
+ * StartMain passes in the command line args here.
+ *
+ * @param args The command line arguments. If null is given then an empty
+ * array will be used instead.
+ */
+ public void setArgs(String[] args)
+ {
+ if (args == null)
+ {
+ args = new String[] {};
+ }
+ this.args = args;
+ this.argsList = Collections.unmodifiableList(new ArrayList<String>(Arrays.asList(args)));
+ }
+
+}
Copied: java-se/trunk/src/main/java/org/jboss/weld/environment/se/bindings (from rev 6914, java-se/trunk/src/main/java/org/jboss/weld/environment/se/bindings)
Deleted: java-se/trunk/src/main/java/org/jboss/weld/environment/se/bindings/Parameters.java
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/bindings/Parameters.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/bindings/Parameters.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,37 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se.bindings;
-
-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.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import javax.inject.Qualifier;
-
-/**
- *
- * @author Peter Royle
- */
- at Qualifier
- at Retention(RUNTIME)
- at Target({ PARAMETER, METHOD, FIELD, TYPE })
-public @interface Parameters {}
Copied: java-se/trunk/src/main/java/org/jboss/weld/environment/se/bindings/Parameters.java (from rev 6914, java-se/trunk/src/main/java/org/jboss/weld/environment/se/bindings/Parameters.java)
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/bindings/Parameters.java (rev 0)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/bindings/Parameters.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se.bindings;
+
+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.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+/**
+ *
+ * @author Peter Royle
+ */
+ at Qualifier
+ at Retention(RUNTIME)
+ at Target({ PARAMETER, METHOD, FIELD, TYPE })
+public @interface Parameters {}
Copied: java-se/trunk/src/main/java/org/jboss/weld/environment/se/contexts (from rev 6914, java-se/trunk/src/main/java/org/jboss/weld/environment/se/contexts)
Deleted: java-se/trunk/src/main/java/org/jboss/weld/environment/se/contexts/ThreadContext.java
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/contexts/ThreadContext.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/contexts/ThreadContext.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,59 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- *
- * Use is subject to license terms.
- *
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se.contexts;
-
-import org.jboss.weld.context.AbstractThreadLocalMapContext;
-
-/**
- * The thread context. Works with @ThreadScoped beans, maintaining a separate
- * context for each thread.
- *
- * @author Nicklas Karlsson
- * @author Peter Royle
- */
-public class ThreadContext extends AbstractThreadLocalMapContext
-{
-
- /**
- * Constructor
- */
- public ThreadContext()
- {
- super(ThreadScoped.class);
- }
-
- @Override
- public String toString()
- {
- String active = isActive() ? "Active " : "Inactive ";
- String beanStoreInfo = getBeanStore() == null ? "" : getBeanStore().toString();
- return active + "thread context " + beanStoreInfo;
- }
-
- @Override
- protected boolean isCreationLockRequired()
- {
- return false;
- }
-
-}
Copied: java-se/trunk/src/main/java/org/jboss/weld/environment/se/contexts/ThreadContext.java (from rev 6914, java-se/trunk/src/main/java/org/jboss/weld/environment/se/contexts/ThreadContext.java)
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/contexts/ThreadContext.java (rev 0)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/contexts/ThreadContext.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,59 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * Use is subject to license terms.
+ *
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se.contexts;
+
+import org.jboss.weld.context.AbstractThreadLocalMapContext;
+
+/**
+ * The thread context. Works with @ThreadScoped beans, maintaining a separate
+ * context for each thread.
+ *
+ * @author Nicklas Karlsson
+ * @author Peter Royle
+ */
+public class ThreadContext extends AbstractThreadLocalMapContext
+{
+
+ /**
+ * Constructor
+ */
+ public ThreadContext()
+ {
+ super(ThreadScoped.class);
+ }
+
+ @Override
+ public String toString()
+ {
+ String active = isActive() ? "Active " : "Inactive ";
+ String beanStoreInfo = getBeanStore() == null ? "" : getBeanStore().toString();
+ return active + "thread context " + beanStoreInfo;
+ }
+
+ @Override
+ protected boolean isCreationLockRequired()
+ {
+ return false;
+ }
+
+}
Deleted: java-se/trunk/src/main/java/org/jboss/weld/environment/se/contexts/ThreadScoped.java
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/contexts/ThreadScoped.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/contexts/ThreadScoped.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,41 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-* http://www.apache.org/licenses/LICENSE-2.0
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-package org.jboss.weld.environment.se.contexts;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-import javax.enterprise.context.NormalScope;
-
-/**
- * Used to represent that a managed bean is scoped to the current thread.
- * @author Peter Royle
- */
- at Target( { TYPE, METHOD, FIELD })
- at Retention(RUNTIME)
- at Documented
- at NormalScope
- at Inherited
-public @interface ThreadScoped
-{
-}
Copied: java-se/trunk/src/main/java/org/jboss/weld/environment/se/contexts/ThreadScoped.java (from rev 6914, java-se/trunk/src/main/java/org/jboss/weld/environment/se/contexts/ThreadScoped.java)
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/contexts/ThreadScoped.java (rev 0)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/contexts/ThreadScoped.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.jboss.weld.environment.se.contexts;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import javax.enterprise.context.NormalScope;
+
+/**
+ * Used to represent that a managed bean is scoped to the current thread.
+ * @author Peter Royle
+ */
+ at Target( { TYPE, METHOD, FIELD })
+ at Retention(RUNTIME)
+ at Documented
+ at NormalScope
+ at Inherited
+public @interface ThreadScoped
+{
+}
Copied: java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery (from rev 6914, java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery)
Deleted: java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/AbstractWeldSEBeanDeploymentArchive.java
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/AbstractWeldSEBeanDeploymentArchive.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/AbstractWeldSEBeanDeploymentArchive.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,51 +0,0 @@
-package org.jboss.weld.environment.se.discovery;
-
-import java.util.Collection;
-import java.util.Collections;
-
-import org.jboss.weld.bootstrap.api.ServiceRegistry;
-import org.jboss.weld.bootstrap.api.helpers.SimpleServiceRegistry;
-import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
-import org.jboss.weld.ejb.spi.EjbDescriptor;
-
-/**
- * Implements the basic requirements of a {@link BeanDeploymentArchive} (bean
- * archive id and service registry).
- *
- * Suitable for extension by those who need to build custom
- * {@link BeanDeploymentArchive} implementations.
- *
- * @see MutableBeanDeploymentArchive
- * @see ImmutableBeanDeploymentArchive
- *
- * @author Pete Muir
- *
- */
-public abstract class AbstractWeldSEBeanDeploymentArchive implements BeanDeploymentArchive
-{
-
- private final ServiceRegistry serviceRegistry;
- private final String id;
-
- public AbstractWeldSEBeanDeploymentArchive(String id)
- {
- this.id = id;
- this.serviceRegistry = new SimpleServiceRegistry();
- }
-
- public Collection<EjbDescriptor<?>> getEjbs()
- {
- return Collections.emptyList();
- }
-
- public String getId()
- {
- return id;
- }
-
- public ServiceRegistry getServices()
- {
- return serviceRegistry;
- }
-
-}
\ No newline at end of file
Copied: java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/AbstractWeldSEBeanDeploymentArchive.java (from rev 6914, java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/AbstractWeldSEBeanDeploymentArchive.java)
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/AbstractWeldSEBeanDeploymentArchive.java (rev 0)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/AbstractWeldSEBeanDeploymentArchive.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,51 @@
+package org.jboss.weld.environment.se.discovery;
+
+import java.util.Collection;
+import java.util.Collections;
+
+import org.jboss.weld.bootstrap.api.ServiceRegistry;
+import org.jboss.weld.bootstrap.api.helpers.SimpleServiceRegistry;
+import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.weld.ejb.spi.EjbDescriptor;
+
+/**
+ * Implements the basic requirements of a {@link BeanDeploymentArchive} (bean
+ * archive id and service registry).
+ *
+ * Suitable for extension by those who need to build custom
+ * {@link BeanDeploymentArchive} implementations.
+ *
+ * @see MutableBeanDeploymentArchive
+ * @see ImmutableBeanDeploymentArchive
+ *
+ * @author Pete Muir
+ *
+ */
+public abstract class AbstractWeldSEBeanDeploymentArchive implements BeanDeploymentArchive
+{
+
+ private final ServiceRegistry serviceRegistry;
+ private final String id;
+
+ public AbstractWeldSEBeanDeploymentArchive(String id)
+ {
+ this.id = id;
+ this.serviceRegistry = new SimpleServiceRegistry();
+ }
+
+ public Collection<EjbDescriptor<?>> getEjbs()
+ {
+ return Collections.emptyList();
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public ServiceRegistry getServices()
+ {
+ return serviceRegistry;
+ }
+
+}
\ No newline at end of file
Deleted: java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/AbstractWeldSEDeployment.java
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/AbstractWeldSEDeployment.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/AbstractWeldSEDeployment.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,34 +0,0 @@
-package org.jboss.weld.environment.se.discovery;
-
-import org.jboss.weld.bootstrap.api.ServiceRegistry;
-import org.jboss.weld.bootstrap.api.helpers.SimpleServiceRegistry;
-import org.jboss.weld.bootstrap.spi.Deployment;
-
-/**
- * Implements the basic requirements of a {@link Deployment}. Provides a service
- * registry.
- *
- * Suitable for extension by those who need to build custom {@link Deployment}
- * implementations.
- *
- * @author Pete Muir
- *
- */
-public abstract class AbstractWeldSEDeployment implements Deployment
-{
-
- public static final String[] RESOURCES = { "META-INF/beans.xml" };
-
- private final ServiceRegistry serviceRegistry;
-
- public AbstractWeldSEDeployment()
- {
- this.serviceRegistry = new SimpleServiceRegistry();
- }
-
- public ServiceRegistry getServices()
- {
- return serviceRegistry;
- }
-
-}
\ No newline at end of file
Copied: java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/AbstractWeldSEDeployment.java (from rev 6914, java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/AbstractWeldSEDeployment.java)
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/AbstractWeldSEDeployment.java (rev 0)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/AbstractWeldSEDeployment.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,34 @@
+package org.jboss.weld.environment.se.discovery;
+
+import org.jboss.weld.bootstrap.api.ServiceRegistry;
+import org.jboss.weld.bootstrap.api.helpers.SimpleServiceRegistry;
+import org.jboss.weld.bootstrap.spi.Deployment;
+
+/**
+ * Implements the basic requirements of a {@link Deployment}. Provides a service
+ * registry.
+ *
+ * Suitable for extension by those who need to build custom {@link Deployment}
+ * implementations.
+ *
+ * @author Pete Muir
+ *
+ */
+public abstract class AbstractWeldSEDeployment implements Deployment
+{
+
+ public static final String[] RESOURCES = { "META-INF/beans.xml" };
+
+ private final ServiceRegistry serviceRegistry;
+
+ public AbstractWeldSEDeployment()
+ {
+ this.serviceRegistry = new SimpleServiceRegistry();
+ }
+
+ public ServiceRegistry getServices()
+ {
+ return serviceRegistry;
+ }
+
+}
\ No newline at end of file
Deleted: java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/ImmutableBeanDeploymentArchive.java
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/ImmutableBeanDeploymentArchive.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/ImmutableBeanDeploymentArchive.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,75 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se.discovery;
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-
-import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
-import org.jboss.weld.bootstrap.spi.Deployment;
-
-/**
- * An immutable implementation of {@link BeanDeploymentArchive} which must have
- * classes and beans.xml resources added to it via
- * {@link ImmutableBeanDeploymentArchive#ImmutableBeanDeploymentArchive(String, Collection, Collection, List)}
- * or
- * {@link ImmutableBeanDeploymentArchive#ImmutableBeanDeploymentArchive(String, Collection, Collection)}
- *
- * See {@link Deployment} for more detailed information on creating deployment
- * structures.
- *
- * @author Pete Muir
- *
- */
-public class ImmutableBeanDeploymentArchive extends AbstractWeldSEBeanDeploymentArchive
-{
-
- private final Collection<Class<?>> beanClasses;
- private final Collection<URL> beansXml;
- private final Collection<BeanDeploymentArchive> beanDeploymentArchives;
-
- public ImmutableBeanDeploymentArchive(String id, Collection<Class<?>> beanClasses, Collection<URL> beansXml, Collection<BeanDeploymentArchive> beanDeploymentArchives)
- {
- super(id);
- this.beanClasses = beanClasses;
- this.beansXml = beansXml;
- this.beanDeploymentArchives = beanDeploymentArchives;
- }
-
- public ImmutableBeanDeploymentArchive(String id, Collection<Class<?>> beanClasses, Collection<URL> beansXml)
- {
- this(id, beanClasses, beansXml, new ArrayList<BeanDeploymentArchive>());
- }
-
- public Collection<Class<?>> getBeanClasses()
- {
- return Collections.unmodifiableCollection(beanClasses);
- }
-
- public Collection<BeanDeploymentArchive> getBeanDeploymentArchives()
- {
- return Collections.unmodifiableCollection(beanDeploymentArchives);
- }
-
- public Collection<URL> getBeansXml()
- {
- return Collections.unmodifiableCollection(beansXml);
- }
-}
Copied: java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/ImmutableBeanDeploymentArchive.java (from rev 6914, java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/ImmutableBeanDeploymentArchive.java)
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/ImmutableBeanDeploymentArchive.java (rev 0)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/ImmutableBeanDeploymentArchive.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,75 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se.discovery;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.weld.bootstrap.spi.Deployment;
+
+/**
+ * An immutable implementation of {@link BeanDeploymentArchive} which must have
+ * classes and beans.xml resources added to it via
+ * {@link ImmutableBeanDeploymentArchive#ImmutableBeanDeploymentArchive(String, Collection, Collection, List)}
+ * or
+ * {@link ImmutableBeanDeploymentArchive#ImmutableBeanDeploymentArchive(String, Collection, Collection)}
+ *
+ * See {@link Deployment} for more detailed information on creating deployment
+ * structures.
+ *
+ * @author Pete Muir
+ *
+ */
+public class ImmutableBeanDeploymentArchive extends AbstractWeldSEBeanDeploymentArchive
+{
+
+ private final Collection<Class<?>> beanClasses;
+ private final Collection<URL> beansXml;
+ private final Collection<BeanDeploymentArchive> beanDeploymentArchives;
+
+ public ImmutableBeanDeploymentArchive(String id, Collection<Class<?>> beanClasses, Collection<URL> beansXml, Collection<BeanDeploymentArchive> beanDeploymentArchives)
+ {
+ super(id);
+ this.beanClasses = beanClasses;
+ this.beansXml = beansXml;
+ this.beanDeploymentArchives = beanDeploymentArchives;
+ }
+
+ public ImmutableBeanDeploymentArchive(String id, Collection<Class<?>> beanClasses, Collection<URL> beansXml)
+ {
+ this(id, beanClasses, beansXml, new ArrayList<BeanDeploymentArchive>());
+ }
+
+ public Collection<Class<?>> getBeanClasses()
+ {
+ return Collections.unmodifiableCollection(beanClasses);
+ }
+
+ public Collection<BeanDeploymentArchive> getBeanDeploymentArchives()
+ {
+ return Collections.unmodifiableCollection(beanDeploymentArchives);
+ }
+
+ public Collection<URL> getBeansXml()
+ {
+ return Collections.unmodifiableCollection(beansXml);
+ }
+}
Deleted: java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/MutableBeanDeploymentArchive.java
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/MutableBeanDeploymentArchive.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/MutableBeanDeploymentArchive.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,71 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se.discovery;
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-
-import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
-import org.jboss.weld.bootstrap.spi.Deployment;
-
-/**
- * A mutable implementation of {@link BeanDeploymentArchive} which can have
- * classes and beans.xml resources added to it by calling
- * <code>getBeanClasses.add()</code> and <code>getBeansXml().add()</code>
- * respectively.
- *
- * If you are building a complex deployment structure, you can also associate
- * accessible {@link BeanDeploymentArchive}s by calling
- * <code>getBeanDeploymentArchives().add()</code>. See {@link Deployment} for
- * more detailed information on creating deployment structures.
- *
- * @author Pete Muir
- *
- */
-public class MutableBeanDeploymentArchive extends AbstractWeldSEBeanDeploymentArchive
-{
-
- private final Collection<Class<?>> beanClasses;
- private final Collection<URL> beansXml;
- private final List<BeanDeploymentArchive> beanDeploymentArchives;
-
- public MutableBeanDeploymentArchive(String id)
- {
- super(id);
- this.beanClasses = new HashSet<Class<?>>();
- this.beansXml = new HashSet<URL>();
- this.beanDeploymentArchives = new ArrayList<BeanDeploymentArchive>();
- }
-
- public Collection<Class<?>> getBeanClasses()
- {
- return beanClasses;
- }
-
- public Collection<BeanDeploymentArchive> getBeanDeploymentArchives()
- {
- return beanDeploymentArchives;
- }
-
- public Collection<URL> getBeansXml()
- {
- return beansXml;
- }
-}
Copied: java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/MutableBeanDeploymentArchive.java (from rev 6914, java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/MutableBeanDeploymentArchive.java)
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/MutableBeanDeploymentArchive.java (rev 0)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/MutableBeanDeploymentArchive.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,71 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se.discovery;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+
+import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.weld.bootstrap.spi.Deployment;
+
+/**
+ * A mutable implementation of {@link BeanDeploymentArchive} which can have
+ * classes and beans.xml resources added to it by calling
+ * <code>getBeanClasses.add()</code> and <code>getBeansXml().add()</code>
+ * respectively.
+ *
+ * If you are building a complex deployment structure, you can also associate
+ * accessible {@link BeanDeploymentArchive}s by calling
+ * <code>getBeanDeploymentArchives().add()</code>. See {@link Deployment} for
+ * more detailed information on creating deployment structures.
+ *
+ * @author Pete Muir
+ *
+ */
+public class MutableBeanDeploymentArchive extends AbstractWeldSEBeanDeploymentArchive
+{
+
+ private final Collection<Class<?>> beanClasses;
+ private final Collection<URL> beansXml;
+ private final List<BeanDeploymentArchive> beanDeploymentArchives;
+
+ public MutableBeanDeploymentArchive(String id)
+ {
+ super(id);
+ this.beanClasses = new HashSet<Class<?>>();
+ this.beansXml = new HashSet<URL>();
+ this.beanDeploymentArchives = new ArrayList<BeanDeploymentArchive>();
+ }
+
+ public Collection<Class<?>> getBeanClasses()
+ {
+ return beanClasses;
+ }
+
+ public Collection<BeanDeploymentArchive> getBeanDeploymentArchives()
+ {
+ return beanDeploymentArchives;
+ }
+
+ public Collection<URL> getBeansXml()
+ {
+ return beansXml;
+ }
+}
Copied: java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url (from rev 6914, java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url)
Deleted: java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/ClasspathScanningException.java
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/ClasspathScanningException.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/ClasspathScanningException.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,38 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se.discovery.url;
-
-/**
- * @author Peter Royle
- */
-public class ClasspathScanningException extends RuntimeException {
-
- /**
- * Creates a new instance of <code>ClasspathScanningException</code> without detail message.
- */
- public ClasspathScanningException() {
- }
-
-
- /**
- * Constructs an instance of <code>ClasspathScanningException</code> with the specified detail message.
- * @param msg the detail message.
- */
- public ClasspathScanningException(String msg) {
- super(msg);
- }
-}
Copied: java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/ClasspathScanningException.java (from rev 6914, java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/ClasspathScanningException.java)
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/ClasspathScanningException.java (rev 0)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/ClasspathScanningException.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,38 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se.discovery.url;
+
+/**
+ * @author Peter Royle
+ */
+public class ClasspathScanningException extends RuntimeException {
+
+ /**
+ * Creates a new instance of <code>ClasspathScanningException</code> without detail message.
+ */
+ public ClasspathScanningException() {
+ }
+
+
+ /**
+ * Constructs an instance of <code>ClasspathScanningException</code> with the specified detail message.
+ * @param msg the detail message.
+ */
+ public ClasspathScanningException(String msg) {
+ super(msg);
+ }
+}
Deleted: java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/FileSystemURLHandler.java
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/FileSystemURLHandler.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/FileSystemURLHandler.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,189 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se.discovery.url;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipException;
-import java.util.zip.ZipFile;
-
-import org.jboss.weld.environment.se.discovery.MutableBeanDeploymentArchive;
-import org.jboss.weld.resources.spi.ResourceLoader;
-import org.jboss.weld.resources.spi.ResourceLoadingException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * This class provides file-system orientated scanning
- *
- * @author Pete Muir
- *
- */
-public class FileSystemURLHandler
-{
-
- private static final Logger log = LoggerFactory.getLogger(FileSystemURLHandler.class);
- private final ResourceLoader resourceLoader;
-
- public FileSystemURLHandler(ResourceLoader resourceLoader)
- {
- this.resourceLoader = resourceLoader;
- }
-
- public void handle(Collection<String> paths, MutableBeanDeploymentArchive beanDeploymentArchive)
- {
- for (String urlPath : paths)
- {
- try
- {
- FileSystemURLHandler.log.trace("scanning: " + urlPath);
-
- if (urlPath.startsWith("file:"))
- {
- urlPath = urlPath.substring(5);
- }
- if (urlPath.indexOf('!') > 0)
- {
- urlPath = urlPath.substring(0, urlPath.indexOf('!'));
- }
-
- File file = new File(urlPath);
- if (file.isDirectory())
- {
- handleDirectory(file, null, beanDeploymentArchive);
- }
- else
- {
- handleArchiveByFile(file, beanDeploymentArchive);
- }
- }
- catch (IOException ioe)
- {
- FileSystemURLHandler.log.warn("could not read entries", ioe);
- }
- }
- }
-
- private void handleArchiveByFile(File file, MutableBeanDeploymentArchive beanDeploymentArchive) throws IOException
- {
- try
- {
- log.trace("archive: " + file);
-
- String archiveUrl = "jar:" + file.toURI().toURL().toExternalForm() + "!/";
- ZipFile zip = new ZipFile(file);
- Enumeration<? extends ZipEntry> entries = zip.entries();
-
- while (entries.hasMoreElements())
- {
- ZipEntry entry = entries.nextElement();
- String name = entry.getName();
- handle(name, new URL(archiveUrl + name), beanDeploymentArchive);
- }
- }
- catch (ZipException e)
- {
- throw new RuntimeException("Error handling file " + file, e);
- }
- }
-
- protected void handleDirectory(File file, String path, MutableBeanDeploymentArchive beanDeploymentArchive)
- {
- handleDirectory(file, path, new File[0], beanDeploymentArchive);
- }
-
- private void handleDirectory(File file, String path, File[] excludedDirectories, MutableBeanDeploymentArchive beanDeploymentArchive)
- {
- for (File excludedDirectory : excludedDirectories)
- {
- if (file.equals(excludedDirectory))
- {
- log.trace("skipping excluded directory: " + file);
-
- return;
- }
- }
-
- log.trace("handling directory: " + file);
-
- for (File child : file.listFiles())
- {
- String newPath = (path == null) ? child.getName() : (path + '/' + child.getName());
-
- if (child.isDirectory())
- {
- handleDirectory(child, newPath, excludedDirectories, beanDeploymentArchive);
- }
- else
- {
- try
- {
- handle(newPath, child.toURI().toURL(), beanDeploymentArchive);
- }
- catch (MalformedURLException e)
- {
- log.error("Error loading file " + newPath);
- }
- }
- }
- }
-
- protected void handle(String name, URL url, MutableBeanDeploymentArchive beanDeploymentArchive)
- {
- if (name.endsWith(".class"))
- {
- String className = filenameToClassname(name);
- try
- {
- beanDeploymentArchive.getBeanClasses().add(getResourceLoader().classForName(className));
- }
- catch (NoClassDefFoundError e)
- {
- log.error("Error loading " + name, e);
- }
- catch(ResourceLoadingException e)
- {
- log.error("Error loading " + name, e);
- }
- }
- else if (name.endsWith("beans.xml"))
- {
- beanDeploymentArchive.getBeansXml().add(url);
- }
- }
-
- /**
- * @return the resourceLoader
- */
- public ResourceLoader getResourceLoader()
- {
- return resourceLoader;
- }
-
- /**
- * Convert a path to a class file to a class name
- */
- public static String filenameToClassname(String filename)
- {
- return filename.substring(0, filename.lastIndexOf(".class")).replace('/', '.').replace('\\', '.');
- }
-}
Copied: java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/FileSystemURLHandler.java (from rev 6914, java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/FileSystemURLHandler.java)
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/FileSystemURLHandler.java (rev 0)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/FileSystemURLHandler.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,189 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se.discovery.url;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipException;
+import java.util.zip.ZipFile;
+
+import org.jboss.weld.environment.se.discovery.MutableBeanDeploymentArchive;
+import org.jboss.weld.resources.spi.ResourceLoader;
+import org.jboss.weld.resources.spi.ResourceLoadingException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This class provides file-system orientated scanning
+ *
+ * @author Pete Muir
+ *
+ */
+public class FileSystemURLHandler
+{
+
+ private static final Logger log = LoggerFactory.getLogger(FileSystemURLHandler.class);
+ private final ResourceLoader resourceLoader;
+
+ public FileSystemURLHandler(ResourceLoader resourceLoader)
+ {
+ this.resourceLoader = resourceLoader;
+ }
+
+ public void handle(Collection<String> paths, MutableBeanDeploymentArchive beanDeploymentArchive)
+ {
+ for (String urlPath : paths)
+ {
+ try
+ {
+ FileSystemURLHandler.log.trace("scanning: " + urlPath);
+
+ if (urlPath.startsWith("file:"))
+ {
+ urlPath = urlPath.substring(5);
+ }
+ if (urlPath.indexOf('!') > 0)
+ {
+ urlPath = urlPath.substring(0, urlPath.indexOf('!'));
+ }
+
+ File file = new File(urlPath);
+ if (file.isDirectory())
+ {
+ handleDirectory(file, null, beanDeploymentArchive);
+ }
+ else
+ {
+ handleArchiveByFile(file, beanDeploymentArchive);
+ }
+ }
+ catch (IOException ioe)
+ {
+ FileSystemURLHandler.log.warn("could not read entries", ioe);
+ }
+ }
+ }
+
+ private void handleArchiveByFile(File file, MutableBeanDeploymentArchive beanDeploymentArchive) throws IOException
+ {
+ try
+ {
+ log.trace("archive: " + file);
+
+ String archiveUrl = "jar:" + file.toURI().toURL().toExternalForm() + "!/";
+ ZipFile zip = new ZipFile(file);
+ Enumeration<? extends ZipEntry> entries = zip.entries();
+
+ while (entries.hasMoreElements())
+ {
+ ZipEntry entry = entries.nextElement();
+ String name = entry.getName();
+ handle(name, new URL(archiveUrl + name), beanDeploymentArchive);
+ }
+ }
+ catch (ZipException e)
+ {
+ throw new RuntimeException("Error handling file " + file, e);
+ }
+ }
+
+ protected void handleDirectory(File file, String path, MutableBeanDeploymentArchive beanDeploymentArchive)
+ {
+ handleDirectory(file, path, new File[0], beanDeploymentArchive);
+ }
+
+ private void handleDirectory(File file, String path, File[] excludedDirectories, MutableBeanDeploymentArchive beanDeploymentArchive)
+ {
+ for (File excludedDirectory : excludedDirectories)
+ {
+ if (file.equals(excludedDirectory))
+ {
+ log.trace("skipping excluded directory: " + file);
+
+ return;
+ }
+ }
+
+ log.trace("handling directory: " + file);
+
+ for (File child : file.listFiles())
+ {
+ String newPath = (path == null) ? child.getName() : (path + '/' + child.getName());
+
+ if (child.isDirectory())
+ {
+ handleDirectory(child, newPath, excludedDirectories, beanDeploymentArchive);
+ }
+ else
+ {
+ try
+ {
+ handle(newPath, child.toURI().toURL(), beanDeploymentArchive);
+ }
+ catch (MalformedURLException e)
+ {
+ log.error("Error loading file " + newPath);
+ }
+ }
+ }
+ }
+
+ protected void handle(String name, URL url, MutableBeanDeploymentArchive beanDeploymentArchive)
+ {
+ if (name.endsWith(".class"))
+ {
+ String className = filenameToClassname(name);
+ try
+ {
+ beanDeploymentArchive.getBeanClasses().add(getResourceLoader().classForName(className));
+ }
+ catch (NoClassDefFoundError e)
+ {
+ log.error("Error loading " + name, e);
+ }
+ catch(ResourceLoadingException e)
+ {
+ log.error("Error loading " + name, e);
+ }
+ }
+ else if (name.endsWith("beans.xml"))
+ {
+ beanDeploymentArchive.getBeansXml().add(url);
+ }
+ }
+
+ /**
+ * @return the resourceLoader
+ */
+ public ResourceLoader getResourceLoader()
+ {
+ return resourceLoader;
+ }
+
+ /**
+ * Convert a path to a class file to a class name
+ */
+ public static String filenameToClassname(String filename)
+ {
+ return filename.substring(0, filename.lastIndexOf(".class")).replace('/', '.').replace('\\', '.');
+ }
+}
Deleted: java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/URLScanner.java
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/URLScanner.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/URLScanner.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,118 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se.discovery.url;
-
-import java.io.File;
-import java.io.UnsupportedEncodingException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.net.URLDecoder;
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
-import org.jboss.weld.environment.se.discovery.MutableBeanDeploymentArchive;
-import org.jboss.weld.resources.spi.ResourceLoader;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Implementation of {@link Scanner} which can scan a {@link URLClassLoader}
- *
- * @author Thomas Heute
- * @author Gavin King
- * @author Norman Richards
- * @author Pete Muir
- * @author Peter Royle
- *
- */
-public class URLScanner
-{
-
- private static final Logger log = LoggerFactory.getLogger(URLScanner.class);
- private final String[] resources;
- private final ResourceLoader resourceLoader;
-
- public URLScanner(ResourceLoader resourceLoader, String... resources)
- {
- this.resources = resources;
- this.resourceLoader = resourceLoader;
- }
-
- public BeanDeploymentArchive scan()
- {
- FileSystemURLHandler handler = new FileSystemURLHandler(resourceLoader);
- MutableBeanDeploymentArchive beanDeploymentArchive = new MutableBeanDeploymentArchive("classpath");
- Collection<String> paths = new ArrayList<String>();
- for (String resourceName : resources)
- {
- // grab all the URLs for this resource
- Collection<URL> urlEnum = resourceLoader.getResources(resourceName);
- for (URL url : urlEnum)
- {
-
- String urlPath = url.toExternalForm();
-
- // determin resource type (eg: jar, file, bundle)
- String urlType = "file";
- int colonIndex = urlPath.indexOf(":");
- if (colonIndex != -1)
- {
- urlType = urlPath.substring(0, colonIndex);
- }
-
- // Extra built-in support for simple file-based resources
- if ("file".equals(urlType) || "jar".equals(urlType))
- {
- // switch to using getPath() instead of toExternalForm()
- urlPath = url.getPath();
-
- if (urlPath.indexOf('!') > 0)
- {
- urlPath = urlPath.substring(0, urlPath.indexOf('!'));
- }
- else
- {
- // hack for /META-INF/beans.xml
- File dirOrArchive = new File(urlPath);
- if ((resourceName != null) && (resourceName.lastIndexOf('/') > 0))
- {
- dirOrArchive = dirOrArchive.getParentFile();
- }
- urlPath = dirOrArchive.getParent();
- }
- }
-
- try
- {
- urlPath = URLDecoder.decode(urlPath, "UTF-8");
- }
- catch (UnsupportedEncodingException ex)
- {
- throw new ClasspathScanningException("Error decoding URL using UTF-8");
- }
-
- log.debug("URL Type: " + urlType);
-
- paths.add(urlPath);
- }
- handler.handle(paths, beanDeploymentArchive);
- }
- return beanDeploymentArchive;
- }
-
-}
Copied: java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/URLScanner.java (from rev 6914, java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/URLScanner.java)
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/URLScanner.java (rev 0)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/URLScanner.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,118 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se.discovery.url;
+
+import java.io.File;
+import java.io.UnsupportedEncodingException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.net.URLDecoder;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.weld.environment.se.discovery.MutableBeanDeploymentArchive;
+import org.jboss.weld.resources.spi.ResourceLoader;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Implementation of {@link Scanner} which can scan a {@link URLClassLoader}
+ *
+ * @author Thomas Heute
+ * @author Gavin King
+ * @author Norman Richards
+ * @author Pete Muir
+ * @author Peter Royle
+ *
+ */
+public class URLScanner
+{
+
+ private static final Logger log = LoggerFactory.getLogger(URLScanner.class);
+ private final String[] resources;
+ private final ResourceLoader resourceLoader;
+
+ public URLScanner(ResourceLoader resourceLoader, String... resources)
+ {
+ this.resources = resources;
+ this.resourceLoader = resourceLoader;
+ }
+
+ public BeanDeploymentArchive scan()
+ {
+ FileSystemURLHandler handler = new FileSystemURLHandler(resourceLoader);
+ MutableBeanDeploymentArchive beanDeploymentArchive = new MutableBeanDeploymentArchive("classpath");
+ Collection<String> paths = new ArrayList<String>();
+ for (String resourceName : resources)
+ {
+ // grab all the URLs for this resource
+ Collection<URL> urlEnum = resourceLoader.getResources(resourceName);
+ for (URL url : urlEnum)
+ {
+
+ String urlPath = url.toExternalForm();
+
+ // determin resource type (eg: jar, file, bundle)
+ String urlType = "file";
+ int colonIndex = urlPath.indexOf(":");
+ if (colonIndex != -1)
+ {
+ urlType = urlPath.substring(0, colonIndex);
+ }
+
+ // Extra built-in support for simple file-based resources
+ if ("file".equals(urlType) || "jar".equals(urlType))
+ {
+ // switch to using getPath() instead of toExternalForm()
+ urlPath = url.getPath();
+
+ if (urlPath.indexOf('!') > 0)
+ {
+ urlPath = urlPath.substring(0, urlPath.indexOf('!'));
+ }
+ else
+ {
+ // hack for /META-INF/beans.xml
+ File dirOrArchive = new File(urlPath);
+ if ((resourceName != null) && (resourceName.lastIndexOf('/') > 0))
+ {
+ dirOrArchive = dirOrArchive.getParentFile();
+ }
+ urlPath = dirOrArchive.getParent();
+ }
+ }
+
+ try
+ {
+ urlPath = URLDecoder.decode(urlPath, "UTF-8");
+ }
+ catch (UnsupportedEncodingException ex)
+ {
+ throw new ClasspathScanningException("Error decoding URL using UTF-8");
+ }
+
+ log.debug("URL Type: " + urlType);
+
+ paths.add(urlPath);
+ }
+ handler.handle(paths, beanDeploymentArchive);
+ }
+ return beanDeploymentArchive;
+ }
+
+}
Deleted: java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/WeldSEResourceLoader.java
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/WeldSEResourceLoader.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/WeldSEResourceLoader.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,116 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se.discovery.url;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.Collection;
-
-import org.jboss.weld.resources.spi.ResourceLoader;
-import org.jboss.weld.resources.spi.ResourceLoadingException;
-import org.jboss.weld.util.collections.EnumerationList;
-import org.jboss.weld.util.reflection.Reflections;
-
-/**
- * A simple resource loader.
- *
- * Uses {@link WeldSEResourceLoader}'s classloader if the Thread Context
- * Classloader isn't available
- *
- * @author Pete Muir
- *
- */
-public class WeldSEResourceLoader implements ResourceLoader
-{
-
- public Class<?> classForName(String name)
- {
-
- try
- {
- Class<?> clazz = null;
- if (Thread.currentThread().getContextClassLoader() != null)
- {
- clazz = Thread.currentThread().getContextClassLoader().loadClass(name);
- }
- else
- {
- clazz = Class.forName(name);
- }
- // if the class relies on optional dependencies that are not present
- // then a CNFE can be thrown later in the deployment process when the
- // Introspector is inspecting the class. We call getMethods, getFields
- // and getConstructors now over the whole type heirachey to force
- // these errors to occur early.
- // NOTE it is still possible for a CNFE to be thrown at runtime if
- // a class has methods that refer to classes that are not present in
- // their bytecode, this only checks for classes that form part of the
- // class schema that are not present
- Class<?> obj = clazz;
- while (obj != null && obj != Object.class)
- {
- obj.getDeclaredConstructors();
- obj.getDeclaredFields();
- obj.getDeclaredMethods();
- obj = obj.getSuperclass();
- }
- return clazz;
- }
- catch (ClassNotFoundException e)
- {
- throw new ResourceLoadingException(e);
- }
- catch (NoClassDefFoundError e)
- {
- throw new ResourceLoadingException(e);
- }
- }
-
- public URL getResource(String name)
- {
- if (Thread.currentThread().getContextClassLoader() != null)
- {
- return Thread.currentThread().getContextClassLoader().getResource(name);
- }
- else
- {
- return getClass().getResource(name);
- }
- }
-
- public Collection<URL> getResources(String name)
- {
- try
- {
- if (Thread.currentThread().getContextClassLoader() != null)
- {
- return new EnumerationList<URL>(Thread.currentThread().getContextClassLoader().getResources(name));
- }
- else
- {
- return new EnumerationList<URL>(getClass().getClassLoader().getResources(name));
- }
- }
- catch (IOException e)
- {
- throw new ResourceLoadingException(e);
- }
- }
-
- public void cleanup() {}
-
-}
Copied: java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/WeldSEResourceLoader.java (from rev 6914, java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/WeldSEResourceLoader.java)
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/WeldSEResourceLoader.java (rev 0)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/WeldSEResourceLoader.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,116 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se.discovery.url;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.Collection;
+
+import org.jboss.weld.resources.spi.ResourceLoader;
+import org.jboss.weld.resources.spi.ResourceLoadingException;
+import org.jboss.weld.util.collections.EnumerationList;
+import org.jboss.weld.util.reflection.Reflections;
+
+/**
+ * A simple resource loader.
+ *
+ * Uses {@link WeldSEResourceLoader}'s classloader if the Thread Context
+ * Classloader isn't available
+ *
+ * @author Pete Muir
+ *
+ */
+public class WeldSEResourceLoader implements ResourceLoader
+{
+
+ public Class<?> classForName(String name)
+ {
+
+ try
+ {
+ Class<?> clazz = null;
+ if (Thread.currentThread().getContextClassLoader() != null)
+ {
+ clazz = Thread.currentThread().getContextClassLoader().loadClass(name);
+ }
+ else
+ {
+ clazz = Class.forName(name);
+ }
+ // if the class relies on optional dependencies that are not present
+ // then a CNFE can be thrown later in the deployment process when the
+ // Introspector is inspecting the class. We call getMethods, getFields
+ // and getConstructors now over the whole type heirachey to force
+ // these errors to occur early.
+ // NOTE it is still possible for a CNFE to be thrown at runtime if
+ // a class has methods that refer to classes that are not present in
+ // their bytecode, this only checks for classes that form part of the
+ // class schema that are not present
+ Class<?> obj = clazz;
+ while (obj != null && obj != Object.class)
+ {
+ obj.getDeclaredConstructors();
+ obj.getDeclaredFields();
+ obj.getDeclaredMethods();
+ obj = obj.getSuperclass();
+ }
+ return clazz;
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw new ResourceLoadingException(e);
+ }
+ catch (NoClassDefFoundError e)
+ {
+ throw new ResourceLoadingException(e);
+ }
+ }
+
+ public URL getResource(String name)
+ {
+ if (Thread.currentThread().getContextClassLoader() != null)
+ {
+ return Thread.currentThread().getContextClassLoader().getResource(name);
+ }
+ else
+ {
+ return getClass().getResource(name);
+ }
+ }
+
+ public Collection<URL> getResources(String name)
+ {
+ try
+ {
+ if (Thread.currentThread().getContextClassLoader() != null)
+ {
+ return new EnumerationList<URL>(Thread.currentThread().getContextClassLoader().getResources(name));
+ }
+ else
+ {
+ return new EnumerationList<URL>(getClass().getClassLoader().getResources(name));
+ }
+ }
+ catch (IOException e)
+ {
+ throw new ResourceLoadingException(e);
+ }
+ }
+
+ public void cleanup() {}
+
+}
Deleted: java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/WeldSEUrlDeployment.java
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/WeldSEUrlDeployment.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/WeldSEUrlDeployment.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,52 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se.discovery.url;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
-import org.jboss.weld.environment.se.discovery.AbstractWeldSEDeployment;
-import org.jboss.weld.resources.spi.ResourceLoader;
-
-/**
- * Weld Deployment for Java SE environment.
- *
- * @author Peter Royle
- */
-public class WeldSEUrlDeployment extends AbstractWeldSEDeployment
-{
-
- private final BeanDeploymentArchive beanDeploymentArchive;
-
- public WeldSEUrlDeployment(ResourceLoader resourceLoader)
- {
- getServices().add(ResourceLoader.class, resourceLoader);
- this.beanDeploymentArchive = new URLScanner(resourceLoader, RESOURCES).scan();
- }
-
- public List<BeanDeploymentArchive> getBeanDeploymentArchives()
- {
- return Collections.singletonList(beanDeploymentArchive);
- }
-
- public BeanDeploymentArchive loadBeanDeploymentArchive(Class<?> beanClass)
- {
- return beanDeploymentArchive;
- }
-
-}
Copied: java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/WeldSEUrlDeployment.java (from rev 6914, java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/WeldSEUrlDeployment.java)
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/WeldSEUrlDeployment.java (rev 0)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/WeldSEUrlDeployment.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,52 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se.discovery.url;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.weld.environment.se.discovery.AbstractWeldSEDeployment;
+import org.jboss.weld.resources.spi.ResourceLoader;
+
+/**
+ * Weld Deployment for Java SE environment.
+ *
+ * @author Peter Royle
+ */
+public class WeldSEUrlDeployment extends AbstractWeldSEDeployment
+{
+
+ private final BeanDeploymentArchive beanDeploymentArchive;
+
+ public WeldSEUrlDeployment(ResourceLoader resourceLoader)
+ {
+ getServices().add(ResourceLoader.class, resourceLoader);
+ this.beanDeploymentArchive = new URLScanner(resourceLoader, RESOURCES).scan();
+ }
+
+ public List<BeanDeploymentArchive> getBeanDeploymentArchives()
+ {
+ return Collections.singletonList(beanDeploymentArchive);
+ }
+
+ public BeanDeploymentArchive loadBeanDeploymentArchive(Class<?> beanClass)
+ {
+ return beanDeploymentArchive;
+ }
+
+}
Copied: java-se/trunk/src/main/java/org/jboss/weld/environment/se/events (from rev 6914, java-se/trunk/src/main/java/org/jboss/weld/environment/se/events)
Deleted: java-se/trunk/src/main/java/org/jboss/weld/environment/se/events/ContainerInitialized.java
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/events/ContainerInitialized.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/events/ContainerInitialized.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,28 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se.events;
-
-/**
- * The event that is fired when the Weld CDI container is initialized and
- * ready for applications to take control, which it may do by observing this
- * event.
- *
- * @author Peter Royle
- */
-public class ContainerInitialized {
-
-}
Copied: java-se/trunk/src/main/java/org/jboss/weld/environment/se/events/ContainerInitialized.java (from rev 6914, java-se/trunk/src/main/java/org/jboss/weld/environment/se/events/ContainerInitialized.java)
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/events/ContainerInitialized.java (rev 0)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/events/ContainerInitialized.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,28 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se.events;
+
+/**
+ * The event that is fired when the Weld CDI container is initialized and
+ * ready for applications to take control, which it may do by observing this
+ * event.
+ *
+ * @author Peter Royle
+ */
+public class ContainerInitialized {
+
+}
Copied: java-se/trunk/src/main/java/org/jboss/weld/environment/se/threading (from rev 6914, java-se/trunk/src/main/java/org/jboss/weld/environment/se/threading)
Deleted: java-se/trunk/src/main/java/org/jboss/weld/environment/se/threading/RunnableDecorator.java
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/threading/RunnableDecorator.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/threading/RunnableDecorator.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,53 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se.threading;
-
-import javax.decorator.Decorator;
-import javax.decorator.Delegate;
-import javax.inject.Inject;
-import org.jboss.weld.context.beanstore.HashMapBeanStore;
-import org.jboss.weld.environment.se.WeldSEBeanRegistrant;
-import org.jboss.weld.environment.se.contexts.ThreadContext;
-
-/**
- * Decorator for all beans which implements Runnable. It intercepts the call
- * to the run() method to set up the ThreadContext for the new thread so that
- * instances of @ThreadScoped beans can be correctly resolved.
- * @author Peter Royle
- */
- at Decorator
-public class RunnableDecorator implements Runnable {
-
- @Inject @Delegate Runnable runnable;
-
- /**
- * Set up the ThreadContet and delegate.
- */
- public void run()
- {
- // set up context for this thread
- final ThreadContext threadContext = WeldSEBeanRegistrant.THREAD_CONTEXT;
- threadContext.setBeanStore(new HashMapBeanStore());
- threadContext.setActive(true);
- // run the original thread
- runnable.run();
- threadContext.destroy();
- }
-
-
-
-}
Copied: java-se/trunk/src/main/java/org/jboss/weld/environment/se/threading/RunnableDecorator.java (from rev 6914, java-se/trunk/src/main/java/org/jboss/weld/environment/se/threading/RunnableDecorator.java)
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/threading/RunnableDecorator.java (rev 0)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/threading/RunnableDecorator.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se.threading;
+
+import javax.decorator.Decorator;
+import javax.decorator.Delegate;
+import javax.inject.Inject;
+import org.jboss.weld.context.beanstore.HashMapBeanStore;
+import org.jboss.weld.environment.se.WeldSEBeanRegistrant;
+import org.jboss.weld.environment.se.contexts.ThreadContext;
+
+/**
+ * Decorator for all beans which implements Runnable. It intercepts the call
+ * to the run() method to set up the ThreadContext for the new thread so that
+ * instances of @ThreadScoped beans can be correctly resolved.
+ * @author Peter Royle
+ */
+ at Decorator
+public class RunnableDecorator implements Runnable {
+
+ @Inject @Delegate Runnable runnable;
+
+ /**
+ * Set up the ThreadContet and delegate.
+ */
+ public void run()
+ {
+ // set up context for this thread
+ final ThreadContext threadContext = WeldSEBeanRegistrant.THREAD_CONTEXT;
+ threadContext.setBeanStore(new HashMapBeanStore());
+ threadContext.setActive(true);
+ // run the original thread
+ runnable.run();
+ threadContext.destroy();
+ }
+
+
+
+}
Copied: java-se/trunk/src/main/resources (from rev 6914, java-se/trunk/src/main/resources)
Copied: java-se/trunk/src/main/resources/META-INF (from rev 6914, java-se/trunk/src/main/resources/META-INF)
Copied: java-se/trunk/src/main/resources/META-INF/services (from rev 6914, java-se/trunk/src/main/resources/META-INF/services)
Deleted: java-se/trunk/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
===================================================================
--- java-se/trunk/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1 +0,0 @@
-org.jboss.weld.environment.se.WeldSEBeanRegistrant
Copied: java-se/trunk/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension (from rev 6914, java-se/trunk/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension)
===================================================================
--- java-se/trunk/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension (rev 0)
+++ java-se/trunk/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1 @@
+org.jboss.weld.environment.se.WeldSEBeanRegistrant
Deleted: java-se/trunk/src/main/resources/log4j.xml
===================================================================
--- java-se/trunk/src/main/resources/log4j.xml 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/main/resources/log4j.xml 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-<!--
-
- JBoss, Home of Professional Open Source
- Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- contributors by the @authors tag. See the copyright.txt in the
- distribution for a full listing of individual contributors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
-
- <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
- <param name="Target" value="System.out"/>
- <layout class="org.apache.log4j.PatternLayout">
- <!-- The default pattern: Date Priority [Category] Message\n -->
- <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{2}] %m%n"/>
- </layout>
- <filter class="org.apache.log4j.varia.StringMatchFilter">
- <param name="AcceptOnMatch" value="false" />
- <param name="StringToMatch" value="Failure while notifying an observer of event [a]" />
- </filter>
- </appender>
-
- <!-- ############### Weld logging ################### -->
-
- <category name="org.jboss.weld">
- <priority value="INFO"/>
- </category>
-
- <root>
- <priority value="INFO"/>
- <appender-ref ref="CONSOLE"/>
- </root>
-
-</log4j:configuration>
Copied: java-se/trunk/src/main/resources/log4j.xml (from rev 6914, java-se/trunk/src/main/resources/log4j.xml)
===================================================================
--- java-se/trunk/src/main/resources/log4j.xml (rev 0)
+++ java-se/trunk/src/main/resources/log4j.xml 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<!--
+
+ JBoss, Home of Professional Open Source
+ Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ contributors by the @authors tag. See the copyright.txt in the
+ distribution for a full listing of individual contributors.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{2}] %m%n"/>
+ </layout>
+ <filter class="org.apache.log4j.varia.StringMatchFilter">
+ <param name="AcceptOnMatch" value="false" />
+ <param name="StringToMatch" value="Failure while notifying an observer of event [a]" />
+ </filter>
+ </appender>
+
+ <!-- ############### Weld logging ################### -->
+
+ <category name="org.jboss.weld">
+ <priority value="INFO"/>
+ </category>
+
+ <root>
+ <priority value="INFO"/>
+ <appender-ref ref="CONSOLE"/>
+ </root>
+
+</log4j:configuration>
Copied: java-se/trunk/src/test (from rev 6914, java-se/trunk/src/test)
Copied: java-se/trunk/src/test/java (from rev 6914, java-se/trunk/src/test/java)
Copied: java-se/trunk/src/test/java/org (from rev 6914, java-se/trunk/src/test/java/org)
Copied: java-se/trunk/src/test/java/org/jboss (from rev 6914, java-se/trunk/src/test/java/org/jboss)
Copied: java-se/trunk/src/test/java/org/jboss/webbeans (from rev 6914, java-se/trunk/src/test/java/org/jboss/webbeans)
Copied: java-se/trunk/src/test/java/org/jboss/webbeans/environment (from rev 6914, java-se/trunk/src/test/java/org/jboss/webbeans/environment)
Copied: java-se/trunk/src/test/java/org/jboss/webbeans/environment/se (from rev 6914, java-se/trunk/src/test/java/org/jboss/webbeans/environment/se)
Copied: java-se/trunk/src/test/java/org/jboss/webbeans/environment/se/test (from rev 6914, java-se/trunk/src/test/java/org/jboss/webbeans/environment/se/test)
Copied: java-se/trunk/src/test/java/org/jboss/weld (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld)
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment)
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se)
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test)
Deleted: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/DecoratorsTest.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/DecoratorsTest.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/DecoratorsTest.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,82 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se.test;
-
-import org.jboss.weld.environment.se.ShutdownManager;
-import org.jboss.weld.environment.se.Weld;
-import org.jboss.weld.environment.se.WeldContainer;
-import org.jboss.weld.environment.se.test.decorators.AbstractDoor;
-import org.jboss.weld.environment.se.test.decorators.CarDoor;
-import org.jboss.weld.environment.se.test.decorators.CarDoorAlarm;
-import org.jboss.weld.environment.se.test.decorators.HouseDoor;
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author Peter Royle
- */
-public class DecoratorsTest
-{
-
- /**
- * Test that decorators work as expected in SE.
- */
- @Test
- public void testDecorators()
- {
- WeldContainer weld = new Weld().initialize();
-
- CarDoor carDoor = weld.instance().select(CarDoor.class).get();
- Assert.assertNotNull(carDoor);
-
- // the car door is alarmed
- CarDoorAlarm.alarmActivated = false;
- Assert.assertFalse(CarDoorAlarm.alarmActivated);
- testDoor(carDoor);
- Assert.assertTrue(CarDoorAlarm.alarmActivated);
-
- HouseDoor houseDoor = weld.instance().select(HouseDoor.class).get();
- Assert.assertNotNull(carDoor);
-
- // the house door is not alarmed
- CarDoorAlarm.alarmActivated = false;
- Assert.assertFalse(CarDoorAlarm.alarmActivated);
- testDoor(houseDoor);
- Assert.assertFalse(CarDoorAlarm.alarmActivated);
-
- shutdownManager(weld);
- }
-
- private void testDoor(AbstractDoor door)
- {
- Assert.assertTrue(door.open());
- Assert.assertTrue(door.isOpen());
- Assert.assertFalse(door.close());
- Assert.assertFalse(door.isOpen());
- Assert.assertTrue(door.lock());
- Assert.assertTrue(door.isLocked());
- Assert.assertFalse(door.open());
- Assert.assertFalse(door.isOpen());
- }
-
- private void shutdownManager(WeldContainer weld)
- {
- ShutdownManager shutdownManager = weld.instance().select(ShutdownManager.class).get();
- shutdownManager.shutdown();
- }
-}
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/DecoratorsTest.java (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/DecoratorsTest.java)
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/DecoratorsTest.java (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/DecoratorsTest.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,82 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se.test;
+
+import org.jboss.weld.environment.se.ShutdownManager;
+import org.jboss.weld.environment.se.Weld;
+import org.jboss.weld.environment.se.WeldContainer;
+import org.jboss.weld.environment.se.test.decorators.AbstractDoor;
+import org.jboss.weld.environment.se.test.decorators.CarDoor;
+import org.jboss.weld.environment.se.test.decorators.CarDoorAlarm;
+import org.jboss.weld.environment.se.test.decorators.HouseDoor;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * @author Peter Royle
+ */
+public class DecoratorsTest
+{
+
+ /**
+ * Test that decorators work as expected in SE.
+ */
+ @Test
+ public void testDecorators()
+ {
+ WeldContainer weld = new Weld().initialize();
+
+ CarDoor carDoor = weld.instance().select(CarDoor.class).get();
+ Assert.assertNotNull(carDoor);
+
+ // the car door is alarmed
+ CarDoorAlarm.alarmActivated = false;
+ Assert.assertFalse(CarDoorAlarm.alarmActivated);
+ testDoor(carDoor);
+ Assert.assertTrue(CarDoorAlarm.alarmActivated);
+
+ HouseDoor houseDoor = weld.instance().select(HouseDoor.class).get();
+ Assert.assertNotNull(carDoor);
+
+ // the house door is not alarmed
+ CarDoorAlarm.alarmActivated = false;
+ Assert.assertFalse(CarDoorAlarm.alarmActivated);
+ testDoor(houseDoor);
+ Assert.assertFalse(CarDoorAlarm.alarmActivated);
+
+ shutdownManager(weld);
+ }
+
+ private void testDoor(AbstractDoor door)
+ {
+ Assert.assertTrue(door.open());
+ Assert.assertTrue(door.isOpen());
+ Assert.assertFalse(door.close());
+ Assert.assertFalse(door.isOpen());
+ Assert.assertTrue(door.lock());
+ Assert.assertTrue(door.isLocked());
+ Assert.assertFalse(door.open());
+ Assert.assertFalse(door.isOpen());
+ }
+
+ private void shutdownManager(WeldContainer weld)
+ {
+ ShutdownManager shutdownManager = weld.instance().select(ShutdownManager.class).get();
+ shutdownManager.shutdown();
+ }
+}
Deleted: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/EventsTest.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/EventsTest.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/EventsTest.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,48 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se.test;
-
-import org.jboss.weld.environment.se.ShutdownManager;
-import org.jboss.weld.environment.se.Weld;
-import org.jboss.weld.environment.se.WeldContainer;
-import org.jboss.weld.environment.se.events.ContainerInitialized;
-import org.jboss.weld.environment.se.test.events.Foo;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author Peter Royle
- */
-public class EventsTest
-{
-
- @Test(description="forum post check")
- public void testEventQualifiersCorrect()
- {
- Foo.reset();
- WeldContainer weld = new Weld().initialize();
- weld.event().select(ContainerInitialized.class).fire(new ContainerInitialized());
- assert !Foo.isObservedEventTest();
- shutdownManager(weld);
- }
-
- private void shutdownManager(WeldContainer weld)
- {
- ShutdownManager shutdownManager = weld.instance().select(ShutdownManager.class).get();
- shutdownManager.shutdown();
- }
-}
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/EventsTest.java (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/EventsTest.java)
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/EventsTest.java (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/EventsTest.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,48 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se.test;
+
+import org.jboss.weld.environment.se.ShutdownManager;
+import org.jboss.weld.environment.se.Weld;
+import org.jboss.weld.environment.se.WeldContainer;
+import org.jboss.weld.environment.se.events.ContainerInitialized;
+import org.jboss.weld.environment.se.test.events.Foo;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * @author Peter Royle
+ */
+public class EventsTest
+{
+
+ @Test(description="forum post check")
+ public void testEventQualifiersCorrect()
+ {
+ Foo.reset();
+ WeldContainer weld = new Weld().initialize();
+ weld.event().select(ContainerInitialized.class).fire(new ContainerInitialized());
+ assert !Foo.isObservedEventTest();
+ shutdownManager(weld);
+ }
+
+ private void shutdownManager(WeldContainer weld)
+ {
+ ShutdownManager shutdownManager = weld.instance().select(ShutdownManager.class).get();
+ shutdownManager.shutdown();
+ }
+}
Deleted: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/InterceptorsTest.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/InterceptorsTest.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/InterceptorsTest.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,68 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se.test;
-
-import javax.enterprise.inject.spi.BeanManager;
-
-import org.jboss.weld.environment.se.ShutdownManager;
-import org.jboss.weld.environment.se.Weld;
-import org.jboss.weld.environment.se.WeldContainer;
-import org.jboss.weld.environment.se.test.beans.InterceptorTestBean;
-import org.jboss.weld.environment.se.test.interceptors.AggregatingInterceptor;
-import org.jboss.weld.environment.se.test.interceptors.RecordingInterceptor;
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author Peter Royle
- */
-public class InterceptorsTest
-{
-
- /**
- * Test that interceptors work as expected in SE.
- */
- @Test
- public void testInterceptors()
- {
- WeldContainer weld = new Weld().initialize();
- BeanManager manager = weld.getBeanManager();
-
- InterceptorTestBean intTestBean = weld.instance().select(InterceptorTestBean.class).get();
- Assert.assertNotNull(intTestBean);
-
- intTestBean.doSomethingRecorded();
- System.out.println(RecordingInterceptor.methodsRecorded);
- System.out.println(AggregatingInterceptor.methodsCalled);
- Assert.assertTrue(RecordingInterceptor.methodsRecorded.contains("doSomethingRecorded"));
-
- intTestBean.doSomethingRecordedAndAggregated();
- System.out.println(RecordingInterceptor.methodsRecorded);
- System.out.println(AggregatingInterceptor.methodsCalled);
-
- Assert.assertEquals(1, AggregatingInterceptor.methodsCalled);
-
- shutdownManager(weld);
- }
-
- private void shutdownManager(WeldContainer weld)
- {
- ShutdownManager shutdownManager = weld.instance().select(ShutdownManager.class).get();
- shutdownManager.shutdown();
- }
-}
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/InterceptorsTest.java (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/InterceptorsTest.java)
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/InterceptorsTest.java (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/InterceptorsTest.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,68 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se.test;
+
+import javax.enterprise.inject.spi.BeanManager;
+
+import org.jboss.weld.environment.se.ShutdownManager;
+import org.jboss.weld.environment.se.Weld;
+import org.jboss.weld.environment.se.WeldContainer;
+import org.jboss.weld.environment.se.test.beans.InterceptorTestBean;
+import org.jboss.weld.environment.se.test.interceptors.AggregatingInterceptor;
+import org.jboss.weld.environment.se.test.interceptors.RecordingInterceptor;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * @author Peter Royle
+ */
+public class InterceptorsTest
+{
+
+ /**
+ * Test that interceptors work as expected in SE.
+ */
+ @Test
+ public void testInterceptors()
+ {
+ WeldContainer weld = new Weld().initialize();
+ BeanManager manager = weld.getBeanManager();
+
+ InterceptorTestBean intTestBean = weld.instance().select(InterceptorTestBean.class).get();
+ Assert.assertNotNull(intTestBean);
+
+ intTestBean.doSomethingRecorded();
+ System.out.println(RecordingInterceptor.methodsRecorded);
+ System.out.println(AggregatingInterceptor.methodsCalled);
+ Assert.assertTrue(RecordingInterceptor.methodsRecorded.contains("doSomethingRecorded"));
+
+ intTestBean.doSomethingRecordedAndAggregated();
+ System.out.println(RecordingInterceptor.methodsRecorded);
+ System.out.println(AggregatingInterceptor.methodsCalled);
+
+ Assert.assertEquals(1, AggregatingInterceptor.methodsCalled);
+
+ shutdownManager(weld);
+ }
+
+ private void shutdownManager(WeldContainer weld)
+ {
+ ShutdownManager shutdownManager = weld.instance().select(ShutdownManager.class).get();
+ shutdownManager.shutdown();
+ }
+}
Deleted: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/ScopesTest.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/ScopesTest.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/ScopesTest.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,56 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se.test;
-
-import javax.enterprise.inject.spi.BeanManager;
-
-import org.jboss.weld.environment.se.ShutdownManager;
-import org.jboss.weld.environment.se.Weld;
-import org.jboss.weld.environment.se.WeldContainer;
-import org.jboss.weld.environment.se.test.scopes.Bar;
-import org.jboss.weld.environment.se.test.scopes.Foo;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author Peter Royle
- */
-public class ScopesTest
-{
-
- /**
- * Test that decorators work as expected in SE.
- */
- @Test(description="WELD-322")
- public void testScopes()
- {
-
- WeldContainer weld = new Weld().initialize();
- BeanManager manager = weld.getBeanManager();
-
- assert manager.getBeans(Bar.class).size() == 1;
- assert manager.getBeans(Foo.class).size() == 2;
-
- shutdownManager(weld);
- }
-
- private void shutdownManager(WeldContainer weld)
- {
- ShutdownManager shutdownManager = weld.instance().select(ShutdownManager.class).get();
- shutdownManager.shutdown();
- }
-}
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/ScopesTest.java (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/ScopesTest.java)
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/ScopesTest.java (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/ScopesTest.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,56 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se.test;
+
+import javax.enterprise.inject.spi.BeanManager;
+
+import org.jboss.weld.environment.se.ShutdownManager;
+import org.jboss.weld.environment.se.Weld;
+import org.jboss.weld.environment.se.WeldContainer;
+import org.jboss.weld.environment.se.test.scopes.Bar;
+import org.jboss.weld.environment.se.test.scopes.Foo;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * @author Peter Royle
+ */
+public class ScopesTest
+{
+
+ /**
+ * Test that decorators work as expected in SE.
+ */
+ @Test(description="WELD-322")
+ public void testScopes()
+ {
+
+ WeldContainer weld = new Weld().initialize();
+ BeanManager manager = weld.getBeanManager();
+
+ assert manager.getBeans(Bar.class).size() == 1;
+ assert manager.getBeans(Foo.class).size() == 2;
+
+ shutdownManager(weld);
+ }
+
+ private void shutdownManager(WeldContainer weld)
+ {
+ ShutdownManager shutdownManager = weld.instance().select(ShutdownManager.class).get();
+ shutdownManager.shutdown();
+ }
+}
Deleted: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/StartMainTest.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/StartMainTest.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/StartMainTest.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,114 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se.test;
-
-import javax.enterprise.inject.spi.BeanManager;
-
-import org.jboss.weld.environment.se.ShutdownManager;
-import org.jboss.weld.environment.se.StartMain;
-import org.jboss.weld.environment.se.WeldContainer;
-import org.jboss.weld.environment.se.test.beans.CustomEvent;
-import org.jboss.weld.environment.se.test.beans.InitObserverTestBean;
-import org.jboss.weld.environment.se.test.beans.MainTestBean;
-import org.jboss.weld.environment.se.test.beans.ObserverTestBean;
-import org.jboss.weld.environment.se.test.beans.ParametersTestBean;
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author Peter Royle
- */
-public class StartMainTest
-{
-
- public static String[] ARGS = new String[] { "arg1", "arg2", "arg3" };
- public static String[] ARGS_EMPTY = new String[] {};
-
- /**
- * Test of main method, of class StartMain. Checks that the beans found in
- * the org.jboss.weld.environment.se.beans package are initialised as
- * expected.
- */
- @Test
- public void testMain()
- {
- String[] args = ARGS;
-
- WeldContainer weld = new StartMain(args).go();
- BeanManager manager = weld.getBeanManager();
-
- MainTestBean mainTestBean = weld.instance().select(MainTestBean.class).get();
- Assert.assertNotNull(mainTestBean);
-
- ParametersTestBean paramsBean = mainTestBean.getParametersTestBean();
- Assert.assertNotNull(paramsBean);
- Assert.assertNotNull(paramsBean.getParameters());
- Assert.assertNotNull(paramsBean.getParameters().get(0));
- Assert.assertEquals(ARGS[0], paramsBean.getParameters().get(0));
- Assert.assertNotNull(paramsBean.getParameters().get(1));
- Assert.assertEquals(ARGS[1], paramsBean.getParameters().get(1));
- Assert.assertNotNull(paramsBean.getParameters().get(2));
- Assert.assertEquals(ARGS[2], paramsBean.getParameters().get(2));
-
- shutdownManager(weld);
- }
-
- /**
- * Test of main method, of class StartMain when no command-line args are
- * provided.
- */
- @Test
- public void testMainEmptyArgs()
- {
- WeldContainer weld = new StartMain(ARGS_EMPTY).go();
- BeanManager manager = weld.getBeanManager();
-
- MainTestBean mainTestBean = weld.instance().select(MainTestBean.class).get();
- Assert.assertNotNull(mainTestBean);
-
- ParametersTestBean paramsBean = mainTestBean.getParametersTestBean();
- Assert.assertNotNull(paramsBean);
- Assert.assertNotNull(paramsBean.getParameters());
-
- shutdownManager(weld);
- }
-
- @Test
- public void testObservers()
- {
- InitObserverTestBean.reset();
- ObserverTestBean.reset();
-
- WeldContainer weld = new StartMain(ARGS_EMPTY).go();
- BeanManager manager = weld.getBeanManager();
- manager.fireEvent(new CustomEvent());
-
- Assert.assertTrue(ObserverTestBean.isBuiltInObserved());
- Assert.assertTrue(ObserverTestBean.isCustomObserved());
- Assert.assertTrue(ObserverTestBean.isInitObserved());
-
- Assert.assertTrue(InitObserverTestBean.isInitObserved());
- }
-
- private void shutdownManager(WeldContainer weld)
- {
- ShutdownManager shutdownManager = weld.instance().select(ShutdownManager.class).get();
- shutdownManager.shutdown();
- }
-
-}
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/StartMainTest.java (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/StartMainTest.java)
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/StartMainTest.java (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/StartMainTest.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,114 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se.test;
+
+import javax.enterprise.inject.spi.BeanManager;
+
+import org.jboss.weld.environment.se.ShutdownManager;
+import org.jboss.weld.environment.se.StartMain;
+import org.jboss.weld.environment.se.WeldContainer;
+import org.jboss.weld.environment.se.test.beans.CustomEvent;
+import org.jboss.weld.environment.se.test.beans.InitObserverTestBean;
+import org.jboss.weld.environment.se.test.beans.MainTestBean;
+import org.jboss.weld.environment.se.test.beans.ObserverTestBean;
+import org.jboss.weld.environment.se.test.beans.ParametersTestBean;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * @author Peter Royle
+ */
+public class StartMainTest
+{
+
+ public static String[] ARGS = new String[] { "arg1", "arg2", "arg3" };
+ public static String[] ARGS_EMPTY = new String[] {};
+
+ /**
+ * Test of main method, of class StartMain. Checks that the beans found in
+ * the org.jboss.weld.environment.se.beans package are initialised as
+ * expected.
+ */
+ @Test
+ public void testMain()
+ {
+ String[] args = ARGS;
+
+ WeldContainer weld = new StartMain(args).go();
+ BeanManager manager = weld.getBeanManager();
+
+ MainTestBean mainTestBean = weld.instance().select(MainTestBean.class).get();
+ Assert.assertNotNull(mainTestBean);
+
+ ParametersTestBean paramsBean = mainTestBean.getParametersTestBean();
+ Assert.assertNotNull(paramsBean);
+ Assert.assertNotNull(paramsBean.getParameters());
+ Assert.assertNotNull(paramsBean.getParameters().get(0));
+ Assert.assertEquals(ARGS[0], paramsBean.getParameters().get(0));
+ Assert.assertNotNull(paramsBean.getParameters().get(1));
+ Assert.assertEquals(ARGS[1], paramsBean.getParameters().get(1));
+ Assert.assertNotNull(paramsBean.getParameters().get(2));
+ Assert.assertEquals(ARGS[2], paramsBean.getParameters().get(2));
+
+ shutdownManager(weld);
+ }
+
+ /**
+ * Test of main method, of class StartMain when no command-line args are
+ * provided.
+ */
+ @Test
+ public void testMainEmptyArgs()
+ {
+ WeldContainer weld = new StartMain(ARGS_EMPTY).go();
+ BeanManager manager = weld.getBeanManager();
+
+ MainTestBean mainTestBean = weld.instance().select(MainTestBean.class).get();
+ Assert.assertNotNull(mainTestBean);
+
+ ParametersTestBean paramsBean = mainTestBean.getParametersTestBean();
+ Assert.assertNotNull(paramsBean);
+ Assert.assertNotNull(paramsBean.getParameters());
+
+ shutdownManager(weld);
+ }
+
+ @Test
+ public void testObservers()
+ {
+ InitObserverTestBean.reset();
+ ObserverTestBean.reset();
+
+ WeldContainer weld = new StartMain(ARGS_EMPTY).go();
+ BeanManager manager = weld.getBeanManager();
+ manager.fireEvent(new CustomEvent());
+
+ Assert.assertTrue(ObserverTestBean.isBuiltInObserved());
+ Assert.assertTrue(ObserverTestBean.isCustomObserved());
+ Assert.assertTrue(ObserverTestBean.isInitObserved());
+
+ Assert.assertTrue(InitObserverTestBean.isInitObserved());
+ }
+
+ private void shutdownManager(WeldContainer weld)
+ {
+ ShutdownManager shutdownManager = weld.instance().select(ShutdownManager.class).get();
+ shutdownManager.shutdown();
+ }
+
+}
Deleted: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/ThreadContextTest.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/ThreadContextTest.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/ThreadContextTest.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,92 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se.test;
-
-import org.jboss.weld.environment.se.test.beans.threading.ThreadRunner;
-import java.util.ArrayList;
-
-import java.util.List;
-import org.jboss.weld.environment.se.ShutdownManager;
-import org.jboss.weld.environment.se.Weld;
-import org.jboss.weld.environment.se.WeldContainer;
-import org.testng.annotations.Test;
-
-import static org.testng.Assert.assertEquals;
-
-/**
- * Tests for ThreadContext, @ThreadScoped and the RunnableDecorator. The
- * decorator is enabled in the META-INF/beans.xml of the test resources.
- * @author Peter Royle
- */
-public class ThreadContextTest
-{
-
- public static final int NUM_THREADS = 10;
- public static final int NUM_LOOPS = 10;
-
- @Test
- public void testThreadContext()
- {
- WeldContainer weld = new Weld().initialize();
-
- List<ThreadRunner> threadRunners = new ArrayList<ThreadRunner>(NUM_THREADS);
- List<Thread> threads = new ArrayList<Thread>(NUM_THREADS);
- for (int threadIdx = 0; threadIdx < NUM_THREADS; threadIdx++)
- {
- final ThreadRunner threadRunner = weld.instance().select(ThreadRunner.class).get();
- threadRunner.setName("ThreadRunner thread #" + threadIdx);
-
- Thread thread = new Thread(threadRunner);
- thread.start();
- threads.add(thread);
- threadRunners.add(threadRunner);
- }
-
- // wait for all threads to complete
- assertEquals(NUM_THREADS, threads.size());
- for (Thread thread : threads)
- {
- try
- {
- thread.join();
- } catch (InterruptedException ex)
- {
- throw new RuntimeException(ex);
- }
- }
-
- // bubble any exception from other threads to the surface
- assertEquals(NUM_THREADS, threadRunners.size());
- for (ThreadRunner threadRunner : threadRunners)
- {
- for (Exception e : threadRunner.getExceptions())
- {
- throw new RuntimeException(e);
- }
- }
-
- shutdownManager(weld);
- }
-
- private void shutdownManager(WeldContainer weld)
- {
- ShutdownManager shutdownManager = weld.instance().select(ShutdownManager.class).get();
- shutdownManager.shutdown();
- }
-
-
-}
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/ThreadContextTest.java (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/ThreadContextTest.java)
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/ThreadContextTest.java (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/ThreadContextTest.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,92 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se.test;
+
+import org.jboss.weld.environment.se.test.beans.threading.ThreadRunner;
+import java.util.ArrayList;
+
+import java.util.List;
+import org.jboss.weld.environment.se.ShutdownManager;
+import org.jboss.weld.environment.se.Weld;
+import org.jboss.weld.environment.se.WeldContainer;
+import org.testng.annotations.Test;
+
+import static org.testng.Assert.assertEquals;
+
+/**
+ * Tests for ThreadContext, @ThreadScoped and the RunnableDecorator. The
+ * decorator is enabled in the META-INF/beans.xml of the test resources.
+ * @author Peter Royle
+ */
+public class ThreadContextTest
+{
+
+ public static final int NUM_THREADS = 10;
+ public static final int NUM_LOOPS = 10;
+
+ @Test
+ public void testThreadContext()
+ {
+ WeldContainer weld = new Weld().initialize();
+
+ List<ThreadRunner> threadRunners = new ArrayList<ThreadRunner>(NUM_THREADS);
+ List<Thread> threads = new ArrayList<Thread>(NUM_THREADS);
+ for (int threadIdx = 0; threadIdx < NUM_THREADS; threadIdx++)
+ {
+ final ThreadRunner threadRunner = weld.instance().select(ThreadRunner.class).get();
+ threadRunner.setName("ThreadRunner thread #" + threadIdx);
+
+ Thread thread = new Thread(threadRunner);
+ thread.start();
+ threads.add(thread);
+ threadRunners.add(threadRunner);
+ }
+
+ // wait for all threads to complete
+ assertEquals(NUM_THREADS, threads.size());
+ for (Thread thread : threads)
+ {
+ try
+ {
+ thread.join();
+ } catch (InterruptedException ex)
+ {
+ throw new RuntimeException(ex);
+ }
+ }
+
+ // bubble any exception from other threads to the surface
+ assertEquals(NUM_THREADS, threadRunners.size());
+ for (ThreadRunner threadRunner : threadRunners)
+ {
+ for (Exception e : threadRunner.getExceptions())
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ shutdownManager(weld);
+ }
+
+ private void shutdownManager(WeldContainer weld)
+ {
+ ShutdownManager shutdownManager = weld.instance().select(ShutdownManager.class).get();
+ shutdownManager.shutdown();
+ }
+
+
+}
Deleted: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/WeldMainTest.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/WeldMainTest.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/WeldMainTest.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,81 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se.test;
-
-import org.jboss.weld.environment.se.ShutdownManager;
-import org.jboss.weld.environment.se.Weld;
-import org.jboss.weld.environment.se.WeldContainer;
-import org.jboss.weld.environment.se.test.beans.CustomEvent;
-import org.jboss.weld.environment.se.test.beans.InitObserverTestBean;
-import org.jboss.weld.environment.se.test.beans.MainTestBean;
-import org.jboss.weld.environment.se.test.beans.ObserverTestBean;
-import org.jboss.weld.environment.se.test.beans.ParametersTestBean;
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author Peter Royle
- */
-public class WeldMainTest
-{
-
- /**
- * Test the alternate API for boting WeldContainer from an SE app.
- */
- @Test
- public void testInitialize()
- {
-
- WeldContainer weld = new Weld().initialize();
-
- MainTestBean mainTestBean = weld.instance().select(MainTestBean.class).get();
- Assert.assertNotNull(mainTestBean);
-
- ParametersTestBean paramsBean = mainTestBean.getParametersTestBean();
- Assert.assertNotNull(paramsBean);
- Assert.assertNotNull(paramsBean.getParameters());
-
- shutdownManager(weld);
- }
-
- /**
- * Test the firing of observers using the alternate API for boting WeldContainer from an SE app.
- */
- @Test
- public void testObservers()
- {
- InitObserverTestBean.reset();
- ObserverTestBean.reset();
-
-
- WeldContainer weld = new Weld().initialize();
- weld.event().select(CustomEvent.class).fire(new CustomEvent());
-
- Assert.assertTrue(ObserverTestBean.isBuiltInObserved());
- Assert.assertTrue(ObserverTestBean.isCustomObserved());
- Assert.assertFalse(ObserverTestBean.isInitObserved());
-
- Assert.assertFalse(InitObserverTestBean.isInitObserved());
- }
-
- private void shutdownManager(WeldContainer weld)
- {
- ShutdownManager shutdownManager = weld.instance().select(ShutdownManager.class).get();
- shutdownManager.shutdown();
- }
-}
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/WeldMainTest.java (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/WeldMainTest.java)
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/WeldMainTest.java (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/WeldMainTest.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,81 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se.test;
+
+import org.jboss.weld.environment.se.ShutdownManager;
+import org.jboss.weld.environment.se.Weld;
+import org.jboss.weld.environment.se.WeldContainer;
+import org.jboss.weld.environment.se.test.beans.CustomEvent;
+import org.jboss.weld.environment.se.test.beans.InitObserverTestBean;
+import org.jboss.weld.environment.se.test.beans.MainTestBean;
+import org.jboss.weld.environment.se.test.beans.ObserverTestBean;
+import org.jboss.weld.environment.se.test.beans.ParametersTestBean;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * @author Peter Royle
+ */
+public class WeldMainTest
+{
+
+ /**
+ * Test the alternate API for boting WeldContainer from an SE app.
+ */
+ @Test
+ public void testInitialize()
+ {
+
+ WeldContainer weld = new Weld().initialize();
+
+ MainTestBean mainTestBean = weld.instance().select(MainTestBean.class).get();
+ Assert.assertNotNull(mainTestBean);
+
+ ParametersTestBean paramsBean = mainTestBean.getParametersTestBean();
+ Assert.assertNotNull(paramsBean);
+ Assert.assertNotNull(paramsBean.getParameters());
+
+ shutdownManager(weld);
+ }
+
+ /**
+ * Test the firing of observers using the alternate API for boting WeldContainer from an SE app.
+ */
+ @Test
+ public void testObservers()
+ {
+ InitObserverTestBean.reset();
+ ObserverTestBean.reset();
+
+
+ WeldContainer weld = new Weld().initialize();
+ weld.event().select(CustomEvent.class).fire(new CustomEvent());
+
+ Assert.assertTrue(ObserverTestBean.isBuiltInObserved());
+ Assert.assertTrue(ObserverTestBean.isCustomObserved());
+ Assert.assertFalse(ObserverTestBean.isInitObserved());
+
+ Assert.assertFalse(InitObserverTestBean.isInitObserved());
+ }
+
+ private void shutdownManager(WeldContainer weld)
+ {
+ ShutdownManager shutdownManager = weld.instance().select(ShutdownManager.class).get();
+ shutdownManager.shutdown();
+ }
+}
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans)
Deleted: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/CustomEvent.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/CustomEvent.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/CustomEvent.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,28 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se.test.beans;
-
-/**
- * A custom event fired and observed by one of the tests, to test
- * application-specific events.
- *
- * @author Peter Royle
- */
-public class CustomEvent
-{
-
-}
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/CustomEvent.java (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/CustomEvent.java)
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/CustomEvent.java (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/CustomEvent.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,28 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se.test.beans;
+
+/**
+ * A custom event fired and observed by one of the tests, to test
+ * application-specific events.
+ *
+ * @author Peter Royle
+ */
+public class CustomEvent
+{
+
+}
Deleted: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/InitObserverTestBean.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/InitObserverTestBean.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/InitObserverTestBean.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,58 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se.test.beans;
-
-import javax.enterprise.event.Observes;
-import javax.inject.Inject;
-
-import org.jboss.weld.environment.se.events.ContainerInitialized;
-
-/**
- * Tests the observing of both built-in and application-specific events.
- *
- * @author Peter Royle
- */
-public class InitObserverTestBean
-{
-
- private static boolean initObserved = false;
-
- @Inject MainTestBean bean;
-
- public InitObserverTestBean()
- {
- }
-
- public void observeInitEvent(@Observes ContainerInitialized event) {
- initObserved = true;
- assert this.bean != null;
- }
-
- public static void reset()
- {
- initObserved = false;
- }
-
- /**
- * @return
- */
- public static boolean isInitObserved()
- {
- return initObserved;
- }
-
-}
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/InitObserverTestBean.java (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/InitObserverTestBean.java)
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/InitObserverTestBean.java (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/InitObserverTestBean.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,58 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se.test.beans;
+
+import javax.enterprise.event.Observes;
+import javax.inject.Inject;
+
+import org.jboss.weld.environment.se.events.ContainerInitialized;
+
+/**
+ * Tests the observing of both built-in and application-specific events.
+ *
+ * @author Peter Royle
+ */
+public class InitObserverTestBean
+{
+
+ private static boolean initObserved = false;
+
+ @Inject MainTestBean bean;
+
+ public InitObserverTestBean()
+ {
+ }
+
+ public void observeInitEvent(@Observes ContainerInitialized event) {
+ initObserved = true;
+ assert this.bean != null;
+ }
+
+ public static void reset()
+ {
+ initObserved = false;
+ }
+
+ /**
+ * @return
+ */
+ public static boolean isInitObserved()
+ {
+ return initObserved;
+ }
+
+}
Deleted: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/InterceptorTestBean.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/InterceptorTestBean.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/InterceptorTestBean.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,40 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se.test.beans;
-
-import javax.enterprise.context.ApplicationScoped;
-import org.jboss.weld.environment.se.test.interceptors.Aggregated;
-import org.jboss.weld.environment.se.test.interceptors.Recorded;
-
-/**
- *
- * @author Peter Royle
- */
- at Recorded
- at ApplicationScoped
-public class InterceptorTestBean {
-
- public void doSomethingRecorded() {
- System.out.println("this should be recorded");
- }
-
- @Aggregated
- public void doSomethingRecordedAndAggregated() {
- System.out.println("This should be aggregated");
- }
-
-}
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/InterceptorTestBean.java (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/InterceptorTestBean.java)
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/InterceptorTestBean.java (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/InterceptorTestBean.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,40 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se.test.beans;
+
+import javax.enterprise.context.ApplicationScoped;
+import org.jboss.weld.environment.se.test.interceptors.Aggregated;
+import org.jboss.weld.environment.se.test.interceptors.Recorded;
+
+/**
+ *
+ * @author Peter Royle
+ */
+ at Recorded
+ at ApplicationScoped
+public class InterceptorTestBean {
+
+ public void doSomethingRecorded() {
+ System.out.println("this should be recorded");
+ }
+
+ @Aggregated
+ public void doSomethingRecordedAndAggregated() {
+ System.out.println("This should be aggregated");
+ }
+
+}
Deleted: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/MainTestBean.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/MainTestBean.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/MainTestBean.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,63 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se.test.beans;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.enterprise.event.Observes;
-import javax.enterprise.inject.spi.AfterDeploymentValidation;
-import javax.inject.Inject;
-
-/**
- *
- * @author Peter Royle
- */
- at ApplicationScoped
-public class MainTestBean
-{
-
- boolean initialised = false;
- ParametersTestBean parametersTestBean;
-
- public MainTestBean()
- {
- }
-
- @Inject
- public MainTestBean(ParametersTestBean paramsTestBean)
- {
- this.initialised = true;
- this.parametersTestBean = paramsTestBean;
- // this call is important. It invokes initialiser on the proxy
- paramsTestBean.getParameters();
- }
-
- public void mainMethod(@Observes AfterDeploymentValidation after)
- {
- System.out.println("Starting main test app");
- }
-
- public ParametersTestBean getParametersTestBean()
- {
- return parametersTestBean;
- }
-
- public boolean isInitialised()
- {
- return initialised;
- }
-
-}
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/MainTestBean.java (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/MainTestBean.java)
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/MainTestBean.java (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/MainTestBean.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,63 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se.test.beans;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.AfterDeploymentValidation;
+import javax.inject.Inject;
+
+/**
+ *
+ * @author Peter Royle
+ */
+ at ApplicationScoped
+public class MainTestBean
+{
+
+ boolean initialised = false;
+ ParametersTestBean parametersTestBean;
+
+ public MainTestBean()
+ {
+ }
+
+ @Inject
+ public MainTestBean(ParametersTestBean paramsTestBean)
+ {
+ this.initialised = true;
+ this.parametersTestBean = paramsTestBean;
+ // this call is important. It invokes initialiser on the proxy
+ paramsTestBean.getParameters();
+ }
+
+ public void mainMethod(@Observes AfterDeploymentValidation after)
+ {
+ System.out.println("Starting main test app");
+ }
+
+ public ParametersTestBean getParametersTestBean()
+ {
+ return parametersTestBean;
+ }
+
+ public boolean isInitialised()
+ {
+ return initialised;
+ }
+
+}
Deleted: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/ObserverTestBean.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/ObserverTestBean.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/ObserverTestBean.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,93 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se.test.beans;
-
-import javax.enterprise.event.Observes;
-import javax.enterprise.inject.spi.AfterDeploymentValidation;
-import javax.enterprise.inject.spi.Extension;
-
-import org.jboss.weld.environment.se.events.ContainerInitialized;
-
-/**
- * Tests the observing of both built-in and application-specific events.
- *
- * @author Peter Royle
- */
-public class ObserverTestBean implements Extension
-{
-
- private static boolean builtInObserved = false;
- private static boolean customObserved = false;
- private static boolean initObserved = false;
-
- // TODO PLM injection isn't supported in extensions
- // @Inject MainTestBean bean;
-
- public ObserverTestBean()
- {
- }
-
- public void observeBuiltInEvent(@Observes AfterDeploymentValidation after)
- {
- builtInObserved = true;
- // assert this.bean == null;
- }
-
- public void observeCustomEvent(@Observes CustomEvent event)
- {
- customObserved = true;
- //assert this.bean != null;
- }
-
- public void observeInitEvent(@Observes ContainerInitialized event)
- {
- initObserved = true;
- //assert this.bean != null;
- }
-
- public static void reset()
- {
- customObserved = false;
- builtInObserved = false;
- initObserved = false;
- }
-
- /**
- * @return the observed
- */
- public static boolean isBuiltInObserved()
- {
- return builtInObserved;
- }
-
- /**
- * @return
- */
- public static boolean isCustomObserved()
- {
- return customObserved;
- }
-
- /**
- * @return
- */
- public static boolean isInitObserved()
- {
- return initObserved;
- }
-
-}
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/ObserverTestBean.java (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/ObserverTestBean.java)
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/ObserverTestBean.java (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/ObserverTestBean.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,93 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se.test.beans;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.AfterDeploymentValidation;
+import javax.enterprise.inject.spi.Extension;
+
+import org.jboss.weld.environment.se.events.ContainerInitialized;
+
+/**
+ * Tests the observing of both built-in and application-specific events.
+ *
+ * @author Peter Royle
+ */
+public class ObserverTestBean implements Extension
+{
+
+ private static boolean builtInObserved = false;
+ private static boolean customObserved = false;
+ private static boolean initObserved = false;
+
+ // TODO PLM injection isn't supported in extensions
+ // @Inject MainTestBean bean;
+
+ public ObserverTestBean()
+ {
+ }
+
+ public void observeBuiltInEvent(@Observes AfterDeploymentValidation after)
+ {
+ builtInObserved = true;
+ // assert this.bean == null;
+ }
+
+ public void observeCustomEvent(@Observes CustomEvent event)
+ {
+ customObserved = true;
+ //assert this.bean != null;
+ }
+
+ public void observeInitEvent(@Observes ContainerInitialized event)
+ {
+ initObserved = true;
+ //assert this.bean != null;
+ }
+
+ public static void reset()
+ {
+ customObserved = false;
+ builtInObserved = false;
+ initObserved = false;
+ }
+
+ /**
+ * @return the observed
+ */
+ public static boolean isBuiltInObserved()
+ {
+ return builtInObserved;
+ }
+
+ /**
+ * @return
+ */
+ public static boolean isCustomObserved()
+ {
+ return customObserved;
+ }
+
+ /**
+ * @return
+ */
+ public static boolean isInitObserved()
+ {
+ return initObserved;
+ }
+
+}
Deleted: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/ParametersTestBean.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/ParametersTestBean.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/ParametersTestBean.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,58 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.weld.environment.se.test.beans;
-
-import java.io.Serializable;
-import java.util.List;
-
-import javax.enterprise.context.ApplicationScoped;
-
-import javax.inject.Inject;
-
-import org.jboss.weld.environment.se.bindings.Parameters;
-import org.testng.Assert;
-
-/**
- *
- * @author Peter Royle
- */
- at ApplicationScoped
-public class ParametersTestBean implements Serializable
-{
-
- List<String> parameters;
-
- public ParametersTestBean()
- {
- }
-
- @Inject
- public ParametersTestBean(@Parameters List<String> params)
- {
- this.parameters = params;
- // even if no args are given, it should will always at least be an empty
- // array
- Assert.assertNotNull(params);
- }
-
- public List<String> getParameters()
- {
- return parameters;
- }
-
-}
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/ParametersTestBean.java (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/ParametersTestBean.java)
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/ParametersTestBean.java (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/ParametersTestBean.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,58 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.weld.environment.se.test.beans;
+
+import java.io.Serializable;
+import java.util.List;
+
+import javax.enterprise.context.ApplicationScoped;
+
+import javax.inject.Inject;
+
+import org.jboss.weld.environment.se.bindings.Parameters;
+import org.testng.Assert;
+
+/**
+ *
+ * @author Peter Royle
+ */
+ at ApplicationScoped
+public class ParametersTestBean implements Serializable
+{
+
+ List<String> parameters;
+
+ public ParametersTestBean()
+ {
+ }
+
+ @Inject
+ public ParametersTestBean(@Parameters List<String> params)
+ {
+ this.parameters = params;
+ // even if no args are given, it should will always at least be an empty
+ // array
+ Assert.assertNotNull(params);
+ }
+
+ public List<String> getParameters()
+ {
+ return parameters;
+ }
+
+}
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading)
Deleted: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/Counter.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/Counter.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/Counter.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,46 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se.test.beans.threading;
-
-import java.util.concurrent.atomic.AtomicInteger;
-
-/**
- * A simple, threadsafe counter which can be incremented and inspected.
- * @author Peter Royle
- */
-public abstract class Counter {
-
- AtomicInteger count = new AtomicInteger(0);
-
- public Counter() {
- }
-
- /**
- * Get the current value of the counter.
- */
- public int getCount() {
- return this.count.get();
- }
-
- /**
- * Increment and return the new value of counter.
- */
- public int increment() {
- return this.count.incrementAndGet();
- }
-
-}
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/Counter.java (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/Counter.java)
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/Counter.java (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/Counter.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,46 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se.test.beans.threading;
+
+import java.util.concurrent.atomic.AtomicInteger;
+
+/**
+ * A simple, threadsafe counter which can be incremented and inspected.
+ * @author Peter Royle
+ */
+public abstract class Counter {
+
+ AtomicInteger count = new AtomicInteger(0);
+
+ public Counter() {
+ }
+
+ /**
+ * Get the current value of the counter.
+ */
+ public int getCount() {
+ return this.count.get();
+ }
+
+ /**
+ * Increment and return the new value of counter.
+ */
+ public int increment() {
+ return this.count.incrementAndGet();
+ }
+
+}
Deleted: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/SingletonCounter.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/SingletonCounter.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/SingletonCounter.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,28 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se.test.beans.threading;
-
-import javax.inject.Singleton;
-
-/**
- * An application-scoped (singleton) counter.
- * @author Peter Royle
- */
- at Singleton
-public class SingletonCounter extends Counter {
-
-}
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/SingletonCounter.java (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/SingletonCounter.java)
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/SingletonCounter.java (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/SingletonCounter.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,28 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se.test.beans.threading;
+
+import javax.inject.Singleton;
+
+/**
+ * An application-scoped (singleton) counter.
+ * @author Peter Royle
+ */
+ at Singleton
+public class SingletonCounter extends Counter {
+
+}
Deleted: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/ThreadCounter.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/ThreadCounter.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/ThreadCounter.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,28 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se.test.beans.threading;
-
-import org.jboss.weld.environment.se.contexts.ThreadScoped;
-
-/**
- * A thread-scoped counter.
- * @author Peter Royle
- */
- at ThreadScoped
-public class ThreadCounter extends Counter {
-
-}
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/ThreadCounter.java (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/ThreadCounter.java)
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/ThreadCounter.java (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/ThreadCounter.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,28 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se.test.beans.threading;
+
+import org.jboss.weld.environment.se.contexts.ThreadScoped;
+
+/**
+ * A thread-scoped counter.
+ * @author Peter Royle
+ */
+ at ThreadScoped
+public class ThreadCounter extends Counter {
+
+}
Deleted: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/ThreadRunner.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/ThreadRunner.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/ThreadRunner.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,86 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se.test.beans.threading;
-
-import org.jboss.weld.environment.se.test.*;
-import java.util.ArrayList;
-import java.util.List;
-import javax.inject.Inject;
-
-import static org.testng.Assert.assertEquals;
-
-/**
- * An bean which implements Runnable and therefore can be run in a separate thread.
- * All such beans, when passed to Thread.start(), will be decorated by the
- * RunnableDecorator which will take care of making ThreadContext available to
- * that thread for resolution of @ThreadScoped beans.
- * @author Peter Royle
- */
-public class ThreadRunner implements Runnable
-{
-
- // an application scoped counter
- @Inject private SingletonCounter appCounter;
- // a thread scoped counter
- @Inject private ThreadCounter threadCounter;
- // a name for logging
- private String name = "Unnamed";
- // gather exceptions encountered for re-throwing in the test class
- private List<Exception> exceptions = new ArrayList<Exception>();
-
- /**
- * Run a loop, incrementing both the thread-scoped and application scoped
- * counters with each iteration.
- */
- public void run()
- {
- try
- {
-
- // Thread scoped counter should start at zero ...
- assertEquals(0, threadCounter.getCount());
-
- for (int loop = 1; loop <= ThreadContextTest.NUM_LOOPS; loop++)
- {
- final int appCount = appCounter.increment();
- final int threadCount = threadCounter.increment();
- System.out.println(name + " : " + appCount + ", " + threadCount);
- assertEquals(loop, threadCount);
- }
- // ... and end at the number of loops
- assertEquals(ThreadContextTest.NUM_LOOPS, threadCounter.getCount());
- } catch (Exception e)
- {
- this.exceptions.add(e);
- }
- }
-
- public String getName()
- {
- return name;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-
- public List<Exception> getExceptions()
- {
- return exceptions;
- }
-}
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/ThreadRunner.java (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/ThreadRunner.java)
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/ThreadRunner.java (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/beans/threading/ThreadRunner.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,86 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se.test.beans.threading;
+
+import org.jboss.weld.environment.se.test.*;
+import java.util.ArrayList;
+import java.util.List;
+import javax.inject.Inject;
+
+import static org.testng.Assert.assertEquals;
+
+/**
+ * An bean which implements Runnable and therefore can be run in a separate thread.
+ * All such beans, when passed to Thread.start(), will be decorated by the
+ * RunnableDecorator which will take care of making ThreadContext available to
+ * that thread for resolution of @ThreadScoped beans.
+ * @author Peter Royle
+ */
+public class ThreadRunner implements Runnable
+{
+
+ // an application scoped counter
+ @Inject private SingletonCounter appCounter;
+ // a thread scoped counter
+ @Inject private ThreadCounter threadCounter;
+ // a name for logging
+ private String name = "Unnamed";
+ // gather exceptions encountered for re-throwing in the test class
+ private List<Exception> exceptions = new ArrayList<Exception>();
+
+ /**
+ * Run a loop, incrementing both the thread-scoped and application scoped
+ * counters with each iteration.
+ */
+ public void run()
+ {
+ try
+ {
+
+ // Thread scoped counter should start at zero ...
+ assertEquals(0, threadCounter.getCount());
+
+ for (int loop = 1; loop <= ThreadContextTest.NUM_LOOPS; loop++)
+ {
+ final int appCount = appCounter.increment();
+ final int threadCount = threadCounter.increment();
+ System.out.println(name + " : " + appCount + ", " + threadCount);
+ assertEquals(loop, threadCount);
+ }
+ // ... and end at the number of loops
+ assertEquals(ThreadContextTest.NUM_LOOPS, threadCounter.getCount());
+ } catch (Exception e)
+ {
+ this.exceptions.add(e);
+ }
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public List<Exception> getExceptions()
+ {
+ return exceptions;
+ }
+}
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators)
Deleted: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/AbstractDoor.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/AbstractDoor.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/AbstractDoor.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,73 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se.test.decorators;
-
-/**
- * Represents door with a lock.
- * @author Peter Royle
- */
-public abstract class AbstractDoor implements Door
-{
-
- private boolean isOpen = false;
- private boolean isLocked = false;
-
- /**
- * Open and close the door. Can't open a locked door.
- */
- public boolean open()
- {
- if (!isLocked)
- {
- isOpen = true;
- }
- return isOpen;
- }
-
- public boolean close()
- {
- isOpen = false;
- return isOpen;
- }
-
- public boolean isOpen()
- {
- return isOpen;
- }
-
- /**
- * Lock and unlock the door. Can't lock an open door.
- */
- public boolean lock()
- {
- if (!isOpen)
- {
- isLocked = true;
- }
- return isLocked;
- }
-
- public void unlock()
- {
- isLocked = false;
- }
-
- public boolean isLocked()
- {
- return isLocked;
- }
-}
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/AbstractDoor.java (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/AbstractDoor.java)
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/AbstractDoor.java (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/AbstractDoor.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,73 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se.test.decorators;
+
+/**
+ * Represents door with a lock.
+ * @author Peter Royle
+ */
+public abstract class AbstractDoor implements Door
+{
+
+ private boolean isOpen = false;
+ private boolean isLocked = false;
+
+ /**
+ * Open and close the door. Can't open a locked door.
+ */
+ public boolean open()
+ {
+ if (!isLocked)
+ {
+ isOpen = true;
+ }
+ return isOpen;
+ }
+
+ public boolean close()
+ {
+ isOpen = false;
+ return isOpen;
+ }
+
+ public boolean isOpen()
+ {
+ return isOpen;
+ }
+
+ /**
+ * Lock and unlock the door. Can't lock an open door.
+ */
+ public boolean lock()
+ {
+ if (!isOpen)
+ {
+ isLocked = true;
+ }
+ return isLocked;
+ }
+
+ public void unlock()
+ {
+ isLocked = false;
+ }
+
+ public boolean isLocked()
+ {
+ return isLocked;
+ }
+}
Deleted: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/CarDoor.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/CarDoor.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/CarDoor.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,37 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.weld.environment.se.test.decorators;
-
-/**
- *
- * @author Peter Royle
- */
-public class CarDoor extends AbstractDoor {
-
- private boolean isWindowOpen = false;
-
- public boolean openWindow() {
- isWindowOpen = true;
- return isWindowOpen;
- }
- public boolean closeWindow() {
- isWindowOpen = false;
- return isWindowOpen;
- }
-
-}
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/CarDoor.java (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/CarDoor.java)
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/CarDoor.java (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/CarDoor.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,37 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.weld.environment.se.test.decorators;
+
+/**
+ *
+ * @author Peter Royle
+ */
+public class CarDoor extends AbstractDoor {
+
+ private boolean isWindowOpen = false;
+
+ public boolean openWindow() {
+ isWindowOpen = true;
+ return isWindowOpen;
+ }
+ public boolean closeWindow() {
+ isWindowOpen = false;
+ return isWindowOpen;
+ }
+
+}
Deleted: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/CarDoorAlarm.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/CarDoorAlarm.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/CarDoorAlarm.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,44 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se.test.decorators;
-
-import javax.decorator.Decorator;
-import javax.decorator.Delegate;
-import javax.inject.Inject;
-
-/**
- * Decorates a door so that an alarm is activated if the door is attempted
- * to be opened while it is locked.
- * @author Peter Royle
- */
- at Decorator
-public abstract class CarDoorAlarm implements Door
-{
-
- @Inject @Delegate CarDoor door;
- public static boolean alarmActivated = false;
-
- public boolean open()
- {
- if (door.isLocked())
- {
- alarmActivated = true;
- System.out.println("AWOOGA"); // (there's an emergency going on)
- }
- return door.open(); // lock will still be used
- }
-}
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/CarDoorAlarm.java (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/CarDoorAlarm.java)
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/CarDoorAlarm.java (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/CarDoorAlarm.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,44 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se.test.decorators;
+
+import javax.decorator.Decorator;
+import javax.decorator.Delegate;
+import javax.inject.Inject;
+
+/**
+ * Decorates a door so that an alarm is activated if the door is attempted
+ * to be opened while it is locked.
+ * @author Peter Royle
+ */
+ at Decorator
+public abstract class CarDoorAlarm implements Door
+{
+
+ @Inject @Delegate CarDoor door;
+ public static boolean alarmActivated = false;
+
+ public boolean open()
+ {
+ if (door.isLocked())
+ {
+ alarmActivated = true;
+ System.out.println("AWOOGA"); // (there's an emergency going on)
+ }
+ return door.open(); // lock will still be used
+ }
+}
Deleted: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/Door.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/Door.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/Door.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,44 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.weld.environment.se.test.decorators;
-
-/**
- *
- * @author Peter Royle
- */
-public interface Door {
-
- boolean close();
-
- boolean isLocked();
-
- boolean isOpen();
-
- /**
- * Lock and unlock the door. Can't lock an open door.
- */
- boolean lock();
-
- /**
- * Open and close the door. Can't open a locked door.
- */
- boolean open();
-
- void unlock();
-
-}
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/Door.java (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/Door.java)
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/Door.java (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/Door.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,44 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.weld.environment.se.test.decorators;
+
+/**
+ *
+ * @author Peter Royle
+ */
+public interface Door {
+
+ boolean close();
+
+ boolean isLocked();
+
+ boolean isOpen();
+
+ /**
+ * Lock and unlock the door. Can't lock an open door.
+ */
+ boolean lock();
+
+ /**
+ * Open and close the door. Can't open a locked door.
+ */
+ boolean open();
+
+ void unlock();
+
+}
Deleted: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/HouseDoor.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/HouseDoor.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/HouseDoor.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,26 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.weld.environment.se.test.decorators;
-
-/**
- *
- * @author Peter Royle
- */
-public class HouseDoor extends AbstractDoor {
-
-}
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/HouseDoor.java (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/HouseDoor.java)
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/HouseDoor.java (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/decorators/HouseDoor.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,26 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.weld.environment.se.test.decorators;
+
+/**
+ *
+ * @author Peter Royle
+ */
+public class HouseDoor extends AbstractDoor {
+
+}
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events)
Deleted: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/Bar.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/Bar.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/Bar.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,6 +0,0 @@
-package org.jboss.weld.environment.se.test.events;
-
-public class Bar
-{
-
-}
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/Bar.java (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/Bar.java)
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/Bar.java (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/Bar.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,6 @@
+package org.jboss.weld.environment.se.test.events;
+
+public class Bar
+{
+
+}
Deleted: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/EventQualifier1.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/EventQualifier1.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/EventQualifier1.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,37 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se.test.events;
-
-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.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import javax.inject.Qualifier;
-
-/**
- *
- * @author Peter Royle
- */
- at Qualifier
- at Retention(RUNTIME)
- at Target({ PARAMETER, METHOD, FIELD, TYPE })
-public @interface EventQualifier1 {}
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/EventQualifier1.java (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/EventQualifier1.java)
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/EventQualifier1.java (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/EventQualifier1.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,37 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se.test.events;
+
+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.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+/**
+ *
+ * @author Peter Royle
+ */
+ at Qualifier
+ at Retention(RUNTIME)
+ at Target({ PARAMETER, METHOD, FIELD, TYPE })
+public @interface EventQualifier1 {}
Deleted: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/EventQualifier2.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/EventQualifier2.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/EventQualifier2.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,37 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.environment.se.test.events;
-
-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.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import javax.inject.Qualifier;
-
-/**
- *
- * @author Peter Royle
- */
- at Qualifier
- at Retention(RUNTIME)
- at Target({ PARAMETER, METHOD, FIELD, TYPE })
-public @interface EventQualifier2 {}
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/EventQualifier2.java (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/EventQualifier2.java)
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/EventQualifier2.java (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/EventQualifier2.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,37 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.environment.se.test.events;
+
+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.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+/**
+ *
+ * @author Peter Royle
+ */
+ at Qualifier
+ at Retention(RUNTIME)
+ at Target({ PARAMETER, METHOD, FIELD, TYPE })
+public @interface EventQualifier2 {}
Deleted: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/Foo.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/Foo.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/Foo.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,47 +0,0 @@
-package org.jboss.weld.environment.se.test.events;
-
-import javax.enterprise.event.Event;
-import javax.enterprise.event.Observes;
-import javax.inject.Inject;
-
-import org.jboss.weld.environment.se.ShutdownManager;
-import org.jboss.weld.environment.se.events.ContainerInitialized;
-
-public class Foo
-{
-
- private static boolean observedEventTest;
- private static boolean observedContainerInitialized;
-
- public static void reset()
- {
- observedEventTest = false;
- observedContainerInitialized = false;
- }
-
- public static boolean isObservedContainerInitialized()
- {
- return observedContainerInitialized;
- }
-
- public static boolean isObservedEventTest()
- {
- return observedEventTest;
- }
-
- @Inject
- @EventQualifier1
- private Event<Bar> eventTest;
-
- public void start(@Observes ContainerInitialized event, ShutdownManager shutdownManager)
- {
- eventTest.fire(new Bar());
- observedContainerInitialized = true;
- }
-
- public void observeEventTest(@Observes @EventQualifier2 Bar eventTest)
- {
- observedEventTest = true;
- }
-
-}
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/Foo.java (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/Foo.java)
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/Foo.java (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/events/Foo.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,47 @@
+package org.jboss.weld.environment.se.test.events;
+
+import javax.enterprise.event.Event;
+import javax.enterprise.event.Observes;
+import javax.inject.Inject;
+
+import org.jboss.weld.environment.se.ShutdownManager;
+import org.jboss.weld.environment.se.events.ContainerInitialized;
+
+public class Foo
+{
+
+ private static boolean observedEventTest;
+ private static boolean observedContainerInitialized;
+
+ public static void reset()
+ {
+ observedEventTest = false;
+ observedContainerInitialized = false;
+ }
+
+ public static boolean isObservedContainerInitialized()
+ {
+ return observedContainerInitialized;
+ }
+
+ public static boolean isObservedEventTest()
+ {
+ return observedEventTest;
+ }
+
+ @Inject
+ @EventQualifier1
+ private Event<Bar> eventTest;
+
+ public void start(@Observes ContainerInitialized event, ShutdownManager shutdownManager)
+ {
+ eventTest.fire(new Bar());
+ observedContainerInitialized = true;
+ }
+
+ public void observeEventTest(@Observes @EventQualifier2 Bar eventTest)
+ {
+ observedEventTest = true;
+ }
+
+}
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors)
Deleted: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/Aggregated.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/Aggregated.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/Aggregated.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,36 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.weld.environment.se.test.interceptors;
-
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.ElementType.METHOD;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-import java.lang.annotation.Target;
-import javax.interceptor.InterceptorBinding;
-
-/**
- * Test annotation used to apply the AggregatingInterceptor to types and methods.
- * @author Peter Royle
- */
- at Inherited
- at InterceptorBinding
- at Target({TYPE, METHOD})
- at Retention(RUNTIME)
-public @interface Aggregated { }
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/Aggregated.java (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/Aggregated.java)
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/Aggregated.java (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/Aggregated.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,36 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.weld.environment.se.test.interceptors;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.METHOD;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+import javax.interceptor.InterceptorBinding;
+
+/**
+ * Test annotation used to apply the AggregatingInterceptor to types and methods.
+ * @author Peter Royle
+ */
+ at Inherited
+ at InterceptorBinding
+ at Target({TYPE, METHOD})
+ at Retention(RUNTIME)
+public @interface Aggregated { }
Deleted: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/AggregatingInterceptor.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/AggregatingInterceptor.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/AggregatingInterceptor.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,41 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.weld.environment.se.test.interceptors;
-
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.Interceptor;
-import javax.interceptor.InvocationContext;
-
-/**
- * @author Peter Royle
- */
- at Aggregated @Interceptor
-public class AggregatingInterceptor {
-
- public static int methodsCalled = 0;
-
- public AggregatingInterceptor() {
- methodsCalled = 0;
- }
-
- @AroundInvoke
- public Object recordMEthodCall(InvocationContext ctx) throws Exception {
- methodsCalled ++;
- return ctx.proceed();
- }
-}
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/AggregatingInterceptor.java (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/AggregatingInterceptor.java)
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/AggregatingInterceptor.java (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/AggregatingInterceptor.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,41 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.weld.environment.se.test.interceptors;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.Interceptor;
+import javax.interceptor.InvocationContext;
+
+/**
+ * @author Peter Royle
+ */
+ at Aggregated @Interceptor
+public class AggregatingInterceptor {
+
+ public static int methodsCalled = 0;
+
+ public AggregatingInterceptor() {
+ methodsCalled = 0;
+ }
+
+ @AroundInvoke
+ public Object recordMEthodCall(InvocationContext ctx) throws Exception {
+ methodsCalled ++;
+ return ctx.proceed();
+ }
+}
Deleted: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/Recorded.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/Recorded.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/Recorded.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,36 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.weld.environment.se.test.interceptors;
-
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.ElementType.METHOD;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-import java.lang.annotation.Target;
-import javax.interceptor.InterceptorBinding;
-
-/**
- * Test annotation used to apply the RecordingInterceptor to types and methods.
- * @author Peter Royle
- */
- at Inherited
- at InterceptorBinding
- at Target({TYPE, METHOD})
- at Retention(RUNTIME)
-public @interface Recorded { }
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/Recorded.java (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/Recorded.java)
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/Recorded.java (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/Recorded.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,36 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.weld.environment.se.test.interceptors;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.METHOD;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+import javax.interceptor.InterceptorBinding;
+
+/**
+ * Test annotation used to apply the RecordingInterceptor to types and methods.
+ * @author Peter Royle
+ */
+ at Inherited
+ at InterceptorBinding
+ at Target({TYPE, METHOD})
+ at Retention(RUNTIME)
+public @interface Recorded { }
Deleted: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/RecordingInterceptor.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/RecordingInterceptor.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/RecordingInterceptor.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,45 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.weld.environment.se.test.interceptors;
-
-import java.util.ArrayList;
-import java.util.List;
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.Interceptor;
-import javax.interceptor.InvocationContext;
-
-/**
- * @author Peter Royle
- */
- at Recorded @Interceptor
-public class RecordingInterceptor {
-
- public static List<String> methodsRecorded = new ArrayList<String>();
-
- public RecordingInterceptor() {
- methodsRecorded.clear();
- }
-
- @AroundInvoke
- public Object recordMethodCall(InvocationContext ctx) throws Exception {
- final String methodName = ctx.getMethod().getName();
- System.out.println("Recording method: " + methodName);
- methodsRecorded.add(methodName);
- return ctx.proceed();
- }
-}
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/RecordingInterceptor.java (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/RecordingInterceptor.java)
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/RecordingInterceptor.java (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/RecordingInterceptor.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,45 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.weld.environment.se.test.interceptors;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.Interceptor;
+import javax.interceptor.InvocationContext;
+
+/**
+ * @author Peter Royle
+ */
+ at Recorded @Interceptor
+public class RecordingInterceptor {
+
+ public static List<String> methodsRecorded = new ArrayList<String>();
+
+ public RecordingInterceptor() {
+ methodsRecorded.clear();
+ }
+
+ @AroundInvoke
+ public Object recordMethodCall(InvocationContext ctx) throws Exception {
+ final String methodName = ctx.getMethod().getName();
+ System.out.println("Recording method: " + methodName);
+ methodsRecorded.add(methodName);
+ return ctx.proceed();
+ }
+}
Deleted: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/Tracked.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/Tracked.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/Tracked.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,38 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.weld.environment.se.test.interceptors;
-
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.ElementType.METHOD;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-import java.lang.annotation.Target;
-import javax.interceptor.InterceptorBinding;
-
-/**
- * Test annotation used to apply both the RecordingInterceptor and the AggregatingInterceptor to types and methods.
- * @author Peter Royle
- */
- at Inherited
- at InterceptorBinding
- at Target({TYPE, METHOD})
- at Retention(RUNTIME)
- at Recorded
- at Aggregated
-public @interface Tracked { }
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/Tracked.java (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/Tracked.java)
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/Tracked.java (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/interceptors/Tracked.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,38 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.weld.environment.se.test.interceptors;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.METHOD;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+import javax.interceptor.InterceptorBinding;
+
+/**
+ * Test annotation used to apply both the RecordingInterceptor and the AggregatingInterceptor to types and methods.
+ * @author Peter Royle
+ */
+ at Inherited
+ at InterceptorBinding
+ at Target({TYPE, METHOD})
+ at Retention(RUNTIME)
+ at Recorded
+ at Aggregated
+public @interface Tracked { }
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/scopes (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/scopes)
Deleted: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/scopes/Bar.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/scopes/Bar.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/scopes/Bar.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,8 +0,0 @@
-package org.jboss.weld.environment.se.test.scopes;
-
-import javax.enterprise.context.Dependent;
-
- at Dependent
-public class Bar extends Foo
-{
-}
\ No newline at end of file
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/scopes/Bar.java (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/scopes/Bar.java)
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/scopes/Bar.java (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/scopes/Bar.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,8 @@
+package org.jboss.weld.environment.se.test.scopes;
+
+import javax.enterprise.context.Dependent;
+
+ at Dependent
+public class Bar extends Foo
+{
+}
\ No newline at end of file
Deleted: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/scopes/Foo.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/scopes/Foo.java 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/scopes/Foo.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,8 +0,0 @@
-package org.jboss.weld.environment.se.test.scopes;
-
-import javax.enterprise.context.RequestScoped;
-
- at RequestScoped
-public class Foo
-{
-}
\ No newline at end of file
Copied: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/scopes/Foo.java (from rev 6914, java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/scopes/Foo.java)
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/scopes/Foo.java (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/scopes/Foo.java 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,8 @@
+package org.jboss.weld.environment.se.test.scopes;
+
+import javax.enterprise.context.RequestScoped;
+
+ at RequestScoped
+public class Foo
+{
+}
\ No newline at end of file
Copied: java-se/trunk/src/test/resources (from rev 6914, java-se/trunk/src/test/resources)
Copied: java-se/trunk/src/test/resources/META-INF (from rev 6914, java-se/trunk/src/test/resources/META-INF)
Deleted: java-se/trunk/src/test/resources/META-INF/beans.xml
===================================================================
--- java-se/trunk/src/test/resources/META-INF/beans.xml 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/test/resources/META-INF/beans.xml 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1,28 +0,0 @@
-<!--
-
- JBoss, Home of Professional Open Source
- Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
- contributors by the @authors tag. See the copyright.txt in the
- distribution for a full listing of individual contributors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-<beans>
- <interceptors>
- <class>org.jboss.weld.environment.se.test.interceptors.RecordingInterceptor</class>
- <class>org.jboss.weld.environment.se.test.interceptors.AggregatingInterceptor</class>
- </interceptors>
- <decorators>
- <class>org.jboss.weld.environment.se.test.decorators.CarDoorAlarm</class>
- <class>org.jboss.weld.environment.se.threading.RunnableDecorator</class>
- </decorators>
-</beans>
Copied: java-se/trunk/src/test/resources/META-INF/beans.xml (from rev 6914, java-se/trunk/src/test/resources/META-INF/beans.xml)
===================================================================
--- java-se/trunk/src/test/resources/META-INF/beans.xml (rev 0)
+++ java-se/trunk/src/test/resources/META-INF/beans.xml 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1,28 @@
+<!--
+
+ JBoss, Home of Professional Open Source
+ Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ contributors by the @authors tag. See the copyright.txt in the
+ distribution for a full listing of individual contributors.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<beans>
+ <interceptors>
+ <class>org.jboss.weld.environment.se.test.interceptors.RecordingInterceptor</class>
+ <class>org.jboss.weld.environment.se.test.interceptors.AggregatingInterceptor</class>
+ </interceptors>
+ <decorators>
+ <class>org.jboss.weld.environment.se.test.decorators.CarDoorAlarm</class>
+ <class>org.jboss.weld.environment.se.threading.RunnableDecorator</class>
+ </decorators>
+</beans>
Copied: java-se/trunk/src/test/resources/META-INF/services (from rev 6914, java-se/trunk/src/test/resources/META-INF/services)
Deleted: java-se/trunk/src/test/resources/META-INF/services/javax.enterprise.inject.spi.Extension
===================================================================
--- java-se/trunk/src/test/resources/META-INF/services/javax.enterprise.inject.spi.Extension 2010-08-05 16:54:04 UTC (rev 6914)
+++ java-se/trunk/src/test/resources/META-INF/services/javax.enterprise.inject.spi.Extension 2010-08-05 22:17:21 UTC (rev 6940)
@@ -1 +0,0 @@
-org.jboss.weld.environment.se.test.beans.ObserverTestBean
Copied: java-se/trunk/src/test/resources/META-INF/services/javax.enterprise.inject.spi.Extension (from rev 6914, java-se/trunk/src/test/resources/META-INF/services/javax.enterprise.inject.spi.Extension)
===================================================================
--- java-se/trunk/src/test/resources/META-INF/services/javax.enterprise.inject.spi.Extension (rev 0)
+++ java-se/trunk/src/test/resources/META-INF/services/javax.enterprise.inject.spi.Extension 2010-08-05 22:17:21 UTC (rev 6940)
@@ -0,0 +1 @@
+org.jboss.weld.environment.se.test.beans.ObserverTestBean
More information about the weld-commits
mailing list