source: branches/objectmq_old/src/omq/common/util/Environment.java

Last change on this file was 36, checked in by stoda, 11 years ago

Fault tolerance in the client side added.
Some refactoring in proxymq, broker, environment and the client listeners

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