openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gerdo...@apache.org
Subject svn commit: r730605 - in /incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess: Game.java Generator.java MaxNum.java MaxNumber.java NumberGame.java NumberProducer.java Rand.java Random.java
Date Thu, 01 Jan 2009 21:09:15 GMT
Author: gerdogdu
Date: Thu Jan  1 13:09:14 2009
New Revision: 730605

URL: http://svn.apache.org/viewvc?rev=730605&view=rev
Log:
Update samples.

Added:
    incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/MaxNum.java
      - copied, changed from r730013, incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/MaxNumber.java
    incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/NumberGame.java
      - copied, changed from r730013, incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/Game.java
    incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/NumberProducer.java
      - copied, changed from r730013, incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/Generator.java
    incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/Rand.java
      - copied, changed from r730013, incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/Random.java
Removed:
    incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/Game.java
    incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/Generator.java
    incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/MaxNumber.java
    incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/Random.java

Copied: incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/MaxNum.java
(from r730013, incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/MaxNumber.java)
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/MaxNum.java?p2=incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/MaxNum.java&p1=incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/MaxNumber.java&r1=730013&r2=730605&rev=730605&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/MaxNumber.java
(original)
+++ incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/MaxNum.java
Thu Jan  1 13:09:14 2009
@@ -29,11 +29,11 @@
 
 import javax.webbeans.BindingType;
 
+@BindingType
 @Target( { TYPE, METHOD, PARAMETER, FIELD })
 @Retention(RUNTIME)
 @Documented
-@BindingType
-public @interface MaxNumber
+public @interface MaxNum
 {
 
 }

Copied: incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/NumberGame.java
(from r730013, incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/Game.java)
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/NumberGame.java?p2=incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/NumberGame.java&p1=incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/Game.java&r1=730013&r2=730605&rev=730605&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/Game.java
(original)
+++ incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/NumberGame.java
Thu Jan  1 13:09:14 2009
@@ -28,9 +28,9 @@
 import javax.webbeans.SessionScoped;
 import javax.webbeans.manager.Manager;
 
-@Named
+@Named(value="game")
 @SessionScoped
-public class Game
+public class NumberGame
 {
    private int number;
    private boolean correct = false;
@@ -40,12 +40,12 @@
    private int remainingGuesses;   
    private @Current Manager manager;
    
-   public Game()
+   public NumberGame()
    {
    }
    
    @Initializer
-   Game(@Random int number, @MaxNumber int maxNumber)
+   public NumberGame(@Rand int number, @MaxNum int maxNumber)
    {
       this.number = number;
       this.smallest = 1;
@@ -86,10 +86,10 @@
    public String clear()
    {
 	   Annotation[] anns = new Annotation[1];
-	   anns[0] = new AnnotationLiteral<Random>(){};
+	   anns[0] = new AnnotationLiteral<Rand>(){};
 
 	   Annotation[] anns2 = new Annotation[1];
-	   anns2[0] = new AnnotationLiteral<MaxNumber>(){};
+	   anns2[0] = new AnnotationLiteral<MaxNum>(){};
 	   
       this.number = manager.getInstanceByType(int.class, anns);
       this.smallest = 1;
@@ -102,7 +102,7 @@
    }
    
    
-   public String check()
+   public String checkNumber()
    {
  	  if(correct)
 	  {

Copied: incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/NumberProducer.java
(from r730013, incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/Generator.java)
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/NumberProducer.java?p2=incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/NumberProducer.java&p1=incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/Generator.java&r1=730013&r2=730605&rev=730605&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/Generator.java
(original)
+++ incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/NumberProducer.java
Thu Jan  1 13:09:14 2009
@@ -17,13 +17,15 @@
 package org.apache.webbeans.sample.numberguess;
 
 
+import java.util.Random;
+
 import javax.webbeans.ApplicationScoped;
 import javax.webbeans.Produces;
 
 @ApplicationScoped
-public class Generator {
+public class NumberProducer {
    
-   private java.util.Random random = new java.util.Random( System.currentTimeMillis() );
+   Random random = new Random( System.currentTimeMillis() );
    
    private int maxNumber = 100;
    
@@ -32,13 +34,14 @@
       return random;
    }
    
-   @Produces @Random int next() { 
-      return getRandom().nextInt(maxNumber); 
-   }
-   
-   @Produces @MaxNumber int getMaxNumber()
+   @Produces @MaxNum int getMaxNumber()
    {
       return maxNumber;
    }
-
-} 
+   
+   
+   @Produces @Rand int next() { 
+      return getRandom().nextInt(maxNumber); 
+   }
+   
+} 
\ No newline at end of file

Copied: incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/Rand.java
(from r730013, incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/Random.java)
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/Rand.java?p2=incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/Rand.java&p1=incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/Random.java&r1=730013&r2=730605&rev=730605&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/Random.java
(original)
+++ incubator/openwebbeans/trunk/samples/guess/src/main/java/org/apache/webbeans/sample/numberguess/Rand.java
Thu Jan  1 13:09:14 2009
@@ -29,11 +29,11 @@
 
 import javax.webbeans.BindingType;
 
+@BindingType
 @Target( { TYPE, METHOD, PARAMETER, FIELD })
 @Retention(RUNTIME)
 @Documented
-@BindingType
-public @interface Random
+public @interface Rand
 {
 
 }



Mime
View raw message