@Override public void afterPropertiesSet() throws Exception { // Derive a default and instance key prefix of the form "<parent>.default." and "<parent>.value.<this>." StringBuilder defaultKeyPrefixBuff = new StringBuilder(200); StringBuilder instanceKeyPrefixBuff = new StringBuilder(200); List<String> id = getInstancePath(); int size = id.size(); if (size > 1) { defaultKeyPrefixBuff.append(id.get(size - 2)).append('.'); instanceKeyPrefixBuff.append(defaultKeyPrefixBuff); } defaultKeyPrefixBuff.append("default."); instanceKeyPrefixBuff.append("value.").append(id.get(size - 1)).append('.'); this.defaultKeyPrefix = defaultKeyPrefixBuff.toString(); this.instanceKeyPrefix = instanceKeyPrefixBuff.toString(); // Set initial values according to property defaults. super.afterPropertiesSet(); }
@Override public String getDescription(String name) { if(name.equals(ChildApplicationContextFactory.TYPE_NAME_PROPERTY)) { return "Read-only subsystem type name"; } if(name.equals(ChildApplicationContextFactory.INSTANCE_PATH_PROPERTY)) { return "Read-only instance path"; } if(this.compositePropertyTypes.containsKey(name)) { return "Comma separated list of child object names"; } return super.getDescription(name); }
/** * {@inheritDoc} */ public void afterPropertiesSet() throws Exception { // Default the category to the bean name if (this.category == null) { if (this.beanName == null) { throw new IllegalStateException("Category not provided"); } this.category = this.beanName; } // Derive the unique ID from the category and instance path List<String> path = getInstancePath(); this.id = new ArrayList<String>(path.size() + 1); this.id.add(this.category); this.id.addAll(getInstancePath()); init(); }
boolean mBeanInfoChange = !getPropertyNames().containsAll(properties.keySet()); start(true, false); setPropertiesInternal(properties); setPropertiesInternal(properties);
try boolean mBeanInfoChange = !getPropertyNames().contains(name); start(false, true); setPropertyInternal(name, value); setPropertyInternal(name, value);
boolean mBeanInfoChange = !getPropertyNames().containsAll(properties); start(true, false); removePropertiesInternal(properties); removePropertiesInternal(properties);
/** * Initializes or resets the bean and its state. */ public final void init() { this.lock.writeLock().lock(); try { doInit(); } finally { this.lock.writeLock().unlock(); } }
this.state = createInitialState(); logger.debug("doInit() applyDefaultOverrides "+state); applyDefaultOverrides(this.state); this.runtimeState = RuntimeState.STOPPED; logger.debug("doInit() register");
/** * {@inheritDoc} */ public final void destroy() { this.lock.writeLock().lock(); try { destroy(false); } finally { this.lock.writeLock().unlock(); } }
/** * {@inheritDoc} */ public String getDescription(String name) { return isUpdateable(name) ? "Editable Property " + name : "Read-only Property " + name; }
@Override protected void applyDefaultOverrides(PropertyBackedBeanState state) throws IOException { // Let the superclass propagate default settings from the global properties and register us super.applyDefaultOverrides(state); List<String> idList = getId(); // Apply any property overrides from the extension classpath and also allow system properties and JNDI to // override. We use the type name and last component of the ID in the path JndiPropertiesFactoryBean overrideFactory = new JndiPropertiesFactoryBean(); overrideFactory.setPropertiesPersister(getPersister()); overrideFactory.setSystemPropertiesMode(PropertyPlaceholderConfigurer.SYSTEM_PROPERTIES_MODE_OVERRIDE); overrideFactory.setLocations(getParent().getResources( ChildApplicationContextFactory.EXTENSION_CLASSPATH_PREFIX + getCategory() + '/' + getTypeName() + '/' + idList.get(idList.size() - 1) + ChildApplicationContextFactory.PROPERTIES_SUFFIX)); overrideFactory.setProperties(((ApplicationContextState) state).properties); overrideFactory.afterPropertiesSet(); ((ApplicationContextState) state).properties = (Properties) overrideFactory.getObject(); }
boolean mBeanInfoChange = !getPropertyNames().containsAll(properties.keySet()); start(true, false); setPropertiesInternal(properties); setPropertiesInternal(properties);
try boolean mBeanInfoChange = !getPropertyNames().contains(name); start(false, true); setPropertyInternal(name, value); setPropertyInternal(name, value);
boolean mBeanInfoChange = !getPropertyNames().containsAll(properties); start(true, false); removePropertiesInternal(properties); removePropertiesInternal(properties);