public ChildApplicationContextFactory getChildApplicationContextFactory(String id) { lock.readLock().lock(); try { DefaultChildApplicationContextManager.ApplicationContextManagerState state = (DefaultChildApplicationContextManager.ApplicationContextManagerState)getState(true); return state.getApplicationContextFactory(id); } finally { lock.readLock().unlock(); } }
public ApplicationContext getApplicationContext(String id) { this.lock.readLock().lock(); try { return ((ApplicationContextManagerState) getState(true)).getApplicationContext(id); } finally { this.lock.readLock().unlock(); } }
public Collection<String> getInstanceIds() { this.lock.readLock().lock(); try { return ((ApplicationContextManagerState) getState(true)).getInstanceIds(); } finally { this.lock.readLock().unlock(); } }
for (String id : state.getInstanceIds()) ChildApplicationContextFactory factory = state.getApplicationContextFactory(id); factory.lock.writeLock().lock(); try
for (String id : state.getInstanceIds()) ChildApplicationContextFactory factory = state.getApplicationContextFactory(id); factory.lock.writeLock().lock(); try
updateOrder(defaultChain, AbstractPropertyBackedBean.DEFAULT_INSTANCE_NAME); this.defaultTypeName = this.childApplicationContexts.get(this.instanceIds.get(0)).getTypeName(); updateOrder(defaultChain, defaultTypeName);
updateOrder(defaultChain, AbstractPropertyBackedBean.DEFAULT_INSTANCE_NAME); this.defaultTypeName = this.childApplicationContexts.get(this.instanceIds.get(0)).getTypeName(); updateOrder(defaultChain, defaultTypeName);
public void start() { boolean oneSuccess = false; RuntimeException lastError = null; for (String instance : getInstanceIds()) { try { getApplicationContext(instance); oneSuccess = true; } catch (RuntimeException e) { // One of the subsystems failed to initialize. The cause would have been logged. Treat this as // non-fatal lastError = e; } } // If we weren't able to start any subsystems, then pass on the last error if (lastError != null && !oneSuccess) { throw lastError; } }
public void start() { boolean oneSuccess = false; RuntimeException lastError = null; for (String instance : getInstanceIds()) { try { getApplicationContext(instance); oneSuccess = true; } catch (RuntimeException e) { // One of the subsystems failed to initialize. The cause would have been logged. Treat this as // non-fatal lastError = e; } } // If we weren't able to start any subsystems, then pass on the last error if (lastError != null && !oneSuccess) { throw lastError; } }
public ChildApplicationContextFactory getChildApplicationContextFactory(DefaultChildApplicationContextManager childApplicationContextManager, String id) { childApplicationContextManager.lock.readLock().lock(); try { DefaultChildApplicationContextManager.ApplicationContextManagerState state = (DefaultChildApplicationContextManager.ApplicationContextManagerState) childApplicationContextManager .getState(true); return state.getApplicationContextFactory(id); } finally { childApplicationContextManager.lock.readLock().unlock(); } }
public String getProperty(String name) { if (!name.equals(DefaultChildApplicationContextManager.ORDER_PROPERTY)) { return null; } return getOrderString(); }
@Override protected PropertyBackedBeanState createInitialState() throws IOException { return new ApplicationContextManagerState(this.defaultChain, this.defaultTypeName); }
public ChildApplicationContextFactory getChildApplicationContextFactory(String id) { lock.readLock().lock(); try { DefaultChildApplicationContextManager.ApplicationContextManagerState state = (DefaultChildApplicationContextManager.ApplicationContextManagerState)getState(true); return state.getApplicationContextFactory(id); } finally { lock.readLock().unlock(); } }
public void setProperty(String name, String value) { if (!name.equals(DefaultChildApplicationContextManager.ORDER_PROPERTY)) { throw new IllegalStateException("Illegal attempt to write to property \"" + name + "\""); } updateOrder(value, this.defaultTypeName); }
public String getProperty(String name) { if (!name.equals(DefaultChildApplicationContextManager.ORDER_PROPERTY)) { return null; } return getOrderString(); }
public Collection<String> getInstanceIds() { this.lock.readLock().lock(); try { return ((ApplicationContextManagerState) getState(true)).getInstanceIds(); } finally { this.lock.readLock().unlock(); } }
public void setProperty(String name, String value) { if (!name.equals(DefaultChildApplicationContextManager.ORDER_PROPERTY)) { throw new IllegalStateException("Illegal attempt to write to property \"" + name + "\""); } updateOrder(value, this.defaultTypeName); }
@Override protected PropertyBackedBeanState createInitialState() throws IOException { return new ApplicationContextManagerState(this.defaultChain, this.defaultTypeName); }
public ApplicationContext getApplicationContext(String id) { this.lock.readLock().lock(); try { return ((ApplicationContextManagerState) getState(true)).getApplicationContext(id); } finally { this.lock.readLock().unlock(); } }