| 1 | |
package com.ctrip.framework.apollo.biz.utils; |
| 2 | |
|
| 3 | |
import com.ctrip.framework.apollo.biz.service.ServerConfigService; |
| 4 | |
|
| 5 | |
import org.springframework.beans.factory.annotation.Autowired; |
| 6 | |
import org.springframework.stereotype.Component; |
| 7 | |
|
| 8 | |
@Component |
| 9 | 1 | public class ApolloSwitcher { |
| 10 | |
|
| 11 | |
private static final String NAMESPACE_LOCK_SWITCH_CONFIG_KEY = "namespace.lock.switch"; |
| 12 | |
|
| 13 | |
@Autowired |
| 14 | |
private ServerConfigService serverConfigService; |
| 15 | |
|
| 16 | |
|
| 17 | |
public boolean isNamespaceLockSwitchOff() { |
| 18 | 0 | return !"true".equals(serverConfigService.getValue(NAMESPACE_LOCK_SWITCH_CONFIG_KEY, "false")); |
| 19 | |
} |
| 20 | |
|
| 21 | |
} |