[webbeans-commits] Webbeans SVN: r706 - doc/trunk/reference/en/modules.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-12-24 12:23:39 -0500 (Wed, 24 Dec 2008)
New Revision: 706
Modified:
doc/trunk/reference/en/modules/ri-spi.xml
Log:
WBRI-72
Modified: doc/trunk/reference/en/modules/ri-spi.xml
===================================================================
--- doc/trunk/reference/en/modules/ri-spi.xml 2008-12-24 17:22:38 UTC (rev 705)
+++ doc/trunk/reference/en/modules/ri-spi.xml 2008-12-24 17:23:39 UTC (rev 706)
@@ -97,7 +97,7 @@
*
* @return An iterator over the remove methods
*/
- public Iterable<MethodDescriptor> getRemoveMethods();
+ public Iterable<Method> getRemoveMethods();
/**
* Indicates if the bean is stateless
@@ -147,10 +147,7 @@
The contract described the JavaDoc is enough to implement
an EJBDescriptor. In addition to these two interfaces, there is
<literal>BusinessInterfaceDescriptor</literal> which represents a local
- business interface (encapsulating the interface class and jndi name), and
- <literal>MethodDescriptor</literal> which encapsulates the method name
- and parameter types (allowing it to be invoked on any instance of the
- EJB, proxy or otherwise).
+ business interface (encapsulating the interface class and jndi name).
</para>
<para>
16 years
[webbeans-commits] Webbeans SVN: r705 - ri/trunk/webbeans-ri.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-12-24 12:22:38 -0500 (Wed, 24 Dec 2008)
New Revision: 705
Modified:
ri/trunk/webbeans-ri/
Log:
ignores
Property changes on: ri/trunk/webbeans-ri
___________________________________________________________________
Name: svn:ignore
- .classpath
.project
target
cobertura.ser
.settings
+ .classpath
.project
target
cobertura.ser
.settings
test-output
temp-testng-customsuite.xml
16 years
[webbeans-commits] Webbeans SVN: r704 - in ri/trunk: webbeans-ri and 5 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-12-24 12:20:12 -0500 (Wed, 24 Dec 2008)
New Revision: 704
Removed:
ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/bootstrap/spi/MethodDescriptor.java
Modified:
ri/trunk/webbeans-api/
ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/bootstrap/spi/EjbDescriptor.java
ri/trunk/webbeans-ri/
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedClass.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedType.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedType.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockEjbDescriptor.java
Log:
WBRI-72
Property changes on: ri/trunk/webbeans-api
___________________________________________________________________
Name: svn:ignore
- .classpath
.project
target
cobertura.ser
+ .classpath
.project
target
cobertura.ser
.settings
Property changes on: ri/trunk/webbeans-ri
___________________________________________________________________
Name: svn:ignore
- .project
.classpath
target
test-output
temp-testng-customsuite.xml
ObjectStore
+ .classpath
.project
target
cobertura.ser
.settings
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2008-12-24 17:17:44 UTC (rev 703)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2008-12-24 17:20:12 UTC (rev 704)
@@ -17,6 +17,7 @@
package org.jboss.webbeans.bean;
+import java.lang.reflect.Method;
import java.util.HashSet;
import java.util.Set;
@@ -36,7 +37,6 @@
import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.bootstrap.spi.EjbDescriptor;
-import org.jboss.webbeans.bootstrap.spi.MethodDescriptor;
import org.jboss.webbeans.contexts.DependentContext;
import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.introspector.AnnotatedMethod;
@@ -185,10 +185,9 @@
if (getAnnotatedItem().getAnnotatedMethods(Destructor.class).size() == 1)
{
AnnotatedMethod<?> destructorMethod = getAnnotatedItem().getAnnotatedMethods(Destructor.class).iterator().next();
- for (MethodDescriptor removeMethod : ejbDescriptor.getRemoveMethods())
+ for (Method removeMethod : ejbDescriptor.getRemoveMethods())
{
- AnnotatedMethod<?> annotatedRemoveMethod = getAnnotatedItem().getMethod(removeMethod);
- if (annotatedRemoveMethod != null && annotatedRemoveMethod.equals(destructorMethod))
+ if (removeMethod != null && destructorMethod.isEquivalent(removeMethod))
{
this.removeMethod = destructorMethod;
return;
@@ -196,8 +195,14 @@
}
throw new DefinitionException("Method annotated @Destructor is not an EJB remove method on " + toString());
}
- // <1 (0) @Destructors
- Set<MethodDescriptor> noArgsRemoveMethods = getNoArgsRemoveMethods(ejbDescriptor);
+ Set<Method> noArgsRemoveMethods = new HashSet<Method>();
+ for (Method removeMethod : ejbDescriptor.getRemoveMethods())
+ {
+ if (removeMethod.getParameterTypes().length == 0)
+ {
+ noArgsRemoveMethods.add(removeMethod);
+ }
+ }
if (noArgsRemoveMethods.size() == 1)
{
this.removeMethod = annotatedItem.getMethod(noArgsRemoveMethods.iterator().next());
@@ -210,19 +215,6 @@
}
}
-
- private static Set<MethodDescriptor> getNoArgsRemoveMethods(EjbDescriptor<?> ejbDescriptor)
- {
- Set<MethodDescriptor> noArgsRemoveMethods = new HashSet<MethodDescriptor>();
- for (MethodDescriptor removeMethod : ejbDescriptor.getRemoveMethods())
- {
- if (removeMethod.getMethodParameterTypes().length == 0)
- {
- noArgsRemoveMethods.add(removeMethod);
- }
- }
- return noArgsRemoveMethods;
- }
/**
* Validates the remove method
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedClass.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedClass.java 2008-12-24 17:17:44 UTC (rev 703)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedClass.java 2008-12-24 17:20:12 UTC (rev 704)
@@ -18,11 +18,10 @@
package org.jboss.webbeans.introspector;
import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
import java.util.List;
import java.util.Set;
-import org.jboss.webbeans.bootstrap.spi.MethodDescriptor;
-
/**
* Represents a Class
*
@@ -97,7 +96,7 @@
* @param methodDescriptor
* @return
*/
- public AnnotatedMethod<Object> getMethod(MethodDescriptor methodDescriptor);
+ public AnnotatedMethod<Object> getMethod(Method method);
/**
* Gets all with parameters annotated with annotationType
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java 2008-12-24 17:17:44 UTC (rev 703)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java 2008-12-24 17:20:12 UTC (rev 704)
@@ -29,8 +29,8 @@
import javax.webbeans.AfterTransactionSuccess;
import javax.webbeans.BeforeTransactionCompletion;
import javax.webbeans.Disposes;
+import javax.webbeans.Fires;
import javax.webbeans.IfExists;
-import javax.webbeans.Fires;
import javax.webbeans.Observes;
import javax.webbeans.manager.Manager;
@@ -119,5 +119,13 @@
* @return The name
*/
public String getPropertyName();
+
+ /**
+ * Checks if a this is equivalent to a JLR method
+ *
+ * @param method The JLR method
+ * @return true if equivalent
+ */
+ public boolean isEquivalent(Method method);
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedType.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedType.java 2008-12-24 17:17:44 UTC (rev 703)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedType.java 2008-12-24 17:20:12 UTC (rev 704)
@@ -33,5 +33,12 @@
* @return The abstracted superclass
*/
public AnnotatedType<Object> getSuperclass();
+
+ /**
+ * Check if this is equivalent to a java class
+ * @param clazz The Java class
+ * @return true if equivalent
+ */
+ public boolean isEquivalent(Class<?> clazz);
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedType.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedType.java 2008-12-24 17:17:44 UTC (rev 703)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedType.java 2008-12-24 17:20:12 UTC (rev 704)
@@ -104,6 +104,11 @@
{
return superclass;
}
+
+ public boolean isEquivalent(Class<?> clazz)
+ {
+ return getDelegate().equals(clazz);
+ }
/**
* Gets a string representation of the type
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java 2008-12-24 17:17:44 UTC (rev 703)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java 2008-12-24 17:20:12 UTC (rev 704)
@@ -31,7 +31,6 @@
import java.util.Map;
import java.util.Set;
-import org.jboss.webbeans.bootstrap.spi.MethodDescriptor;
import org.jboss.webbeans.introspector.AnnotatedClass;
import org.jboss.webbeans.introspector.AnnotatedConstructor;
import org.jboss.webbeans.introspector.AnnotatedField;
@@ -505,12 +504,12 @@
return methodsByAnnotatedParameters.get(annotationType);
}
- public AnnotatedMethod<Object> getMethod(MethodDescriptor methodDescriptor)
+ public AnnotatedMethod<Object> getMethod(Method methodDescriptor)
{
// TODO Cache?
for (AnnotatedMethod<Object> annotatedMethod : methods)
{
- if (annotatedMethod.getName().equals(methodDescriptor.getMethodName()) && Arrays.equals(annotatedMethod.getParameterTypesAsArray(), methodDescriptor.getMethodParameterTypes()))
+ if (annotatedMethod.getName().equals(methodDescriptor.getName()) && Arrays.equals(annotatedMethod.getParameterTypesAsArray(), methodDescriptor.getParameterTypes()))
{
return annotatedMethod;
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java 2008-12-24 17:17:44 UTC (rev 703)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java 2008-12-24 17:20:12 UTC (rev 704)
@@ -222,6 +222,11 @@
return false;
}
}
+
+ public boolean isEquivalent(Method method)
+ {
+ return this.getDeclaringClass().isEquivalent(method.getDeclaringClass()) && this.getName().equals(method.getName()) && Arrays.equals(this.getParameterTypesAsArray(), method.getParameterTypes());
+ }
/**
* Gets the hash code (of the delegate)
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockEjbDescriptor.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockEjbDescriptor.java 2008-12-24 17:17:44 UTC (rev 703)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockEjbDescriptor.java 2008-12-24 17:20:12 UTC (rev 704)
@@ -13,7 +13,6 @@
import org.jboss.webbeans.bootstrap.spi.BusinessInterfaceDescriptor;
import org.jboss.webbeans.bootstrap.spi.EjbDescriptor;
-import org.jboss.webbeans.bootstrap.spi.MethodDescriptor;
import org.jboss.webbeans.test.annotations.Singleton;
public class MockEjbDescriptor<T> implements EjbDescriptor<T>
@@ -21,7 +20,7 @@
private final Class<T> type;
private final String ejbName;
private final List<BusinessInterfaceDescriptor<?>> localInterfaces;
- private final HashSet<MethodDescriptor> removeMethods;
+ private final HashSet<Method> removeMethods;
public MockEjbDescriptor(final Class<T> type)
{
@@ -46,31 +45,12 @@
});
}
- this.removeMethods = new HashSet<MethodDescriptor>();
+ this.removeMethods = new HashSet<Method>();
for (final Method method : type.getMethods())
{
if (method.isAnnotationPresent(Remove.class))
{
- removeMethods.add(new MethodDescriptor()
- {
-
- public String getMethodName()
- {
- return method.getName();
- }
-
- public Class<?>[] getMethodParameterTypes()
- {
- return method.getParameterTypes();
- }
-
- @Override
- public String toString()
- {
- return method.toString();
- }
-
- });
+ removeMethods.add(method);
}
}
}
@@ -90,7 +70,7 @@
return Collections.emptyList();
}
- public Iterable<MethodDescriptor> getRemoveMethods()
+ public Iterable<Method> getRemoveMethods()
{
return removeMethods;
Modified: ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/bootstrap/spi/EjbDescriptor.java
===================================================================
--- ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/bootstrap/spi/EjbDescriptor.java 2008-12-24 17:17:44 UTC (rev 703)
+++ ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/bootstrap/spi/EjbDescriptor.java 2008-12-24 17:20:12 UTC (rev 704)
@@ -17,7 +17,9 @@
package org.jboss.webbeans.bootstrap.spi;
+import java.lang.reflect.Method;
+
/**
* EJB metadata from the EJB descriptor
*
@@ -54,7 +56,7 @@
*
* @return An iterator over the remove methods
*/
- public Iterable<MethodDescriptor> getRemoveMethods();
+ public Iterable<Method> getRemoveMethods();
/**
* Indicates if the bean is stateless
Deleted: ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/bootstrap/spi/MethodDescriptor.java
===================================================================
--- ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/bootstrap/spi/MethodDescriptor.java 2008-12-24 17:17:44 UTC (rev 703)
+++ ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/bootstrap/spi/MethodDescriptor.java 2008-12-24 17:20:12 UTC (rev 704)
@@ -1,10 +0,0 @@
-package org.jboss.webbeans.bootstrap.spi;
-
-public interface MethodDescriptor
-{
-
- public String getMethodName();
-
- public Class<?>[] getMethodParameterTypes();
-
-}
16 years
[webbeans-commits] Webbeans SVN: r702 - ri/trunk.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-12-24 10:53:53 -0500 (Wed, 24 Dec 2008)
New Revision: 702
Modified:
ri/trunk/pom.xml
ri/trunk/readme.txt
Log:
update POM to use project.version for sub modules
Modified: ri/trunk/pom.xml
===================================================================
--- ri/trunk/pom.xml 2008-12-24 15:53:21 UTC (rev 701)
+++ ri/trunk/pom.xml 2008-12-24 15:53:53 UTC (rev 702)
@@ -61,7 +61,6 @@
<modules>
<module>webbeans-api</module>
<module>webbeans-ri</module>
-
<module>webbeans-ri-spi</module>
</modules>
@@ -174,20 +173,20 @@
<groupId>org.jboss.webbeans</groupId>
<artifactId>webbeans-api</artifactId>
- <version>${webbeans.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.webbeans</groupId>
<artifactId>webbeans-ri</artifactId>
- <version>${webbeans.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.webbeans</groupId>
<artifactId>webbeans-ri-spi</artifactId>
- <version>${webbeans.version}</version>
+ <version>${project.version}</version>
</dependency>
</dependencies>
@@ -372,8 +371,4 @@
</reporting>
- <properties>
- <webbeans.version>1.0.0.ALPHA1</webbeans.version>
- </properties>
-
-</project>
\ No newline at end of file
+</project>
Modified: ri/trunk/readme.txt
===================================================================
--- ri/trunk/readme.txt 2008-12-24 15:53:21 UTC (rev 701)
+++ ri/trunk/readme.txt 2008-12-24 15:53:53 UTC (rev 702)
@@ -12,7 +12,7 @@
the reference guide
jboss-as/
- -- Installer for JBoss AS, change into this directory, and run ant install
+ -- Installer for JBoss AS, change into this directory, and run ant update
There are more details in the reference guide
lib/
16 years
[webbeans-commits] Webbeans SVN: r701 - doc/trunk/reference/en/modules.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-12-24 10:53:21 -0500 (Wed, 24 Dec 2008)
New Revision: 701
Modified:
doc/trunk/reference/en/modules/ri.xml
Log:
update docs for numberguess changes
Modified: doc/trunk/reference/en/modules/ri.xml
===================================================================
--- doc/trunk/reference/en/modules/ri.xml 2008-12-24 15:45:50 UTC (rev 700)
+++ doc/trunk/reference/en/modules/ri.xml 2008-12-24 15:53:21 UTC (rev 701)
@@ -298,8 +298,8 @@
<area id="messages" coords="12" />
<area id="instructions" coords="19" />
<area id="guess" coords="25" />
- <area id="validator" coords="29" />
- <area id="submit" coords="32" />
+ <area id="validator" coords="30" />
+ <area id="submit" coords="33" />
</areaspec>
<programlisting><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
@@ -314,8 +314,8 @@
<h:form id="NumberGuessMain">
<div style="color: red">
<h:messages id="messages" globalOnly="false"/>
- <h:outputText id="Higher" value="Higher!" rendered="#{game.number gt game.guess}"/>
- <h:outputText id="Lower" value="Lower!" rendered="#{game.number lt game.guess}"/>
+ <h:outputText id="Higher" value="Higher!" rendered="#{game.number gt game.guess and game.guess ne 0}"/>
+ <h:outputText id="Lower" value="Lower!" rendered="#{game.number lt game.guess and game.guess ne 0}"/>
</div>
<div>
@@ -328,15 +328,19 @@
<h:inputText id="inputGuess"
value="#{game.guess}"
required="true"
- size="3">
+ size="3"
+ disabled="#{game.number eq game.guess}">
<f:validateLongRange maximum="#{game.biggest}"
minimum="#{game.smallest}"/>
</h:inputText>
- <h:commandButton id="GuessButton"
+ <h:commandButton id="GuessButton"
value="Guess"
- action="#{game.check}"/>
+ action="#{game.check}"
+ disabled="#{game.number eq game.guess}"/>
</div>
-
+ <div>
+ <h:commandButton id="RestartButton" value="Reset" action="#{game.reset}" immediate="true" />
+ </div>
</h:form>
</ui:define>
</ui:composition>
@@ -445,22 +449,34 @@
<para>
The final Web Bean in the application is the session scoped
- <literal>Game</literal>. By making <literal>Game</literal> session
- scoped, you can only play the game once per browser session. You could
- easily add a reset button - a good exercise for the reader :-)
+ <literal>Game</literal>.
</para>
<para>
- You'll also note that we've used the <literal>@Named</literal>
+ You'll note that we've used the <literal>@Named</literal>
annotation, so that we can use the bean through EL in the JSF page.
Finally, we've used constructor injection to initialize the game with
a random number. And of course, we need to tell the player when they've
won, so we give feedback with a <literal>FacesMessage</literal>.
</para>
- <programlisting role="JAVA"><![CDATA[@Named
+ <programlisting role="JAVA"><![CDATA[package org.jboss.webbeans.examples.numberguess;
+
+
+import javax.annotation.PostConstruct;
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import javax.webbeans.AnnotationLiteral;
+import javax.webbeans.Current;
+import javax.webbeans.Initializer;
+import javax.webbeans.Named;
+import javax.webbeans.SessionScoped;
+import javax.webbeans.manager.Manager;
+
+@Named
@SessionScoped
-public class Game {
+public class Game
+{
private int number;
private int guess;
@@ -468,32 +484,75 @@
private int biggest;
private int remainingGuesses;
- public Game() {}
+ @Current Manager manager;
+ public Game()
+ {
+ }
+
@Initializer
- Game(@Random int number, @MaxNumber int maxNumber) {
- this.number = number;
- this.smallest = 1;
+ Game(@MaxNumber int maxNumber)
+ {
this.biggest = maxNumber;
- this.remainingGuesses = 10;
}
- // Getters and setters for fields
+ public int getNumber()
+ {
+ return number;
+ }
- public String check() {
- if (guess>number) {
+ public int getGuess()
+ {
+ return guess;
+ }
+
+ public void setGuess(int guess)
+ {
+ this.guess = guess;
+ }
+
+ public int getSmallest()
+ {
+ return smallest;
+ }
+
+ public int getBiggest()
+ {
+ return biggest;
+ }
+
+ public int getRemainingGuesses()
+ {
+ return remainingGuesses;
+ }
+
+ public String check()
+ {
+ if (guess>number)
+ {
biggest = guess - 1;
}
- if (guess<number) {
+ if (guess<number)
+ {
smallest = guess + 1;
}
- if (guess == number) {
+ if (guess == number)
+ {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Correct!"));
}
remainingGuesses--;
return null;
}
+ @PostConstruct
+ public void reset()
+ {
+ this.smallest = 0;
+ this.guess = 0;
+ this.remainingGuesses = 10;
+ this.number = manager.getInstanceByType(Integer.class, new AnnotationLiteral<Random>(){});
+ }
+
}]]></programlisting>
</section>
16 years
[webbeans-commits] Webbeans SVN: r700 - in ri/trunk: webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap and 4 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-12-24 10:45:50 -0500 (Wed, 24 Dec 2008)
New Revision: 700
Added:
ri/trunk/webbeans-api/src/main/java/javax/webbeans/Fires.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/Obtains.java
Removed:
ri/trunk/webbeans-api/src/main/java/javax/webbeans/Observable.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/Obtainable.java
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/AuroraFinch.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/BlueFacedParrotFinch.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/EuropeanGoldfinch.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/OrangeCheekedWaxbill.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/StarFinch.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/BlackRumpedWaxbill.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/CommonWaxbill.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/GoldbreastWaxbill.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/JavaSparrow.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/OwlFinch.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/SweeWaxbill.java
Log:
Change @Observable -> @Fires, @Obtainable -> @Obtains
Copied: ri/trunk/webbeans-api/src/main/java/javax/webbeans/Fires.java (from rev 695, ri/trunk/webbeans-api/src/main/java/javax/webbeans/Observable.java)
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/Fires.java (rev 0)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/Fires.java 2008-12-24 15:45:50 UTC (rev 700)
@@ -0,0 +1,43 @@
+/*
+* 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 javax.webbeans;
+
+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.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Annotates a variable to be injected with an Event object that can be fired and
+ * observed by observer methods
+ *
+ * @author David Allen
+ * @author Gavin King
+ */
+
+@BindingType
+@Retention(RUNTIME)
+@Target( { TYPE, METHOD, FIELD, PARAMETER })
+@Documented
+public @interface Fires
+{
+}
Property changes on: ri/trunk/webbeans-api/src/main/java/javax/webbeans/Fires.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: ri/trunk/webbeans-api/src/main/java/javax/webbeans/Observable.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/Observable.java 2008-12-24 15:43:30 UTC (rev 699)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/Observable.java 2008-12-24 15:45:50 UTC (rev 700)
@@ -1,43 +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 javax.webbeans;
-
-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.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Annotates a variable to be injected with an Event object that can be fired and
- * observed by observer methods
- *
- * @author David Allen
- * @author Gavin King
- */
-
-@BindingType
-@Retention(RUNTIME)
-@Target( { TYPE, METHOD, FIELD, PARAMETER })
-@Documented
-public @interface Observable
-{
-}
Deleted: ri/trunk/webbeans-api/src/main/java/javax/webbeans/Obtainable.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/Obtainable.java 2008-12-24 15:43:30 UTC (rev 699)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/Obtainable.java 2008-12-24 15:45:50 UTC (rev 700)
@@ -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 javax.webbeans;
-
-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.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Annotates a variable to be injected with an Instance object.
- *
- * @author Gavin King
- */
-
-@BindingType
-@Retention(RUNTIME)
-@Target( { TYPE, METHOD, FIELD, PARAMETER })
-@Documented
-public @interface Obtainable
-{
-}
Copied: ri/trunk/webbeans-api/src/main/java/javax/webbeans/Obtains.java (from rev 695, ri/trunk/webbeans-api/src/main/java/javax/webbeans/Obtainable.java)
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/Obtains.java (rev 0)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/Obtains.java 2008-12-24 15:45:50 UTC (rev 700)
@@ -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 javax.webbeans;
+
+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.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Annotates a variable to be injected with an Instance object.
+ *
+ * @author Gavin King
+ */
+
+@BindingType
+@Retention(RUNTIME)
+@Target( { TYPE, METHOD, FIELD, PARAMETER })
+@Documented
+public @interface Obtains
+{
+}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2008-12-24 15:43:30 UTC (rev 699)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2008-12-24 15:45:50 UTC (rev 700)
@@ -42,10 +42,10 @@
import javax.webbeans.DefinitionException;
import javax.webbeans.Initializer;
-import javax.webbeans.Observable;
+import javax.webbeans.Fires;
import javax.webbeans.Observer;
import javax.webbeans.Observes;
-import javax.webbeans.Obtainable;
+import javax.webbeans.Obtains;
import org.jboss.webbeans.CurrentManager;
import org.jboss.webbeans.ManagerImpl;
@@ -210,18 +210,18 @@
}
for (AnnotatedMethod<Object> initializerMethod : bean.getInitializerMethods())
{
- for (AnnotatedParameter<Object> parameter : initializerMethod.getAnnotatedParameters(Observable.class))
+ for (AnnotatedParameter<Object> parameter : initializerMethod.getAnnotatedParameters(Fires.class))
{
registerEvent(parameter, beans);
}
}
for (AnnotatedItem injectionPoint : bean.getInjectionPoints())
{
- if ( injectionPoint.isAnnotationPresent(Observable.class) )
+ if ( injectionPoint.isAnnotationPresent(Fires.class) )
{
registerEvent(injectionPoint, beans);
}
- if ( injectionPoint.isAnnotationPresent(Obtainable.class) )
+ if ( injectionPoint.isAnnotationPresent(Obtains.class) )
{
InstanceBean<Object, Field> instanceBean = createInstanceBean(injectionPoint, manager);
beans.add(instanceBean);
@@ -343,7 +343,7 @@
@SuppressWarnings("unchecked")
private void registerEvent(AnnotatedItem injectionPoint, Set<AbstractBean<?, ?>> beans)
{
- if ( injectionPoint.isAnnotationPresent(Observable.class) )
+ if ( injectionPoint.isAnnotationPresent(Fires.class) )
{
EventBean<Object, Method> eventBean = createEventBean(injectionPoint, manager);
beans.add(eventBean);
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventImpl.java 2008-12-24 15:43:30 UTC (rev 699)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventImpl.java 2008-12-24 15:45:50 UTC (rev 700)
@@ -23,7 +23,7 @@
import java.util.Set;
import javax.webbeans.Event;
-import javax.webbeans.Observable;
+import javax.webbeans.Fires;
import javax.webbeans.Observer;
import javax.webbeans.manager.Manager;
@@ -41,7 +41,7 @@
public class EventImpl<T> extends FacadeImpl<T> implements Event<T>
{
@SuppressWarnings("unchecked")
- private static final Set<Class<? extends Annotation>> FILTERED_ANNOTATIONS = new HashSet<Class<? extends Annotation>>(Arrays.asList(Observable.class));
+ private static final Set<Class<? extends Annotation>> FILTERED_ANNOTATIONS = new HashSet<Class<? extends Annotation>>(Arrays.asList(Fires.class));
/**
* Constructor
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java 2008-12-24 15:43:30 UTC (rev 699)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java 2008-12-24 15:45:50 UTC (rev 700)
@@ -30,7 +30,7 @@
import javax.webbeans.BeforeTransactionCompletion;
import javax.webbeans.Disposes;
import javax.webbeans.IfExists;
-import javax.webbeans.Observable;
+import javax.webbeans.Fires;
import javax.webbeans.Observes;
import javax.webbeans.manager.Manager;
@@ -44,7 +44,7 @@
public interface AnnotatedMethod<T> extends AnnotatedItem<T, Method>
{
@SuppressWarnings("unchecked")
- public static final Set<Class<? extends Annotation>> MAPPED_PARAMETER_ANNOTATIONS = new HashSet<Class<? extends Annotation>>(Arrays.asList(Disposes.class, Observes.class, Observable.class, IfExists.class, BeforeTransactionCompletion.class, AfterTransactionCompletion.class, AfterTransactionFailure.class, AfterTransactionSuccess.class));
+ public static final Set<Class<? extends Annotation>> MAPPED_PARAMETER_ANNOTATIONS = new HashSet<Class<? extends Annotation>>(Arrays.asList(Disposes.class, Observes.class, Fires.class, IfExists.class, BeforeTransactionCompletion.class, AfterTransactionCompletion.class, AfterTransactionFailure.class, AfterTransactionSuccess.class));
/**
* Gets the abstracted parameters of the method
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/AuroraFinch.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/AuroraFinch.java 2008-12-24 15:43:30 UTC (rev 699)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/AuroraFinch.java 2008-12-24 15:45:50 UTC (rev 700)
@@ -2,7 +2,7 @@
import javax.webbeans.Event;
import javax.webbeans.Initializer;
-import javax.webbeans.Observable;
+import javax.webbeans.Fires;
import org.jboss.webbeans.test.beans.StarFinch.Mess;
@@ -12,7 +12,7 @@
private Mess someMess;
@Initializer
- public AuroraFinch(@Observable Event<Mess> eventObject)
+ public AuroraFinch(@Fires Event<Mess> eventObject)
{
// Create a new mess and fire the event for it
someMess = new Mess();
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/BlueFacedParrotFinch.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/BlueFacedParrotFinch.java 2008-12-24 15:43:30 UTC (rev 699)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/BlueFacedParrotFinch.java 2008-12-24 15:45:50 UTC (rev 700)
@@ -1,12 +1,12 @@
package org.jboss.webbeans.test.beans;
import javax.webbeans.Event;
-import javax.webbeans.Observable;
+import javax.webbeans.Fires;
import javax.webbeans.Observer;
public class BlueFacedParrotFinch
{
- @Observable
+ @Fires
private Event<String> simpleEvent;
public void methodThatFiresEvent()
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/EuropeanGoldfinch.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/EuropeanGoldfinch.java 2008-12-24 15:43:30 UTC (rev 699)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/EuropeanGoldfinch.java 2008-12-24 15:45:50 UTC (rev 700)
@@ -5,7 +5,7 @@
import javax.webbeans.ConversationScoped;
import javax.webbeans.Destructor;
import javax.webbeans.Event;
-import javax.webbeans.Observable;
+import javax.webbeans.Fires;
import org.jboss.webbeans.test.beans.StarFinch.Mess;
@@ -20,7 +20,7 @@
}
@Destructor @Remove
- public void remove(@Observable Event<Mess> eventObject)
+ public void remove(@Fires Event<Mess> eventObject)
{
// Create a new mess and fire the event for it
someMess = new Mess();
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/OrangeCheekedWaxbill.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/OrangeCheekedWaxbill.java 2008-12-24 15:43:30 UTC (rev 699)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/OrangeCheekedWaxbill.java 2008-12-24 15:45:50 UTC (rev 700)
@@ -2,7 +2,7 @@
import javax.webbeans.Event;
import javax.webbeans.Initializer;
-import javax.webbeans.Observable;
+import javax.webbeans.Fires;
import javax.webbeans.RequestScoped;
import org.jboss.webbeans.test.beans.StarFinch.Mess;
@@ -18,7 +18,7 @@
}
@Initializer
- public void theInitializerMethod(@Observable Event<Mess> eventObject)
+ public void theInitializerMethod(@Fires Event<Mess> eventObject)
{
// Create a new mess and fire the event for it
someMess = new Mess();
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/StarFinch.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/StarFinch.java 2008-12-24 15:43:30 UTC (rev 699)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/StarFinch.java 2008-12-24 15:45:50 UTC (rev 700)
@@ -2,7 +2,7 @@
import javax.webbeans.Event;
import javax.webbeans.Named;
-import javax.webbeans.Observable;
+import javax.webbeans.Fires;
import javax.webbeans.Produces;
import javax.webbeans.RequestScoped;
@@ -19,7 +19,7 @@
}
@Produces
- public Mess producerOfMesses(@Observable Event<Mess> messEvent)
+ public Mess producerOfMesses(@Fires Event<Mess> messEvent)
{
Mess newMess = new Mess();
messEvent.fire(newMess);
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/BlackRumpedWaxbill.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/BlackRumpedWaxbill.java 2008-12-24 15:43:30 UTC (rev 699)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/BlackRumpedWaxbill.java 2008-12-24 15:45:50 UTC (rev 700)
@@ -1,11 +1,11 @@
package org.jboss.webbeans.test.beans.broken;
import javax.webbeans.Event;
-import javax.webbeans.Observable;
+import javax.webbeans.Fires;
public class BlackRumpedWaxbill
{
- @Observable
+ @Fires
private Event simpleEvent;
public void eliminateWarning()
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/CommonWaxbill.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/CommonWaxbill.java 2008-12-24 15:43:30 UTC (rev 699)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/CommonWaxbill.java 2008-12-24 15:45:50 UTC (rev 700)
@@ -2,11 +2,11 @@
import java.util.ArrayList;
-import javax.webbeans.Observable;
+import javax.webbeans.Fires;
public class CommonWaxbill
{
- @Observable
+ @Fires
private ArrayList<String> simpleEvent;
public void eliminateWarning()
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/GoldbreastWaxbill.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/GoldbreastWaxbill.java 2008-12-24 15:43:30 UTC (rev 699)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/GoldbreastWaxbill.java 2008-12-24 15:45:50 UTC (rev 700)
@@ -1,11 +1,11 @@
package org.jboss.webbeans.test.beans.broken;
import javax.webbeans.Event;
-import javax.webbeans.Observable;
+import javax.webbeans.Fires;
public class GoldbreastWaxbill
{
- @Observable
+ @Fires
private Event<?> simpleEvent;
public void eliminateWarning()
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/JavaSparrow.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/JavaSparrow.java 2008-12-24 15:43:30 UTC (rev 699)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/JavaSparrow.java 2008-12-24 15:45:50 UTC (rev 700)
@@ -3,11 +3,11 @@
import java.util.ArrayList;
import javax.webbeans.Event;
-import javax.webbeans.Observable;
+import javax.webbeans.Fires;
public class JavaSparrow
{
- @Observable
+ @Fires
private Event<ArrayList<String>> simpleEvent;
public void eliminateWarning()
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/OwlFinch.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/OwlFinch.java 2008-12-24 15:43:30 UTC (rev 699)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/OwlFinch.java 2008-12-24 15:45:50 UTC (rev 700)
@@ -1,14 +1,14 @@
package org.jboss.webbeans.test.beans.broken;
import javax.webbeans.Event;
-import javax.webbeans.Observable;
+import javax.webbeans.Fires;
import javax.webbeans.Observer;
import org.jboss.webbeans.test.bindings.AnimalStereotypeAnnotationLiteral;
public class OwlFinch
{
- @Observable
+ @Fires
private Event<String> simpleEvent;
public void methodThatFiresEvent()
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/SweeWaxbill.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/SweeWaxbill.java 2008-12-24 15:43:30 UTC (rev 699)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/SweeWaxbill.java 2008-12-24 15:45:50 UTC (rev 700)
@@ -1,7 +1,7 @@
package org.jboss.webbeans.test.beans.broken;
import javax.webbeans.Event;
-import javax.webbeans.Observable;
+import javax.webbeans.Fires;
import javax.webbeans.Observer;
import org.jboss.webbeans.test.annotations.Role;
@@ -9,7 +9,7 @@
public class SweeWaxbill
{
- @Observable @Role("Admin")
+ @Fires @Role("Admin")
private Event<String> simpleEvent;
public void methodThatFiresEvent()
16 years
[webbeans-commits] Webbeans SVN: r699 - ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-12-24 10:43:30 -0500 (Wed, 24 Dec 2008)
New Revision: 699
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
Log:
WBRI-83
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2008-12-24 15:43:17 UTC (rev 698)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2008-12-24 15:43:30 UTC (rev 699)
@@ -56,6 +56,7 @@
import org.jboss.webbeans.bean.InstanceBean;
import org.jboss.webbeans.bean.ProducerFieldBean;
import org.jboss.webbeans.bean.ProducerMethodBean;
+import org.jboss.webbeans.bean.SimpleBean;
import org.jboss.webbeans.bindings.InitializedBinding;
import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
import org.jboss.webbeans.contexts.DependentContext;
@@ -139,7 +140,16 @@
{
Set<AbstractBean<?, ?>> beans = new HashSet<AbstractBean<?, ?>>();
createBean(BeanFactory.createSimpleBean(Transaction.class, manager), beans);
- createBean(BeanFactory.createSimpleBean(ManagerImpl.class, manager), beans);
+ createBean(new SimpleBean<ManagerImpl>(ManagerImpl.class, manager)
+ {
+
+ @Override
+ public ManagerImpl create()
+ {
+ return manager;
+ }
+
+ }, beans);
return beans;
}
16 years
[webbeans-commits] Webbeans SVN: r698 - ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-12-24 10:43:17 -0500 (Wed, 24 Dec 2008)
New Revision: 698
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractFacadeBean.java
Log:
Allow standard instance beans!
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractFacadeBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractFacadeBean.java 2008-12-24 15:41:58 UTC (rev 697)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractFacadeBean.java 2008-12-24 15:43:17 UTC (rev 698)
@@ -91,6 +91,12 @@
{
this.deploymentType = Standard.class;
}
+
+ @Override
+ protected void checkDeploymentType()
+ {
+ // Allow @Standard here
+ }
/**
* Gets the underlying item
16 years
[webbeans-commits] Webbeans SVN: r697 - in ri/trunk/examples/numberguess: src/main/java/org/jboss/webbeans/examples/numberguess and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-12-24 10:41:58 -0500 (Wed, 24 Dec 2008)
New Revision: 697
Modified:
ri/trunk/examples/numberguess/WebContent/home.xhtml
ri/trunk/examples/numberguess/src/main/java/org/jboss/webbeans/examples/numberguess/Game.java
Log:
WBRI-74, WBRI-77, WBRI-73
Modified: ri/trunk/examples/numberguess/WebContent/home.xhtml
===================================================================
--- ri/trunk/examples/numberguess/WebContent/home.xhtml 2008-12-24 10:29:43 UTC (rev 696)
+++ ri/trunk/examples/numberguess/WebContent/home.xhtml 2008-12-24 15:41:58 UTC (rev 697)
@@ -11,8 +11,8 @@
<h:form id="NumberGuessMain">
<div style="color: red">
<h:messages id="messages" globalOnly="false"/>
- <h:outputText id="Higher" value="Higher!" rendered="#{game.number gt game.guess}"/>
- <h:outputText id="Lower" value="Lower!" rendered="#{game.number lt game.guess}"/>
+ <h:outputText id="Higher" value="Higher!" rendered="#{game.number gt game.guess and game.guess ne 0}"/>
+ <h:outputText id="Lower" value="Lower!" rendered="#{game.number lt game.guess and game.guess ne 0}"/>
</div>
<div>
@@ -26,6 +26,9 @@
</h:inputText>
<h:commandButton id="GuessButton" value="Guess" action="#{game.check}" disabled="#{game.number eq game.guess}"/>
</div>
+ <div>
+ <h:commandButton id="RestartButton" value="Reset" action="#{game.reset}" immediate="true" />
+ </div>
</h:form>
</ui:define>
</ui:composition>
Modified: ri/trunk/examples/numberguess/src/main/java/org/jboss/webbeans/examples/numberguess/Game.java
===================================================================
--- ri/trunk/examples/numberguess/src/main/java/org/jboss/webbeans/examples/numberguess/Game.java 2008-12-24 10:29:43 UTC (rev 696)
+++ ri/trunk/examples/numberguess/src/main/java/org/jboss/webbeans/examples/numberguess/Game.java 2008-12-24 15:41:58 UTC (rev 697)
@@ -1,11 +1,15 @@
package org.jboss.webbeans.examples.numberguess;
+import javax.annotation.PostConstruct;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
+import javax.webbeans.AnnotationLiteral;
+import javax.webbeans.Current;
import javax.webbeans.Initializer;
import javax.webbeans.Named;
import javax.webbeans.SessionScoped;
+import javax.webbeans.manager.Manager;
@Named
@SessionScoped
@@ -18,17 +22,16 @@
private int biggest;
private int remainingGuesses;
+ @Current Manager manager;
+
public Game()
{
}
@Initializer
- Game(@Random int number, @MaxNumber int maxNumber)
- {
- this.number = number;
- this.smallest = 1;
+ Game(@MaxNumber int maxNumber)
+ {
this.biggest = maxNumber;
- this.remainingGuesses = 10;
}
public int getNumber()
@@ -79,4 +82,13 @@
return null;
}
+ @PostConstruct
+ public void reset()
+ {
+ this.smallest = 0;
+ this.guess = 0;
+ this.remainingGuesses = 10;
+ this.number = manager.getInstanceByType(Integer.class, new AnnotationLiteral<Random>(){});
+ }
+
}
16 years