01: /**
02: * Objective Database Abstraction Layer (ODAL)
03: * Copyright (c) 2004, The ODAL Development Group
04: * All rights reserved.
05: * For definition of the ODAL Development Group please refer to LICENCE.txt file
06: *
07: * Distributable under LGPL license.
08: * See terms of license at gnu.org.
09: */package com.completex.objective.components.persistency.meta;
10:
11: import com.completex.objective.components.persistency.JavaToMetaType;
12: import com.completex.objective.components.persistency.UserDefinedTypeMetaModel;
13: import com.completex.objective.util.PropertyMap;
14:
15: import java.io.IOException;
16: import java.sql.Connection;
17: import java.sql.SQLException;
18: import java.util.Map;
19:
20: /**
21: * @author Gennady Krizhevsky
22: */
23: public interface ModelLoaderPlugin {
24:
25: public static final NullModelLoaderPlugin NULL_MODEL_LOADER_PLUGIN = new NullModelLoaderPlugin();
26:
27: void configure(PropertyMap udtProperties) throws IOException;
28:
29: String getPluginKey();
30:
31: /**
32: * Loads UserDefinedTypeMetaModel data model
33: *
34: * @return created and loaded UserDefinedTypeMetaModel
35: */
36: UserDefinedTypeMetaModel load() throws Exception;
37:
38: UserDefinedTypeMetaModel load(UserDefinedTypeMetaModel model)
39: throws Exception;
40:
41: boolean needsConnection();
42:
43: void setConnection(Connection connection);
44:
45: void setJavaToMetaType(JavaToMetaType javaToMetaType);
46:
47: //
48: // Null implementation:
49: //
50: static class NullModelLoaderPlugin implements ModelLoaderPlugin {
51:
52: public String getPluginKey() {
53: return "NULL_MODEL_LOADER_PLUGIN";
54: }
55:
56: public void configure(PropertyMap udtProperties) {
57: }
58:
59: public void setParameters(Map parameters) {
60: }
61:
62: public UserDefinedTypeMetaModel load() throws Exception {
63: return null;
64: }
65:
66: public boolean needsConnection() {
67: return false;
68: }
69:
70: public void setConnection(Connection connection) {
71: }
72:
73: public UserDefinedTypeMetaModel load(
74: UserDefinedTypeMetaModel model) throws SQLException {
75: return null;
76: }
77:
78: public void setJavaToMetaType(JavaToMetaType javaToMetaType) {
79: }
80: }
81: }
|