KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jdo > spi > persistence > support > sqlstore > ejb > LoggerFactoryiAS


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 in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
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 Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 package com.sun.jdo.spi.persistence.support.sqlstore.ejb;
25
26 import java.util.logging.Level JavaDoc;
27 import java.security.AccessController JavaDoc;
28 import java.security.PrivilegedAction JavaDoc;
29
30 import com.sun.jdo.spi.persistence.utility.logging.LoggerFactoryJDK14;
31 import com.sun.jdo.spi.persistence.utility.logging.LoggerJDK14;
32
33 import com.sun.enterprise.server.logging.ServerLogManager;
34 import com.sun.logging.LogDomains;
35
36 /**
37  *
38  * @author Craig Russell
39  * @version 1.0
40  */

41
42 public class LoggerFactoryiAS extends LoggerFactoryJDK14 {
43
44     /** The top level of the logger domain for application server.
45      */

46     protected String JavaDoc DOMAIN_ROOT = "javax.enterprise.resource.jdo."; //NOI18N
47

48     /** Creates new LoggerFactory */
49     public LoggerFactoryiAS() {
50     }
51
52     
53     protected String JavaDoc getDomainRoot() {
54         return DOMAIN_ROOT;
55     }
56     
57     /** Create a new Logger. Create a logger for the named component.
58      * The bundle name is passed to allow the implementation
59      * to properly find and construct the internationalization bundle.
60      *
61      * This operation is executed as a privileged action to allow
62      * permission access for the following operations:
63      * ServerLogManager.initializeServerLogger
64      *
65      * @param absoluteLoggerName the absolute name of this logger
66      * @param bundleName the fully qualified name of the resource bundle
67      * @return the logger
68      */

69     protected LoggerJDK14 createLogger (final String JavaDoc absoluteLoggerName,
70                                         final String JavaDoc bundleName) {
71         return (LoggerJDK14) AccessController.doPrivileged (
72             new PrivilegedAction JavaDoc () {
73                 public Object JavaDoc run () {
74                     LoggerJDK14 result = new LoggerJDK14(absoluteLoggerName, bundleName);
75                     //Handlers and Formatters will be set in addLogger().
76
//ServerLogManager.initializeServerLogger(result);
77

78                     return result;
79                 }
80             }
81         );
82     }
83     
84     /**
85      * This method is a no-op in the Sun ONE Application server.
86      */

87     protected void configureFileHandler(LoggerJDK14 logger) {
88     }
89
90 }
91
92
Popular Tags