public ApplicationContext getApplicationContext() { this.lock.readLock().lock(); try { return ((SwitchableState) getState(true)).getApplicationContext(); } finally { this.lock.readLock().unlock(); } }
@Override public void setProperty(String name, String value) { if (!isUpdateable(name)) { if(value.equalsIgnoreCase(unencryptedContentStoreBeanName)) { throw new IllegalStateException("Switching to an unencrypted content store is not possible."); } if(value.equalsIgnoreCase(encryptedContentStoreBeanName)) { throw new IllegalStateException("Switching to an encrypted content store is not licensed."); } throw new IllegalStateException("Switching to an unknown content store is not possible." + value); } super.setProperty(name, value); } }
public void setProperty(String name, String value) { if (!name.equals(SwitchableApplicationContextFactory.SOURCE_BEAN_PROPERTY)) { throw new IllegalStateException("Illegal attempt to write to property \"" + name + "\""); } if (!getParent().containsBean(value)) { throw new IllegalStateException("\"" + value + "\" is not a valid bean name"); } if (this.sourceApplicationContextFactory != null) { stop(); this.sourceBeanName = value; start(); } else { this.sourceBeanName = value; } }
@Override public void setProperty(String name, String value) { if (!isUpdateable(name)) { if(value.equalsIgnoreCase(unencryptedContentStoreBeanName)) { throw new IllegalStateException("Switching to an unencrypted content store is not possible."); } if(value.equalsIgnoreCase(encryptedContentStoreBeanName)) { throw new IllegalStateException("Switching to an encrypted content store is not licensed."); } throw new IllegalStateException("Switching to an unknown content store is not possible." + value); } super.setProperty(name, value); } }
public void setProperty(String name, String value) { if (!name.equals(SwitchableApplicationContextFactory.SOURCE_BEAN_PROPERTY)) { throw new IllegalStateException("Illegal attempt to write to property \"" + name + "\""); } if (!getParent().containsBean(value)) { throw new IllegalStateException("\"" + value + "\" is not a valid bean name"); } if (this.sourceApplicationContextFactory != null) { stop(); this.sourceBeanName = value; start(); } else { this.sourceBeanName = value; } }
/** * Gets the application context. * * @return the application context */ public ApplicationContext getApplicationContext() { if (this.sourceApplicationContextFactory == null) { start(); } return this.sourceApplicationContextFactory.getApplicationContext(); }
/** * Gets the application context. * * @return the application context */ public ApplicationContext getApplicationContext() { if (this.sourceApplicationContextFactory == null) { start(); } return this.sourceApplicationContextFactory.getApplicationContext(); }
@Override protected PropertyBackedBeanState createInitialState() throws IOException { return new SwitchableState(this.sourceBeanName); }
public ApplicationContext getApplicationContext() { this.lock.readLock().lock(); try { return ((SwitchableState) getState(true)).getApplicationContext(); } finally { this.lock.readLock().unlock(); } }
@Override protected PropertyBackedBeanState createInitialState() throws IOException { return new SwitchableState(this.sourceBeanName); }