KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cayenne > conf > ConfigLoaderDelegate


1 /*****************************************************************
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  ****************************************************************/

19
20
21 package org.apache.cayenne.conf;
22
23 import java.util.Map JavaDoc;
24
25 /**
26  * Interface that defines callback API used by ConfigLoader to process loaded
27  * configuration. Main responsibility of ConfigLoaderDelegate is to create
28  * objects, while ConfigLoader is mainly concerned with XML parsing.
29  *
30  * @author Andrus Adamchik
31  */

32 public interface ConfigLoaderDelegate {
33     /**
34      * Callback methods invoked in the beginning of the configuration
35      * processing.
36      */

37     public void startedLoading();
38
39     /**
40      * Callback methods invoked at the end of the configuration processing.
41      */

42     public void finishedLoading();
43
44     /**
45      * Callback method invoked when a project version is read.
46      * @since 1.1
47      */

48     public void shouldLoadProjectVersion(String JavaDoc version);
49         
50     /**
51      * Callback method invoked when a domain is encountered in the configuration
52      * file.
53      * @param name domain name.
54      */

55     public void shouldLoadDataDomain(String JavaDoc name);
56     
57     /**
58      * Callback method invoked when a DataView reference is encountered in the configuration
59      * file.
60      *
61      * @since 1.1
62      */

63     public void shouldRegisterDataView(String JavaDoc name, String JavaDoc location);
64
65     /**
66      * @since 1.1
67      */

68     public void shouldLoadDataMaps(String JavaDoc domainName, Map JavaDoc locations);
69     
70     /**
71      * @since 1.1
72      */

73     public void shouldLoadDataDomainProperties(String JavaDoc domainName, Map JavaDoc properties);
74
75     public void shouldLoadDataNode(
76         String JavaDoc domainName,
77         String JavaDoc nodeName,
78         String JavaDoc dataSource,
79         String JavaDoc adapter,
80         String JavaDoc factory);
81
82     public void shouldLinkDataMap(
83         String JavaDoc domainName,
84         String JavaDoc nodeName,
85         String JavaDoc mapName);
86
87     /**
88      * Gives delegate an opportunity to process the error.
89      *
90      * @param th
91      * @return boolean indicating whether ConfigLoader should proceed with
92      * further processing. Ultimately it is up to the ConfigLoader to make this
93      * decision.
94      */

95     public boolean loadError(Throwable JavaDoc th);
96
97     /**
98      * @return status object indicating the state of the configuration loading.
99      */

100     public ConfigStatus getStatus();
101 }
102
Popular Tags