01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.cocoon.acting;
18:
19: import org.apache.avalon.framework.component.Component;
20: import org.apache.avalon.framework.parameters.Parameters;
21: import org.apache.cocoon.environment.Redirector;
22: import org.apache.cocoon.environment.SourceResolver;
23:
24: import java.util.Map;
25:
26: /**
27: *
28: * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
29: * @version CVS $Id: Action.java 433543 2006-08-22 06:22:54Z crossley $
30: */
31: public interface Action extends Component {
32:
33: String ROLE = Action.class.getName();
34:
35: /**
36: * Controls the processing against some values of the
37: * <code>Dictionary</code> objectModel and returns a
38: * <code>Map</code> object with values used in subsequent
39: * sitemap substitution patterns.
40: *
41: * NOTE: This interface is designed so that implentations can be <code>ThreadSafe<code>.
42: * When an action is ThreadSafe, only one instance serves all requests : this
43: * reduces memory usage and avoids pooling.
44: *
45: * @param resolver The <code>SourceResolver</code> in charge
46: * @param objectModel The <code>Map</code> with object of the
47: * calling environment which can be used
48: * to select values this controller may need
49: * (ie Request, Response).
50: * @param source A source <code>String</code> to the Action
51: * @param parameters The <code>Parameters</code> for this invocation
52: * @return Map The returned <code>Map</code> object with
53: * sitemap substitution values which can be used
54: * in subsequent elements attributes like src=
55: * using a xpath like expression: src="mydir/{myval}/foo"
56: * If the return value is null the processing inside
57: * the <map:act> element of the sitemap will
58: * be skipped.
59: * @exception Exception Indicates something is totally wrong
60: */
61: Map act(Redirector redirector, SourceResolver resolver,
62: Map objectModel, String source, Parameters parameters)
63: throws Exception;
64: }
|