// Copyright 2007, 2008, 2009 The Apache Software Foundation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
org.apache.tapestry5.services.ApplicationStateManager. Application is something of a misnomer, as it implies that the object is stored as global, application-wide state (i.e., in the
javax.servlet.ServletContext). In fact, the built-in strategies for ASO management are very user specific, ultimately storing data in the
org.apache.tapestry5.services.Session. Because of the confusion this naming causes, this annotation has been deprecated, and the new
org.apache.tapestry5.annotations.SessionStateannotation should be used instead.
An ASO field may have a companion field, of type boolean, used to see if the ASO has been created yet. If another field exists with the same name, suffixed with "Exists" (i.e., "aso" for the ASO field, and "asoExists" for the companion field) and the type of that field is boolean, then access to the field will determine whether the ASO has already been created. This is necessary because even a null check ("aso != null") may force the ASO to be created. Instead, check the companion boolean field ("asoExists").