1
2
3
4
5
6
7
8
9
10
11 package org.mule.util;
12
13 import org.mule.api.MuleContext;
14 import org.mule.api.agent.Agent;
15 import org.mule.config.i18n.CoreMessages;
16
17 import java.util.Collection;
18 import java.util.Iterator;
19
20 public class ApplicationStartupSplashScreen extends SplashScreen
21 {
22 protected void doHeader(MuleContext context)
23 {
24 header.add("Application: " + context.getConfiguration().getId());
25 header.add(String.format("OS encoding: %s, Mule encoding: %s",
26 System.getProperty("file.encoding"),
27 context.getConfiguration().getDefaultEncoding()));
28 header.add(" ");
29 }
30
31 protected void doFooter(MuleContext context)
32 {
33
34 if (!body.isEmpty())
35 {
36 footer.add(" ");
37 }
38
39 Collection agents = context.getRegistry().lookupObjects(Agent.class);
40 if (agents.size() == 0)
41 {
42 footer.add(CoreMessages.agentsRunning().getMessage() + " "
43 + CoreMessages.none().getMessage());
44 }
45 else
46 {
47 footer.add(CoreMessages.agentsRunning().getMessage());
48 Agent agent;
49 for (Iterator iterator = agents.iterator(); iterator.hasNext();)
50 {
51 agent = (Agent) iterator.next();
52 footer.add(" " + agent.getDescription());
53 }
54 }
55 }
56 }