/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can
* obtain a copy of the License at
* or packager/legal/LICENSE.txt. See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at packager/legal/LICENSE.txt.
*
* GPL Classpath Exception:
* Oracle designates this particular file as subject to the "Classpath"
* exception as provided by Oracle in the GPL Version 2 section of the License
* file that accompanied this code.
*
* Modifications:
* If applicable, add the following below the License Header, with the fields
* enclosed by brackets [] replaced by your own identifying information:
* "Portions Copyright [year] [name of copyright owner]"
*
* Contributor(s):
* If you wish your version of this file to be governed by only the CDDL or
* only the GPL Version 2, indicate your decision by adding "[Contributor]
* elects to include this software in this distribution under the [CDDL or GPL
* Version 2] license." If you don't indicate a single choice of license, a
* recipient has the option to distribute your version of this file under
* either the CDDL, the GPL Version 2 or to extend the choice of license to
* its licensees as provided above. However, if you add GPL Version 2 code
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*/
/**
* Class LogDomains
*/
public class LogDomains {
/**
* DOMAIN_ROOT the prefix for the logger name. This is public only
*/
/**
* Upgrade logger name.
*/
/**
* PACKAGE_ROOT the prefix for the packages where logger resource
* the ias package space.
*/
/**
* RESOURCE_BUNDLE the name of the logging resource bundles.
*/
/**
* Field
*/
/**
* Field
*/
/**
* Field
*/
/**
* JavaMail Logger
*/
/**
* IIOP Logger
public static final String IIOP_LOGGER = DOMAIN_ROOT + "enterprise.resource.iiop";
*/
/**
* JMS Logger
*/
/**
* Field
*/
/**
* Field
*/
/**
* Field
*/
/**
* Field
*/
/**
* Field
*/
/**
* Field
*/
/**
* Field
*/
/**
* Field
*/
/**
* Field
*/
/**
* Field
*/
//START OF IASRI 4660742
/**
* Field
*/
/**
* Field
*/
/**
* Field
*/
/**
* Field
*/
/**
* Field
*/
/**
* Resource Logger
*/
//END OF IASRI 4660742
/**
* Deployment Logger
*/
/**
* Deployment audit logger
*/
public static final String DPLAUDIT_LOGGER = DOMAIN_ROOT + "enterprise.system.tools.deployment.audit";
/**
* Field
*/
public static final String DIAGNOSTICS_LOGGER = DOMAIN_ROOT + "enterprise.system.tools.diagnostics";
/**
* JAXRPC Logger
*/
/**
* JAXR Logger
*/
/**
* SAAJ Logger
*/
/**
* Self Management Logger
*/
public static final String SELF_MANAGEMENT_LOGGER = DOMAIN_ROOT + "enterprise.system.core.selfmanagement";
/**
* SQL Tracing Logger
*/
/**
* Admin Logger
*/
DOMAIN_ROOT + "enterprise.system.tools.admin";
/**
* Server Logger
*/
/**
* core Logger
*/
/**
* classloader Logger
*/
/**
* Config Logger
*/
/**
* Process Launcher Logger
*/
/**
* GMS Logger
*/
/**
* AMX Logger
*/
/**
* JMX Logger
*/
/**
*/
/**
* webservices logger
*/
/**
* monitoring logger
*/
/**
* persistence logger
*/
/**
* virtualization logger
*/
// Lock to ensure the Logger creation is synchronized (JDK 6U10 and before can deadlock)
// Use to store clazz name for which resource bundle is not found.
/**
* This is temporary and needed so that IAS can run with or without
* the com.sun.enterprise.server.logging.ServerLogger. The subclassed
* addLogger() method there automatically appends the logger name.
*/
// System.out.println("looking for bundle "+ result.replaceFirst(DOMAIN_ROOT, PACKAGE_ROOT));
}
/**
* Method getLogger
*
* @param clazz
* @param name
* @return
*/
if (l == null) {
//first time through for this logger. create it and find the resource bundle
// should be pass in a resource bundle?
}
;
// now create the real logger which is the logger name with the package name
// this is what will be returned.
//look for the resource bundle only in the package if not there then the resource
// bundle from the parent above will be used.
// we should only add a logger of the same name at time.
//first time through for this logger. create it and find the resource bundle
// cache it to avoid having to use the class loader later. see GLASSFISH-17256
/* override this method to set the the thread id so all handlers get the same info*/
}
}
//record.setThreadID((int) Thread.currentThread().getId());
}
}
/**
* Retrieve the localization resource bundle for this
* logger for the current default locale. Note that if
* the result is null, then the Logger will use a resource
* bundle inherited from its parent.
*
* @return localization bundle (may be null)
*
*/
public ResourceBundle getResourceBundle() {
return rb;
}
private ResourceBundle initResourceBundle() {
//call routine to add resource bundle if not already added
// the return needs to go through all known resource bundles
try {
} catch (MissingResourceException e) {
//try the parent
try {
} catch (MissingResourceException me) {
//walk the parents to find the bundle
while (p != null) {
try {
int i = p.lastIndexOf(".");
if (i != -1) {
p = p.substring(0, i);
} else {
p = null;
}
} catch (MissingResourceException mre) {
}
}
}
// look in this package for the file
try {
LogDomains.class.getClassLoader());
} catch (MissingResourceException me) {
}
if(l!=null) {
l.log(Level.FINE, "Can not find resource bundle for this logger. " + " class name that failed: " + clazz.getName());
}
}
//throw e;
return null;
}
}
;
};
// let's make sure we are the only
// We must not return an orphan logger (the one we just created) if
// a race condition has already created one
if (!addLoggerToLogManager(cLogger)) {
// Can loggers be removed? If not, this should be impossible
// this time, make the call and hope for the best.
} else {
}
}
};
return cLogger;
}
// bnevins April 30, 2009 -- there is a bug in the JDK having to do with
// the ordering of synchronization in the logger package.
// The work-around is to ALWAYS lock in the order that the JDK bug
// is assuming. That means lock A-B-A instead of B-A
// A == Logger.class, B == LogManager.class
// I created this method to make it very very clear what is going on
synchronized (Logger.class) {
}
}
}