|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
BeanLifecycle.java | - | 100% | 100% | 100% |
|
1 |
// Copyright 2004, 2005 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.tapestry.spec;
|
|
16 |
|
|
17 |
import org.apache.commons.lang.enum.Enum;
|
|
18 |
|
|
19 |
|
|
20 |
/**
|
|
21 |
* An {@link Enum} of the different possible lifecycles for a JavaBean.
|
|
22 |
*
|
|
23 |
* @author Howard Lewis Ship
|
|
24 |
* @since 1.0.4
|
|
25 |
*
|
|
26 |
**/
|
|
27 |
|
|
28 |
public class BeanLifecycle extends Enum |
|
29 |
{ |
|
30 |
/**
|
|
31 |
* No lifecycle; the bean is created fresh on each reference and not retained.
|
|
32 |
*
|
|
33 |
**/
|
|
34 |
|
|
35 |
public static final BeanLifecycle NONE = new BeanLifecycle("NONE"); |
|
36 |
|
|
37 |
/**
|
|
38 |
* The standard lifecycle; the bean is retained for the
|
|
39 |
* duration of the request cycle and is discarded at the end of the
|
|
40 |
* request cycle.
|
|
41 |
*
|
|
42 |
**/
|
|
43 |
|
|
44 |
public static final BeanLifecycle REQUEST = new BeanLifecycle("REQUEST"); |
|
45 |
|
|
46 |
/**
|
|
47 |
* The bean is created once and reused for the lifespan of the page
|
|
48 |
* containing the component.
|
|
49 |
*
|
|
50 |
**/
|
|
51 |
|
|
52 |
public static final BeanLifecycle PAGE = new BeanLifecycle("PAGE"); |
|
53 |
|
|
54 |
/**
|
|
55 |
* The bean is create and reused until the end of the current render,
|
|
56 |
* at which point it is discarded.
|
|
57 |
*
|
|
58 |
* @since 2.2
|
|
59 |
*
|
|
60 |
**/
|
|
61 |
|
|
62 |
public static final BeanLifecycle RENDER = new BeanLifecycle("RENDER"); |
|
63 |
|
|
64 | 4 |
private BeanLifecycle(String name)
|
65 |
{ |
|
66 | 4 |
super(name);
|
67 |
} |
|
68 |
|
|
69 |
} |
|