[jboss-cvs] JBossAS SVN: r106123 - in projects/demos/microcontainer/trunk: opojo/src/main/resources/META-INF and 12 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Jun 17 11:52:23 EDT 2010
Author: alesj
Date: 2010-06-17 11:52:22 -0400 (Thu, 17 Jun 2010)
New Revision: 106123
Added:
projects/demos/microcontainer/trunk/wpojo/
projects/demos/microcontainer/trunk/wpojo/pom.xml
projects/demos/microcontainer/trunk/wpojo/src/
projects/demos/microcontainer/trunk/wpojo/src/main/
projects/demos/microcontainer/trunk/wpojo/src/main/java/
projects/demos/microcontainer/trunk/wpojo/src/main/java/org/
projects/demos/microcontainer/trunk/wpojo/src/main/java/org/jboss/
projects/demos/microcontainer/trunk/wpojo/src/main/java/org/jboss/demos/
projects/demos/microcontainer/trunk/wpojo/src/main/java/org/jboss/demos/wpojo/
projects/demos/microcontainer/trunk/wpojo/src/main/java/org/jboss/demos/wpojo/Lottery.java
projects/demos/microcontainer/trunk/wpojo/src/main/java/org/jboss/demos/wpojo/OfficeBox.java
projects/demos/microcontainer/trunk/wpojo/src/main/java/org/jboss/demos/wpojo/Winner.java
projects/demos/microcontainer/trunk/wpojo/src/main/java/org/jboss/demos/wpojo/teams/
projects/demos/microcontainer/trunk/wpojo/src/main/java/org/jboss/demos/wpojo/teams/England.java
projects/demos/microcontainer/trunk/wpojo/src/main/java/org/jboss/demos/wpojo/teams/Slovenia.java
projects/demos/microcontainer/trunk/wpojo/src/main/resources/
projects/demos/microcontainer/trunk/wpojo/src/main/resources/META-INF/
projects/demos/microcontainer/trunk/wpojo/src/main/resources/META-INF/beans.xml
projects/demos/microcontainer/trunk/wpojo/src/main/resources/META-INF/teams-beans.xml
Modified:
projects/demos/microcontainer/trunk/opojo/src/main/resources/META-INF/service-mix-beans.xml
projects/demos/microcontainer/trunk/weld/pom.xml
Log:
Weld pojos.
Modified: projects/demos/microcontainer/trunk/opojo/src/main/resources/META-INF/service-mix-beans.xml
===================================================================
--- projects/demos/microcontainer/trunk/opojo/src/main/resources/META-INF/service-mix-beans.xml 2010-06-17 15:39:59 UTC (rev 106122)
+++ projects/demos/microcontainer/trunk/opojo/src/main/resources/META-INF/service-mix-beans.xml 2010-06-17 15:52:22 UTC (rev 106123)
@@ -9,7 +9,7 @@
<bean name="WorldCup" class="org.jboss.demos.opojo.impl.WorldCupImpl">
<constructor>
- <parameter><inject bean="Lottery" property="winner"/></parameter>
+ <parameter><inject bean="OfficeBox" property="winner"/></parameter>
</constructor>
</bean>
Modified: projects/demos/microcontainer/trunk/weld/pom.xml
===================================================================
--- projects/demos/microcontainer/trunk/weld/pom.xml 2010-06-17 15:39:59 UTC (rev 106122)
+++ projects/demos/microcontainer/trunk/weld/pom.xml 2010-06-17 15:52:22 UTC (rev 106123)
@@ -39,6 +39,10 @@
<artifactId>weld-core</artifactId>
</dependency>
<dependency>
+ <groupId>org.jboss.kernel</groupId>
+ <artifactId>jboss-weld-int</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.jboss.jbossas</groupId>
<artifactId>weld-int-ejb</artifactId>
</dependency>
Added: projects/demos/microcontainer/trunk/wpojo/pom.xml
===================================================================
--- projects/demos/microcontainer/trunk/wpojo/pom.xml (rev 0)
+++ projects/demos/microcontainer/trunk/wpojo/pom.xml 2010-06-17 15:52:22 UTC (rev 106123)
@@ -0,0 +1,31 @@
+<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>
+ <groupId>org.jboss.demos</groupId>
+ <artifactId>jboss-demos</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.demos</groupId>
+ <artifactId>jboss-demos-wpojo</artifactId>
+ <packaging>jar</packaging>
+ <name>JBoss MC Demos WPojo</name>
+ <url>http://www.jboss.org/jbossmc</url>
+ <description>JBoss MC Demos WPojo</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.demos</groupId>
+ <artifactId>jboss-demos-opojo</artifactId>
+ </dependency>
+ <!-- Compile (global dependencies) -->
+ <dependency>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.kernel</groupId>
+ <artifactId>jboss-weld-int</artifactId>
+ </dependency>
+ </dependencies>
+
+</project>
\ No newline at end of file
Added: projects/demos/microcontainer/trunk/wpojo/src/main/java/org/jboss/demos/wpojo/Lottery.java
===================================================================
--- projects/demos/microcontainer/trunk/wpojo/src/main/java/org/jboss/demos/wpojo/Lottery.java (rev 0)
+++ projects/demos/microcontainer/trunk/wpojo/src/main/java/org/jboss/demos/wpojo/Lottery.java 2010-06-17 15:52:22 UTC (rev 106123)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.demos.wpojo;
+
+import javax.enterprise.inject.Instance;
+import javax.enterprise.inject.Produces;
+import javax.inject.Inject;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+
+import org.jboss.demos.opojo.api.Team;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class Lottery
+{
+ private Instance<Team> teams;
+
+ @Produces @Winner
+ public Team winner()
+ {
+ List<Team> list = new ArrayList<Team>();
+ for (Team t : teams)
+ list.add(t);
+
+ Random r = new Random();
+ int x = r.nextInt(list.size());
+ return list.get(x);
+ }
+
+ @Inject
+ public void setTeams(Instance<Team> teams)
+ {
+ this.teams = teams;
+ }
+}
Added: projects/demos/microcontainer/trunk/wpojo/src/main/java/org/jboss/demos/wpojo/OfficeBox.java
===================================================================
--- projects/demos/microcontainer/trunk/wpojo/src/main/java/org/jboss/demos/wpojo/OfficeBox.java (rev 0)
+++ projects/demos/microcontainer/trunk/wpojo/src/main/java/org/jboss/demos/wpojo/OfficeBox.java 2010-06-17 15:52:22 UTC (rev 106123)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.demos.wpojo;
+
+import javax.inject.Inject;
+
+import org.jboss.demos.opojo.api.Team;
+import org.jboss.kernel.weld.metadata.api.annotations.Weld;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class OfficeBox
+{
+ private Team winner;
+
+ @Weld @Inject
+ public void setWinner(@Winner Team winner)
+ {
+ this.winner = winner;
+ }
+
+ public Team getWinner()
+ {
+ return winner;
+ }
+}
\ No newline at end of file
Added: projects/demos/microcontainer/trunk/wpojo/src/main/java/org/jboss/demos/wpojo/Winner.java
===================================================================
--- projects/demos/microcontainer/trunk/wpojo/src/main/java/org/jboss/demos/wpojo/Winner.java (rev 0)
+++ projects/demos/microcontainer/trunk/wpojo/src/main/java/org/jboss/demos/wpojo/Winner.java 2010-06-17 15:52:22 UTC (rev 106123)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.demos.wpojo;
+
+import javax.inject.Qualifier;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+ at Qualifier
+ at Target({ElementType.TYPE, ElementType.METHOD, ElementType.PARAMETER})
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface Winner
+{
+}
Added: projects/demos/microcontainer/trunk/wpojo/src/main/java/org/jboss/demos/wpojo/teams/England.java
===================================================================
--- projects/demos/microcontainer/trunk/wpojo/src/main/java/org/jboss/demos/wpojo/teams/England.java (rev 0)
+++ projects/demos/microcontainer/trunk/wpojo/src/main/java/org/jboss/demos/wpojo/teams/England.java 2010-06-17 15:52:22 UTC (rev 106123)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.demos.wpojo.teams;
+
+import org.jboss.demos.opojo.api.AbstractTeam;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class England extends AbstractTeam
+{
+ public String name()
+ {
+ return "England";
+ }
+
+ public String captain()
+ {
+ return "Steven Gerrard";
+ }
+
+ public String bestPlayer()
+ {
+ return "Wayne Rooney";
+ }
+
+ public String coach()
+ {
+ return "Fabio Capello";
+ }
+}
\ No newline at end of file
Added: projects/demos/microcontainer/trunk/wpojo/src/main/java/org/jboss/demos/wpojo/teams/Slovenia.java
===================================================================
--- projects/demos/microcontainer/trunk/wpojo/src/main/java/org/jboss/demos/wpojo/teams/Slovenia.java (rev 0)
+++ projects/demos/microcontainer/trunk/wpojo/src/main/java/org/jboss/demos/wpojo/teams/Slovenia.java 2010-06-17 15:52:22 UTC (rev 106123)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.demos.wpojo.teams;
+
+import org.jboss.demos.opojo.api.AbstractTeam;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class Slovenia extends AbstractTeam
+{
+ public String name()
+ {
+ return "Slovenia";
+ }
+
+ public String captain()
+ {
+ return "Robert Koren";
+ }
+
+ public String bestPlayer()
+ {
+ return "Mile Novakovic";
+ }
+
+ public String coach()
+ {
+ return "Matjaz Kek";
+ }
+}
Added: projects/demos/microcontainer/trunk/wpojo/src/main/resources/META-INF/beans.xml
===================================================================
--- projects/demos/microcontainer/trunk/wpojo/src/main/resources/META-INF/beans.xml (rev 0)
+++ projects/demos/microcontainer/trunk/wpojo/src/main/resources/META-INF/beans.xml 2010-06-17 15:52:22 UTC (rev 106123)
@@ -0,0 +1,5 @@
+<beans
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+</beans>
Added: projects/demos/microcontainer/trunk/wpojo/src/main/resources/META-INF/teams-beans.xml
===================================================================
--- projects/demos/microcontainer/trunk/wpojo/src/main/resources/META-INF/teams-beans.xml (rev 0)
+++ projects/demos/microcontainer/trunk/wpojo/src/main/resources/META-INF/teams-beans.xml 2010-06-17 15:52:22 UTC (rev 106123)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="OfficeBox" class="org.jboss.demos.wpojo.OfficeBox"/>
+
+</deployment>
More information about the jboss-cvs-commits
mailing list