|
|||||||||||||||||||
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 | |||||||||||||||
BaseEngine.java | - | 0% | 0% | 0% |
|
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.engine;
|
|
16 |
|
|
17 |
import java.util.Collection;
|
|
18 |
import java.util.Collections;
|
|
19 |
|
|
20 |
import org.apache.tapestry.IRequestCycle;
|
|
21 |
|
|
22 |
/**
|
|
23 |
* Concrete implementation of {@link org.apache.tapestry.IEngine}used for ordinary applications.
|
|
24 |
* All page state information is maintained in the {@link javax.servlet.http.HttpSession}using
|
|
25 |
* instances of {@link org.apache.tapestry.record.SessionPageRecorder}.
|
|
26 |
*
|
|
27 |
* @author Howard Lewis Ship
|
|
28 |
*/
|
|
29 |
|
|
30 |
public class BaseEngine extends AbstractEngine |
|
31 |
{ |
|
32 |
/**
|
|
33 |
* Removes all page recorders that contain no changes, or are marked for discard. Subclasses
|
|
34 |
* should invoke this implementation in addition to providing thier own.
|
|
35 |
*/
|
|
36 |
|
|
37 | 0 |
protected void cleanupAfterRequest(IRequestCycle cycle) |
38 |
{ |
|
39 |
// if (Tapestry.isEmpty(_recorders))
|
|
40 |
// return;
|
|
41 |
//
|
|
42 |
// boolean markDirty = false;
|
|
43 |
// Iterator i = _recorders.entrySet().iterator();
|
|
44 |
//
|
|
45 |
// while (i.hasNext())
|
|
46 |
// {
|
|
47 |
// Map.Entry entry = (Map.Entry) i.next();
|
|
48 |
// String pageName = (String) entry.getKey();
|
|
49 |
// IPageRecorder recorder = (IPageRecorder) entry.getValue();
|
|
50 |
//
|
|
51 |
// if (!recorder.getHasChanges() || recorder.isMarkedForDiscard())
|
|
52 |
// {
|
|
53 |
// recorder.discard();
|
|
54 |
//
|
|
55 |
// i.remove();
|
|
56 |
//
|
|
57 |
// _activePageNames.remove(pageName);
|
|
58 |
//
|
|
59 |
// markDirty = true;
|
|
60 |
// }
|
|
61 |
// }
|
|
62 |
//
|
|
63 |
// if (markDirty)
|
|
64 |
// markDirty();
|
|
65 |
} |
|
66 |
|
|
67 |
/**
|
|
68 |
* Returns an unmodifiable {@link Collection}of the page names for which {@link IPageRecorder}
|
|
69 |
* instances exist.
|
|
70 |
*/
|
|
71 |
|
|
72 | 0 |
public Collection getActivePageNames()
|
73 |
{ |
|
74 | 0 |
return Collections.EMPTY_LIST;
|
75 |
|
|
76 |
} |
|
77 |
|
|
78 | 0 |
public IPageRecorder getPageRecorder(String pageName, IRequestCycle cycle)
|
79 |
{ |
|
80 | 0 |
throw new UnsupportedOperationException("getPageRecorder()"); |
81 |
} |
|
82 |
|
|
83 | 0 |
public IPageRecorder createPageRecorder(String pageName, IRequestCycle cycle)
|
84 |
{ |
|
85 | 0 |
throw new UnsupportedOperationException("createPageRecorder()"); |
86 |
} |
|
87 |
|
|
88 |
} |
|