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 517733 2007-03-13 15:37:22Z 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 LibraryException;
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)
53: throws LibraryException;
54:
55: /**
56: * Get the cached instance of the library loaded from the specified source
57: * URI.
58: *
59: * @param sourceURI URI of the library source.
60: * @return Cached instance of the library, or null if it was not loaded.
61: */
62: Library get(String sourceURI) throws LibraryException;
63:
64: /**
65: * Get the cached instance of the library loaded from the specified source
66: * URI, resolved relative to the base URI.
67: *
68: * @param sourceURI Relative URI of the library source.
69: * @param baseURI Base URI of the library source.
70: * @return Cached instance of the library, or null if it was not loaded.
71: */
72: Library get(String sourceURI, String baseURI)
73: throws LibraryException;
74: }
|