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.forms.binding.library;
18:
19: /**
20: * The work interface for the LibraryManager, the class that
21: * manages all used form binding library definitions so they can be shared
22: * between forms.
23: *
24: * @version $Id: LibraryManager.java 451891 2006-10-02 06:36:48Z vgritsenko $
25: */
26: public interface LibraryManager {
27:
28: String ROLE = LibraryManager.class.getName();
29:
30: /**
31: * Create new instance of the {@link Library}.
32: * @return new library instance
33: */
34: Library newLibrary();
35:
36: /**
37: * Loads (and caches) a library from specified source URI.
38: *
39: * @param sourceURI URI of the library source.
40: * @return Library loaded from the source URI.
41: */
42: Library load(String sourceURI) throws Exception;
43:
44: /**
45: * Loads (and caches) a library from specified source URI, resolved relative
46: * to the base URI.
47: *
48: * @param sourceURI Relative URI of the library source.
49: * @param baseURI Base URI of the library source.
50: * @return Library loaded from the source URI.
51: */
52: Library load(String sourceURI, String baseURI) throws Exception;
53:
54: /**
55: * Get the cached instance of the library loaded from the specified source
56: * URI.
57: *
58: * @param sourceURI URI of the library source.
59: * @return Cached instance of the library, or null if it was not loaded.
60: */
61: boolean get(String sourceURI) throws Exception;
62:
63: /**
64: * Get the cached instance of the library loaded from the specified source
65: * URI, resolved relative to the base URI.
66: *
67: * @param sourceURI Relative URI of the library source.
68: * @param baseURI Base URI of the library source.
69: * @return Cached instance of the library, or null if it was not loaded.
70: */
71: boolean get(String sourceURI, String baseURI) throws Exception;
72: }
|