Package org.apache.felix.mosgi.jmx.agent.mx4j.log

Examples of org.apache.felix.mosgi.jmx.agent.mx4j.log.Logger


    * In case the system property is not defined or the class is not loadable or instantiable, a default
    * implementation is returned.
    */
   private ModifiableClassLoaderRepository createClassLoaderRepository()
   {
      Logger logger = getLogger();

      if (logger.isEnabledFor(Logger.TRACE)) logger.trace("Checking for system property " + MX4JSystemKeys.MX4J_MBEANSERVER_CLASSLOADER_REPOSITORY);

      String value = (String)AccessController.doPrivileged(new PrivilegedAction()
      {
         public Object run()
         {
            return System.getProperty(MX4JSystemKeys.MX4J_MBEANSERVER_CLASSLOADER_REPOSITORY);
         }
      });

      if (value != null)
      {
         if (logger.isEnabledFor(Logger.DEBUG)) logger.debug("Property found for custom ClassLoaderRepository; class is: " + value);

         try
         {
            ModifiableClassLoaderRepository repository = (ModifiableClassLoaderRepository)Thread.currentThread().getContextClassLoader().loadClass(value).newInstance();
            if (logger.isEnabledFor(Logger.TRACE)) logger.trace("Custom ClassLoaderRepository created successfully " + repository);
            return repository;
         }
         catch (Exception x)
         {
            if (logger.isEnabledFor(Logger.TRACE)) logger.trace("Custom ClassLoaderRepository could not be created", x);
         }
      }
      return new DefaultClassLoaderRepository();
   }
View Full Code Here

TOP

Related Classes of org.apache.felix.mosgi.jmx.agent.mx4j.log.Logger

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.