2009/05/20 - Apache Shale has been retired.

For more information, please explore the Attic.

Coverage Report - org.apache.shale.examples.test.tiger.SessionBean
 
Classes in this File Line Coverage Branch Coverage Complexity
SessionBean
0%
0/18
N/A
0
 
 1  
 /*
 2  
  * ApplicationBean.java
 3  
  *
 4  
  * Created on August 13, 2006, 10:04 AM
 5  
  *
 6  
  * To change this template, choose Tools | Template Manager
 7  
  * and open the template in the editor.
 8  
  */
 9  
 
 10  
 package org.apache.shale.examples.test.tiger;
 11  
 
 12  
 import org.apache.shale.tiger.managed.Bean;
 13  
 import org.apache.shale.tiger.managed.Property;
 14  
 import org.apache.shale.tiger.managed.Scope;
 15  
 import org.apache.shale.tiger.view.Activate;
 16  
 import org.apache.shale.tiger.view.Destroy;
 17  
 import org.apache.shale.tiger.view.Init;
 18  
 import org.apache.shale.tiger.view.Passivate;
 19  
 import org.apache.shale.tiger.view.Session;
 20  
 
 21  
 /**
 22  
  * <p>Session scope managed bean declared with annotations.</p>
 23  
  */
 24  
 @Session
 25  
 @Bean(name="sessionBean", scope=Scope.SESSION)
 26  0
 public class SessionBean {
 27  
     
 28  
 
 29  
     // ------------------------------------------------------- Public Properties
 30  
 
 31  
 
 32  
     /**
 33  
      * <p>Injected application bean instance.</p>
 34  
      */
 35  
     @Property(value="#{applicationBean}")
 36  
     private ApplicationBean applicationBean;
 37  
 
 38  
     public ApplicationBean getApplicationBean() {
 39  0
         return this.applicationBean;
 40  
     }
 41  
 
 42  
     public void setApplicationBean(ApplicationBean applicationBean) {
 43  0
         this.applicationBean = applicationBean;
 44  0
     }
 45  
 
 46  
 
 47  
     /**
 48  
      * <p>Return the events that have occurred so far.</p>
 49  
      */
 50  0
     private StringBuffer events = new StringBuffer();
 51  
 
 52  
     public String getEvents() {
 53  0
         return events.toString();
 54  
     }
 55  
 
 56  
 
 57  
 
 58  
     // -------------------------------------------------------- Lifecycle Events
 59  
 
 60  
 
 61  
     @Init
 62  
     public void myInit() {
 63  0
         events.append("init/");
 64  0
         System.out.println("SessionBean.init()");
 65  0
     }
 66  
 
 67  
 
 68  
     @Destroy
 69  
     public void myDestroy() {
 70  0
         events.append("destroy/");
 71  0
         System.out.println("SessionBean.destroy()");
 72  0
     }
 73  
 
 74  
 
 75  
     @Activate
 76  
     public void myActivate() {
 77  0
         events.append("activate/");
 78  0
         System.out.println("SessionBean.activate()");
 79  0
     }
 80  
 
 81  
 
 82  
     @Passivate
 83  
     public void myPassivate() {
 84  0
         events.append("passivate/");
 85  0
         System.out.println("SessionBean.passivate()");
 86  0
     }
 87  
 
 88  
 
 89  
 }