Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.cantaa.util;
Use this class to determine in which Application we currenty are. For instance: the Import-Scheduler must only run in the MBAK-Application and not in the Admin-Application. in Wicket-Applications, the type is determined by AbstractApplicationFactory. In other Applications, the Method setApplicationType(...) can be called at program start directly

Hans Lesmeister
public final class Environment {
    private static final Logger log = LoggerFactory.getLogger(Environment.class);
    private static volatile String applicationType = null;
    private static final Object synchronizedObject = new Object();
    public static void setApplicationType(String newApplicationType) {
        synchronized() {
             = newApplicationType;
    public static String getApplicationType() {
        return ;
    public static boolean isApplicationWithType(String type) {
        String s = ;
        .debug("isApplicationWithType[type={}, systemProp={}]"types);
        if (type == null) {
            return (s == null);
        return type.equals(s);
New to GrepCode? Check out our FAQ X