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.components.source.helpers;
18:
19: import org.apache.avalon.framework.component.Component;
20: import org.apache.avalon.framework.parameters.Parameters;
21: import org.apache.excalibur.source.SourceException;
22:
23: /**
24: * A SourceRefresher is a component that invokes the {@link org.apache.excalibur.source.Source#refresh}
25: * method on a configured set of Sources.
26: *
27: * <p>Implementations can for instance trigger refresh based on a timeout value or
28: * in response to an external event.</p>
29: *
30: * @since 2.1.1
31: * @version $Id: SourceRefresher.java 485495 2006-12-11 04:44:23Z crossley $
32: */
33: public interface SourceRefresher extends Component {
34:
35: String ROLE = SourceRefresher.class.getName();
36:
37: /**
38: * Refresh interval for the Source.
39: * Parameter is used by {@link org.apache.cocoon.components.source.helpers.DelaySourceRefresher}.
40: */
41: String PARAM_CACHE_INTERVAL = "interval";
42:
43: /**
44: * Add a uri to the SourceRefresher.
45: *
46: * @param name Uniquely identifying name for the source.
47: * @param uri The uri to refresh. Every valid protocol can be used.
48: * @param params Additional parameters such as an interval between refresh runs.
49: */
50: void refresh(String name, String uri, Parameters params)
51: throws SourceException;
52:
53: }
|