KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > oracle > toplink > essentials > internal > ejb > cmp3 > xml > XMLLogger


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the "License"). You may not use this file except
5  * in compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * glassfish/bootstrap/legal/CDDLv1.0.txt or
9  * https://glassfish.dev.java.net/public/CDDLv1.0.html.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * HEADER in each file and include the License file at
15  * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
16  * add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your
18  * own identifying information: Portions Copyright [yyyy]
19  * [name of copyright owner]
20  */

21 // Copyright (c) 1998, 2006, Oracle. All rights reserved.
22
package oracle.toplink.essentials.internal.ejb.cmp3.xml;
23
24 import oracle.toplink.essentials.logging.SessionLog;
25 import oracle.toplink.essentials.internal.sessions.AbstractSession;
26 import oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataLogger;
27
28 /**
29  * Logger class for the EntityMappingsXMLProcessor.
30  *
31  * @author Guy Pelletier
32  * @since TopLink EJB 3.0 Reference Implementation
33  */

34 public class XMLLogger extends MetadataLogger {
35     // ORM specific messages.
36
public static final String JavaDoc IGNORE_SECONDARY_TABLE = "orm_warning_ignore_secondary_table";
37     public static final String JavaDoc IGNORE_MAPPING_ON_WRITE = "orm_warning_ignore_mapping_on_write";
38     public static final String JavaDoc IGNORE_QUERY_HINT_UNKNOWN_TYPE = "orm_warning_ignore_query_hint_unknown_type";
39     public static final String JavaDoc IGNORE_QUERY_HINT_UNSUPPORTED_TYPE = "orm_warning_ignore_query_hint_unsupported_type";
40     public static final String JavaDoc ERROR_LOADING_ORM_XML_FILE = "orm_warning_exception_loading_orm_xml_file";
41     public static final String JavaDoc COULD_NOT_FIND_ORM_XML_FILE = "orm_could_not_find_orm_xml_file";
42     /**
43      * INTERNAL:
44      */

45     public XMLLogger(AbstractSession session) {
46         super(session);
47     }
48     
49     /**
50      * INTERNAL:
51      * Init the shared context strings.
52      */

53     protected void initSharedContextStrings() {
54         IGNORE_TABLE = "orm_warning_ignore_table";
55         IGNORE_QUERY = "orm_warning_ignore_query";
56         IGNORE_MAPPING = "orm_warning_ignore_mapping";
57         IGNORE_ID_CLASS = "orm_warning_ignore_id_class";
58         IGNORE_PRIMARY_KEY = "orm_warning_ignore_primary_key";
59         IGNORE_EMBEDDED_ID = "orm_warning_ignore_embedded_id";
60         IGNORE_INHERITANCE = "orm_warning_ignore_inheritance";
61         IGNORE_VERSION_LOCKING = "orm_warning_ignore_version_locking";
62     }
63     
64     /**
65      * INTERNAL:
66      * Logging utility method.
67      */

68     public void log(int level, String JavaDoc ctx, Object JavaDoc[] params) {
69         session.log(level, SessionLog.EJB_ORM, getLoggingContextString(ctx), params);
70     }
71     
72     /**
73      * INTERNAL:
74      * Populate context strings.
75      */

76     protected void populateContextStrings() {
77         super.populateContextStrings();
78         
79         ctxStrings.put(IGNORE_SECONDARY_TABLE, IGNORE_SECONDARY_TABLE);
80         ctxStrings.put(IGNORE_MAPPING_ON_WRITE, IGNORE_MAPPING_ON_WRITE);
81         ctxStrings.put(IGNORE_QUERY_HINT_UNSUPPORTED_TYPE, IGNORE_QUERY_HINT_UNSUPPORTED_TYPE);
82         ctxStrings.put(IGNORE_QUERY_HINT_UNKNOWN_TYPE, IGNORE_QUERY_HINT_UNKNOWN_TYPE);
83         ctxStrings.put(ERROR_LOADING_ORM_XML_FILE, ERROR_LOADING_ORM_XML_FILE);
84         ctxStrings.put(COULD_NOT_FIND_ORM_XML_FILE, COULD_NOT_FIND_ORM_XML_FILE);
85     }
86 }
87
Popular Tags