View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.util;
8   
9   import org.mule.api.MuleContext;
10  import org.mule.config.i18n.CoreMessages;
11  
12  import java.util.Date;
13  
14  public class ApplicationShutdownSplashScreen extends SplashScreen
15  {
16      protected void doHeader(MuleContext context)
17      {
18          long currentTime = System.currentTimeMillis();
19          header.add(CoreMessages.applicationShutdownNormally(context.getConfiguration().getId(), new Date()).getMessage());
20          long duration = 10;
21          if (context.getStartDate() > 0)
22          {
23              duration = currentTime - context.getStartDate();
24          }
25          header.add(CoreMessages.applicationWasUpForDuration(duration).getMessage());
26      }
27  }
28  
29