Package org.jboss.util

Examples of org.jboss.util.StopWatch


         final LifecycleState actual = this.getState();
         this.checkState(required, actual);

         // Initiate shutdown sequence
         log.info("Stopping: " + this);
         final StopWatch watch = new StopWatch(true);
         this.setState(LifecycleState.STOPPING);

         // Send JMX Notification
         this.sendStopJmxNotification();
View Full Code Here


               final LifecycleState actual = getState();
               checkState(required, actual);

               // Initiate start sequence
               log.infof("Starting: %s", thisRef);
               final StopWatch watch = new StopWatch(true);
               setState(LifecycleState.STARTING);

               // Start
               log.trace("Entering implementation class start...");
               doStart();
View Full Code Here

      {
         ClassLoader myCL = getClass().getClassLoader();
         Thread.currentThread().setContextClassLoader(myCL);

         // See how long it takes us to start up
         StopWatch watch = new StopWatch(true);

         // Remember when we we started
         startDate = new Date();

         // Install the shutdown hook
         shutdownHook = new ShutdownHook();
         shutdownHook.setDaemon(true);
        
         try
         {
            Runtime.getRuntime().addShutdownHook(shutdownHook);
            if (log != null && log.isDebugEnabled())
            {
               log.debug("Shutdown hook added " + shutdownHook);
            }
         }
         catch (Exception e)
         {
            log.warn("Failed to add shutdown hook; ignoring", e);
         }

         // Do the main start
         doStart(watch);

         // TODO Fix the TCL hack used here!
         ClassLoader cl = Thread.currentThread().getContextClassLoader();
         try
         {
            // Run the bootstraps
            for (Bootstrap bootstrap : bootstraps)
            {
               Thread.currentThread().setContextClassLoader(bootstrap.getClass().getClassLoader());
               startedBootstraps.add(0, bootstrap);
               bootstrap.start(this);
            }
         }
         finally
         {
            Thread.currentThread().setContextClassLoader(cl);
         }
        
         if (config.isInstallLifeThread())
         {
            lifeThread = new LifeThread();
            if (log != null && log.isDebugEnabled())
            {
               log.debug("Installing life thread " + lifeThread);
            }
            lifeThread.start();
         }

         started = true;

         // Send a notification that the startup is complete
         Notification msg = new Notification(START_NOTIFICATION_TYPE, this, 1);
         msg.setUserData(new Long(watch.getLapTime()));
         sendNotification(msg);

         watch.stop();

         if (jbossPackage != null)
         {
            // Tell the world how fast it was =)
            if (log != null)
View Full Code Here

      {
         ClassLoader myCL = getClass().getClassLoader();
         Thread.currentThread().setContextClassLoader(myCL);

         // See how long it takes us to start up
         StopWatch watch = new StopWatch(true);

         // Remember when we we started
         startDate = new Date();

         // Install the shutdown hook
         shutdownHook = new ShutdownHook();
         shutdownHook.setDaemon(true);
        
         try
         {
            Runtime.getRuntime().addShutdownHook(shutdownHook);
            log.debug("Shutdown hook added " + shutdownHook);
         }
         catch (Exception e)
         {
            log.warn("Failed to add shutdown hook; ignoring", e);
         }

         // Do the main start
         doStart(watch);

         // TODO Fix the TCL hack used here!
         ClassLoader cl = Thread.currentThread().getContextClassLoader();
         try
         {
            // Run the bootstraps
            for (Bootstrap bootstrap : bootstraps)
            {
               Thread.currentThread().setContextClassLoader(bootstrap.getClass().getClassLoader());
               startedBootstraps.add(0, bootstrap);
               bootstrap.start(this);
            }
         }
         finally
         {
            Thread.currentThread().setContextClassLoader(cl);
         }
        
         if (config.isInstallLifeThread())
         {
            lifeThread = new LifeThread();
            log.debug("Installing life thread " + lifeThread);
            lifeThread.start();
         }

         started = true;

         // Send a notification that the startup is complete
         Notification msg = new Notification(START_NOTIFICATION_TYPE, this, 1);
         msg.setUserData(new Long(watch.getLapTime()));
         sendNotification(msg);

         watch.stop();

         if (jbossPackage != null)
         {
            // Tell the world how fast it was =)
            log.info("JBoss (Microcontainer) [" + jbossPackage.getImplementationVersion() +
View Full Code Here

/*     */     try
/*     */     {
/* 374 */       ClassLoader myCL = getClass().getClassLoader();
/* 375 */       Thread.currentThread().setContextClassLoader(myCL);
/*     */
/* 378 */       StopWatch watch = new StopWatch(true);
/*     */
/* 381 */       this.startDate = new Date();
/*     */
/* 384 */       this.shutdownHook = new ShutdownHook();
/* 385 */       this.shutdownHook.setDaemon(true);
/*     */       try
/*     */       {
/* 389 */         Runtime.getRuntime().addShutdownHook(this.shutdownHook);
/* 390 */         this.log.debug("Shutdown hook added " + this.shutdownHook);
/*     */       }
/*     */       catch (Exception e)
/*     */       {
/* 394 */         this.log.warn("Failed to add shutdown hook; ignoring", e);
/*     */       }
/*     */
/* 398 */       doStart(watch);
/*     */
/* 401 */       ClassLoader cl = Thread.currentThread().getContextClassLoader();
/*     */       try
/*     */       {
/* 405 */         for (Bootstrap bootstrap : this.bootstraps)
/*     */         {
/* 407 */           Thread.currentThread().setContextClassLoader(bootstrap.getClass().getClassLoader());
/* 408 */           bootstrap.start(this);
/* 409 */           this.startedBootstraps.add(0, bootstrap);
/*     */         }
/*     */       }
/*     */       finally
/*     */       {
/* 414 */         Thread.currentThread().setContextClassLoader(cl);
/*     */       }
/*     */
/* 417 */       if (config.isInstallLifeThread())
/*     */       {
/* 419 */         this.log.debug("Installing life thread " + this.lifeThread);
/* 420 */         this.lifeThread = new LifeThread();
/* 421 */         this.lifeThread.start();
/*     */       }
/*     */
/* 424 */       this.started = true;
/*     */
/* 427 */       Notification msg = new Notification("org.jboss.system.server.started", this, 1L);
/* 428 */       msg.setUserData(new Long(watch.getLapTime()));
/* 429 */       sendNotification(msg);
/*     */
/* 431 */       watch.stop();
/*     */
/* 433 */       if (this.jbossPackage != null)
/*     */       {
/* 436 */         this.log.info("JBoss (Microcontainer) [" + this.jbossPackage.getImplementationVersion() + "] Started in " + watch);
/*     */       }
View Full Code Here

         final LifecycleState actual = this.getState();
         this.checkState(required, actual);

         // Initiate shutdown sequence
         log.info("Stopping: " + this);
         final StopWatch watch = new StopWatch(true);
         this.setState(LifecycleState.STOPPING);

         // Send JMX Notification
         this.sendStopJmxNotification();
View Full Code Here

               final LifecycleState actual = getState();
               checkState(required, actual);

               // Initiate start sequence
               log.info("Starting: " + thisRef);
               final StopWatch watch = new StopWatch(true);
               setState(LifecycleState.STARTING);

               // Start
               if (log.isTraceEnabled())
               {
View Full Code Here

TOP

Related Classes of org.jboss.util.StopWatch

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.