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.config;
8   
9   import java.util.Collections;
10  import java.util.Map;
11  
12  /**
13   * A class holding cross-cutting startup info.
14   */
15  public class StartupContext
16  {
17      private static final ThreadLocal<StartupContext> info = new ThreadLocal<StartupContext>()
18      {
19          @Override
20          protected StartupContext initialValue()
21          {
22              return new StartupContext();
23          }
24      };
25  
26      private Map<String, Object> startupOptions = Collections.emptyMap();
27  
28      public static StartupContext get()
29      {
30          return info.get();
31      }
32  
33      public Map<String, Object> getStartupOptions()
34      {
35          return Collections.unmodifiableMap(startupOptions);
36      }
37  
38      public void setStartupOptions(Map<String, Object> startupOptions)
39      {
40          this.startupOptions = startupOptions;
41      }
42  }