Coverage Report - org.apache.tapestry5.annotations.ApplicationState
 
Classes in this File Line Coverage Branch Coverage Complexity
ApplicationState
N/A
N/A
0
 
 1  
 // Copyright 2007, 2008 The Apache Software Foundation
 2  
 //
 3  
 // Licensed under the Apache License, Version 2.0 (the "License");
 4  
 // you may not use this file except in compliance with the License.
 5  
 // You may obtain a copy of the License at
 6  
 //
 7  
 //     http://www.apache.org/licenses/LICENSE-2.0
 8  
 //
 9  
 // Unless required by applicable law or agreed to in writing, software
 10  
 // distributed under the License is distributed on an "AS IS" BASIS,
 11  
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12  
 // See the License for the specific language governing permissions and
 13  
 // limitations under the License.
 14  
 
 15  
 package org.apache.tapestry5.annotations;
 16  
 
 17  
 import java.lang.annotation.Documented;
 18  
 import static java.lang.annotation.ElementType.FIELD;
 19  
 import java.lang.annotation.Retention;
 20  
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
 21  
 import java.lang.annotation.Target;
 22  
 
 23  
 /**
 24  
  * Marker annotation for a field that is an <em>application state object</em> as controlled by the {@link
 25  
  * org.apache.tapestry5.services.ApplicationStateManager}.  <em>Application</em> is something of a misnomer, as it
 26  
  * implies that the object is stored as global, application-wide state (i.e., in the {@link
 27  
  * javax.servlet.ServletContext}). In fact, the built-in strategies for ASO management are <em>very</em> user specific,
 28  
  * ultimately storing data in the {@link org.apache.tapestry5.services.Session}. Because of the confusion this naming
 29  
  * causes, this annotation has been deprecated, and the new {@link org.apache.tapestry5.annotations.SessionState}
 30  
  * annotation should be used instead.
 31  
  * <p/>
 32  
  * An ASO field may have a companion field, of type boolean, used to see if the ASO has been created yet. If another
 33  
  * field exists with the same name, suffixed with "Exists" (i.e., "aso" for the ASO field, and "asoExists" for the
 34  
  * companion field) and the type of that field is boolean, then access to the field will determine whether the ASO has
 35  
  * already been created. This is necessary because even a null check ("aso != null") may force the ASO to be created.
 36  
  * Instead, check the companion boolean field ("asoExists").
 37  
  *
 38  
  * @deprecated Use {@link org.apache.tapestry5.annotations.SessionState} instead
 39  
  */
 40  
 @Target(FIELD)
 41  
 @Documented
 42  
 @Retention(RUNTIME)
 43  
 public @interface ApplicationState
 44  
 {
 45  
     /**
 46  
      * If true (the default), then referencing an field marked with the annotation will create the SSO.  If false, then
 47  
      * accessing the field will not create the SSO, it will only allow access to it if it already exists.
 48  
      */
 49  
     boolean create() default true;
 50  
 }