[jboss-cvs] jboss-seam/src/main/org/jboss/seam/captcha ...

Gavin King gavin.king at jboss.com
Thu Feb 8 01:35:13 EST 2007


  User: gavin   
  Date: 07/02/08 01:35:13

  Modified:    src/main/org/jboss/seam/captcha   Captcha.java
  Added:       src/main/org/jboss/seam/captcha   CaptchaService.java
  Log:
  move to the new package
  
  Revision  Changes    Path
  1.2       +3 -2      jboss-seam/src/main/org/jboss/seam/captcha/Captcha.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Captcha.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/captcha/Captcha.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- Captcha.java	8 Feb 2007 06:21:52 -0000	1.1
  +++ Captcha.java	8 Feb 2007 06:35:13 -0000	1.2
  @@ -6,13 +6,14 @@
   import org.jboss.seam.Component;
   import org.jboss.seam.ScopeType;
   import org.jboss.seam.annotations.Create;
  +import org.jboss.seam.annotations.Install;
   import org.jboss.seam.annotations.Name;
   import org.jboss.seam.annotations.Scope;
   import org.jboss.seam.contexts.Contexts;
  -import org.jboss.seam.security.CaptchaService;
   
  - at Name("captcha")
  + at Name("org.jboss.seam.captcha.captcha")
   @Scope(ScopeType.PAGE)
  + at Install(dependencies="org.jboss.seam.captcha.captchaService")
   public class Captcha implements Serializable
   {
      private String id;
  
  
  
  1.1      date: 2007/02/08 06:35:13;  author: gavin;  state: Exp;jboss-seam/src/main/org/jboss/seam/captcha/CaptchaService.java
  
  Index: CaptchaService.java
  ===================================================================
  package org.jboss.seam.captcha;
  
  import org.jboss.seam.Component;
  import org.jboss.seam.InterceptionType;
  import org.jboss.seam.ScopeType;
  import org.jboss.seam.annotations.Create;
  import org.jboss.seam.annotations.Install;
  import org.jboss.seam.annotations.Intercept;
  import org.jboss.seam.annotations.Name;
  import org.jboss.seam.annotations.Scope;
  import org.jboss.seam.contexts.Contexts;
  
  import com.octo.captcha.service.image.DefaultManageableImageCaptchaService;
  import com.octo.captcha.service.image.ImageCaptchaService;
  
  @Name("org.jboss.seam.captcha.captchaService")
  @Intercept(InterceptionType.NEVER)
  @Scope(ScopeType.APPLICATION)
  @Install(classDependencies="com.octo.captcha.service.image.ImageCaptchaService")
  public class CaptchaService
  {
     private ImageCaptchaService service;
     
     @Create
     public void create()
     {
        service = new DefaultManageableImageCaptchaService();
     }
     
     public ImageCaptchaService getService()
     {
        return service;
     }
     
     public static CaptchaService instance()
     {
        if ( !Contexts.isApplicationContextActive() )
        {
           throw new IllegalStateException("No active application scope");
        }
        return (CaptchaService) Component.getInstance(CaptchaService.class);
     }
  }
  
  
  



More information about the jboss-cvs-commits mailing list