Line | |
---|
1 | package omq.common.util; |
---|
2 | |
---|
3 | import java.util.Properties; |
---|
4 | |
---|
5 | import omq.exception.EnvironmentException; |
---|
6 | |
---|
7 | |
---|
8 | /** |
---|
9 | * |
---|
10 | * @author Sergi Toda <sergi.toda@estudiants.urv.cat> |
---|
11 | * |
---|
12 | */ |
---|
13 | public class Environment { |
---|
14 | private static Properties env; |
---|
15 | |
---|
16 | /** |
---|
17 | * This method return the environment of the middleware |
---|
18 | * |
---|
19 | * @return Environment to use in the middleware |
---|
20 | * @throws EnvironmentException |
---|
21 | * will be thrown whether the environment is null |
---|
22 | */ |
---|
23 | public static Properties getEnvironment() throws EnvironmentException { |
---|
24 | if (env == null) { |
---|
25 | throw new EnvironmentException(); |
---|
26 | } |
---|
27 | return env; |
---|
28 | } |
---|
29 | |
---|
30 | /** |
---|
31 | * This method sets the environment of the middleware |
---|
32 | * |
---|
33 | * @param environment |
---|
34 | */ |
---|
35 | public static void setEnvironment(Properties environment) { |
---|
36 | env = environment; |
---|
37 | } |
---|
38 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.