/** * Creates a temporary ContainerConfig object that optionally contains a * copy of the current configuration. * * If you subclass {@link BasicContainerConfig} and you change its * internals, you must generally override this method to generate an object * of the same type as your subclass, and to fill its contents correctly. * * @param copyValues Whether the current configuration should be copied. * @return A new ContainerConfig object of the appropriate type. */ protected BasicContainerConfig getTemporaryConfig(boolean copyValues) { BasicContainerConfig tmp = new BasicContainerConfig(); if (copyValues) { tmp.config = deepCopyConfig(config); } return tmp; }
public void addConfigObserver(ConfigObserver observer, boolean notifyNow) { observers.add(observer); if (notifyNow) { notifyObservers(getContainers(), ImmutableSet.<String>of()); } }
public String getString(String container, String property) { Object value = getProperty(container, property); if (value == null) { return null; } return value.toString(); }
public void commit() throws ContainerConfigException { if (throwException != null) { throw throwException; } Set<String> removed = Sets.newHashSet(); Set<String> changed = Sets.newHashSet(); synchronized (BasicContainerConfig.this) { BasicContainerConfig tmpConfig = getTemporaryConfig(!clear); changeContainersInConfig(tmpConfig, setContainers, removeContainers); // This point will not be reached if an exception was thrown. diffConfiguration(tmpConfig, changed, removed); setNewConfig(tmpConfig); } notifyObservers(changed, removed); }
public void commit() throws ContainerConfigException { if (throwException != null) { throw throwException; } Set<String> removed = Sets.newHashSet(); Set<String> changed = Sets.newHashSet(); synchronized (BasicContainerConfig.this) { BasicContainerConfig tmpConfig = getTemporaryConfig(!clear); changeContainersInConfig(tmpConfig, setContainers, removeContainers); // This point will not be reached if an exception was thrown. diffConfiguration(tmpConfig, changed, removed); setNewConfig(tmpConfig); } notifyObservers(changed, removed); }
/** * Creates a temporary ContainerConfig object that optionally contains a * copy of the current configuration. * * If you subclass {@link BasicContainerConfig} and you change its * internals, you must generally override this method to generate an object * of the same type as your subclass, and to fill its contents correctly. * * @param copyValues Whether the current configuration should be copied. * @return A new ContainerConfig object of the appropriate type. */ protected BasicContainerConfig getTemporaryConfig(boolean copyValues) { BasicContainerConfig tmp = new BasicContainerConfig(); if (copyValues) { tmp.config = deepCopyConfig(config); } return tmp; }
@SuppressWarnings("unchecked") public <T> Map<String, T> getMap(String container, String property) { Object value = getProperty(container, property); if (value instanceof Map) { return (Map<String, T>) value; } return Collections.emptyMap(); }
public void addConfigObserver(ConfigObserver observer, boolean notifyNow) { observers.add(observer); if (notifyNow) { notifyObservers(getContainers(), ImmutableSet.<String>of()); } }
public void commit() throws ContainerConfigException { if (throwException != null) { throw throwException; } Set<String> removed = Sets.newHashSet(); Set<String> changed = Sets.newHashSet(); synchronized (BasicContainerConfig.this) { BasicContainerConfig tmpConfig = getTemporaryConfig(!clear); changeContainersInConfig(tmpConfig, setContainers, removeContainers); // This point will not be reached if an exception was thrown. diffConfiguration(tmpConfig, changed, removed); setNewConfig(tmpConfig); } notifyObservers(changed, removed); }
/** * Creates a temporary ContainerConfig object that optionally contains a * copy of the current configuration. * * If you subclass {@link BasicContainerConfig} and you change its * internals, you must generally override this method to generate an object * of the same type as your subclass, and to fill its contents correctly. * * @param copyValues Whether the current configuration should be copied. * @return A new ContainerConfig object of the appropriate type. */ protected BasicContainerConfig getTemporaryConfig(boolean copyValues) { BasicContainerConfig tmp = new BasicContainerConfig(); if (copyValues) { tmp.config = deepCopyConfig(config); } return tmp; }
@SuppressWarnings("unchecked") public <T> Map<String, T> getMap(String container, String property) { Object value = getProperty(container, property); if (value instanceof Map) { return (Map<String, T>) value; } return Collections.emptyMap(); }
public void addConfigObserver(ConfigObserver observer, boolean notifyNow) { observers.add(observer); if (notifyNow) { notifyObservers(getContainers(), ImmutableSet.<String>of()); } }
@Before public void setUp() throws Exception { config = new BasicContainerConfig(); codec = new BasicSecurityTokenCodec(config); }
@SuppressWarnings("unchecked") public <T> List<T> getList(String container, String property) { Object value = getProperty(container, property); if (value instanceof List) { return (List<T>) value; } return Collections.emptyList(); }
@Before public void setUp() throws Exception { config = new BasicContainerConfig(); codec = new BasicSecurityTokenCodec(config); }
public String getString(String container, String property) { Object value = getProperty(container, property); if (value == null) { return null; } return value.toString(); }
@Before public void setUp() throws Exception { config = new BasicContainerConfig(); codec = new BasicSecurityTokenCodec(config); }
@SuppressWarnings("unchecked") public <T> List<T> getList(String container, String property) { Object value = getProperty(container, property); if (value instanceof List) { return (List<T>) value; } return Collections.emptyList(); }
private TestDefaultIframeUriManager makeManager(boolean alwaysToken, boolean ldRequired, boolean enabled) throws ContainerConfigException { String altContainer = CONTAINER + "-alt"; ContainerConfig config = new BasicContainerConfig(); config .newTransaction()
@SuppressWarnings("unchecked") public <T> List<T> getList(String container, String property) { Object value = getProperty(container, property); if (value instanceof List) { return (List<T>) value; } return Collections.emptyList(); }