Package mx4j.log

Examples of mx4j.log.Logger


      stopped = true;
      active = false;

      doStop();

      Logger logger = getLogger();
      if (logger.isEnabledFor(Logger.INFO)) logger.info("JMXConnectorServer stopped at: " + getAddress());
   }
View Full Code Here


               input.completeReply();
               return result;
            }
            catch (Throwable x)
            {
               Logger logger = Log.getLogger(CauchoClientInvoker.class.getName());
               if (logger.isEnabledFor(Logger.DEBUG)) logger.debug("", x);
               throw x;
            }
            finally
            {
               is.close();
View Full Code Here

   public void handleNotification(Notification notification, Object handback)
   {
      if (notificationName != null && !notification.getType().equals(notificationName)) return;

      Logger logger = getLogger();
      if (logger.isEnabledFor(Logger.DEBUG)) logger.debug("Notification " + notification + " hit, sending message");
      runScript();
   }
View Full Code Here

         {
            script = loadStream(scriptFile.openStream());
         }
         catch (IOException e)
         {
            Logger log = getLogger();
            log.error("Exception during url opening", e);
         }
      }
      interp.exec(script);
   }
View Full Code Here

            server.addNotificationListener(targetMBeanName, this, new MessageFilter(), null);
         }
      }
      catch (InstanceNotFoundException e)
      {
         Logger log = getLogger();
         log.error("Exception during notification registration", e);
      }
   }
View Full Code Here

            server.removeNotificationListener(targetMBeanName, this);
         }
      }
      catch (InstanceNotFoundException e)
      {
         Logger log = getLogger();
         log.error("Exception during notification unregistration", e);
      }
      catch (ListenerNotFoundException e)
      {
      }
   }
View Full Code Here

      {
         throw x;
      }
      catch (Exception x)
      {
         Logger logger = getLogger();
         if (logger.isEnabledFor(Logger.INFO)) logger.info("Exception while deploying AXIS service", x);
         throw new IOException("Could not deploy connector server to AXIS " + x.toString());
      }
   }
View Full Code Here

         if (wsdd == null) throw new IOException("Could not find AXIS deployment descriptor " + SERVER_UNDEPLOY_WSDD);
         deployer.process(options, wsdd);
      }
      catch (Exception x)
      {
         Logger logger = getLogger();
         if (logger.isEnabledFor(Logger.INFO)) logger.info("Exception while undeploying AXIS service", x);
         throw new IOException("Could not undeploy connector server " + x.toString());
      }
   }
View Full Code Here

      StringBuffer buffer = new StringBuffer(loweredName);
      buffer.replace(0, 1, loweredName.substring(0, 1).toUpperCase());
      String className = getClass().getName() + "$" + buffer.toString();
      try
      {
         Logger logger = getLogger();
         if (logger.isEnabledFor(Logger.TRACE)) logger.trace("Creating configuration node " + className);
         return (ConfigurationBuilder.Node)getClass().getClassLoader().loadClass(className).newInstance();
      }
      catch (Exception x)
      {
         throw new ConfigurationException(x);
View Full Code Here

    */
   public synchronized void start() throws Exception
   {
      if (isRunning()) return;

      final Logger logger = getLogger();

// We start another thread because Process.waitFor() blocks until the process is destroyed.
      Thread thread = new Thread(new Runnable()
      {
         public void run()
         {
            String home = getJavaHomeBin();

            String command = (home == null ? "" : home) + "tnameserv -ORBInitialPort " + getPort();
            try
            {
               m_process = Runtime.getRuntime().exec(command);
               if (logger.isEnabledFor(Logger.DEBUG)) logger.debug("Process created: " + m_process);
            }
            catch (IOException x)
            {
               if (logger.isEnabledFor(Logger.DEBUG)) logger.debug("Could not create process", x);
               exception = x;
               return;
            }

            m_output = new InputStreamConsumer(m_process.getInputStream());
            m_error = new InputStreamConsumer(m_process.getErrorStream());
            m_output.start();
            m_error.start();

            m_running = true;

            try
            {
// Blocks until the process is destroyed
               int result = m_process.waitFor();
               if (logger.isEnabledFor(Logger.DEBUG)) logger.debug("Exit value is: " + result);

// If we're still running after waitFor() returns, means stop() has not been called
// so the process has returned unexpectedly
               if (isRunning())
               {
                  stop();
                  if (logger.isEnabledFor(Logger.INFO)) logger.info("Unexpected exception (maybe the port " + getPort() + " is already in use)");
               }
            }
            catch (InterruptedException x)
            {
               if (logger.isEnabledFor(Logger.DEBUG)) logger.debug("Process has been interrupted", x);
               stop();
            }
         }
      }, "CosNamingService Thread");

      thread.setDaemon(true);
      thread.start();

      while (!m_running && exception == null) wait(10);

      if (exception != null) throw exception;

      if (logger.isEnabledFor(Logger.TRACE)) logger.trace("CosNamingService started");
   }
View Full Code Here

TOP

Related Classes of 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.