[jboss-cvs] jboss-seam/examples/booking/src/org/jboss/seam/example/booking ...

Gavin King gavin.king at jboss.com
Tue Dec 19 18:12:42 EST 2006


  User: gavin   
  Date: 06/12/19 18:12:42

  Modified:    examples/booking/src/org/jboss/seam/example/booking  
                        HotelBookingAction.java LoggedInInterceptor.java
  Log:
  let the beans be destroyed
  
  Revision  Changes    Path
  1.44      +4 -2      jboss-seam/examples/booking/src/org/jboss/seam/example/booking/HotelBookingAction.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: HotelBookingAction.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/booking/src/org/jboss/seam/example/booking/HotelBookingAction.java,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -b -r1.43 -r1.44
  --- HotelBookingAction.java	17 Dec 2006 01:04:51 -0000	1.43
  +++ HotelBookingAction.java	19 Dec 2006 23:12:42 -0000	1.44
  @@ -1,4 +1,4 @@
  -//$Id: HotelBookingAction.java,v 1.43 2006/12/17 01:04:51 gavin Exp $
  +//$Id: HotelBookingAction.java,v 1.44 2006/12/19 23:12:42 gavin Exp $
   package org.jboss.seam.example.booking;
   
   import static javax.persistence.PersistenceContextType.EXTENDED;
  @@ -102,6 +102,8 @@
      public void cancel() {}
      
      @Destroy @Remove
  -   public void destroy() {}
  +   public void destroy() {
  +      System.out.println("!!!!");
  +   }
   
   }
  \ No newline at end of file
  
  
  
  1.16      +6 -4      jboss-seam/examples/booking/src/org/jboss/seam/example/booking/LoggedInInterceptor.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: LoggedInInterceptor.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/booking/src/org/jboss/seam/example/booking/LoggedInInterceptor.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -b -r1.15 -r1.16
  --- LoggedInInterceptor.java	17 Dec 2006 14:07:46 -0000	1.15
  +++ LoggedInInterceptor.java	19 Dec 2006 23:12:42 -0000	1.16
  @@ -1,4 +1,4 @@
  -//$Id: LoggedInInterceptor.java,v 1.15 2006/12/17 14:07:46 gavin Exp $
  +//$Id: LoggedInInterceptor.java,v 1.16 2006/12/19 23:12:42 gavin Exp $
   package org.jboss.seam.example.booking;
   
   import java.lang.reflect.Method;
  @@ -9,6 +9,7 @@
   import org.jboss.seam.Component;
   import org.jboss.seam.InterceptorType;
   import org.jboss.seam.annotations.Interceptor;
  +import org.jboss.seam.contexts.Lifecycle;
   
   @Interceptor(type=InterceptorType.CLIENT)
   public class LoggedInInterceptor
  @@ -17,8 +18,9 @@
      @AroundInvoke
      public Object checkLoggedIn(InvocationContext invocation) throws Exception
      {
  -      Login login = (Login) Component.getInstance(LoginAction.class);
  -      if ( login.isLoggedIn() )
  +      boolean allowed = Lifecycle.isDestroying() || 
  +            ( (Login) Component.getInstance(LoginAction.class) ).isLoggedIn();
  +      if ( allowed )
         {
            return invocation.proceed();
         }
  
  
  



More information about the jboss-cvs-commits mailing list