/** * Creates a strongly-typed proxy to access values in this {@link Dom} object, */ public <T extends ConfigBeanProxy> T createProxy() { return createProxy(this.<T>getProxyType()); }
/** * Another version of the {@link #invoke(Object, Method, Object[])}, * but instead of {@link Method} object, it takes the method name and argument types. */ public Object invoke(Object proxy, String methodName, Class[] argTypes, Object[] args) throws Throwable { return invoke( proxy, getProxyType().getMethod(methodName, argTypes), args ); }
/** * Replaces an existing {@link NodeChild} with another one. * * @see #insertAfter(Dom, String, Dom) */ public synchronized void replaceChild(Dom reference, String name, Dom newNode) { ListIterator<Child> itr = children.listIterator(); while(itr.hasNext()) { Child child = itr.next(); if (child instanceof NodeChild) { NodeChild nc = (NodeChild) child; if(nc.dom==reference) { reference.release(); newNode.domDescriptor = addWithAlias(getHabitat(), newNode,newNode.getProxyType(), newNode.getKey()); itr.set(new NodeChild(name,newNode)); return; } } } throw new IllegalArgumentException(reference+" is not a valid child of "+this+". Children="+children); }
newNode.domDescriptor = addWithAlias(getHabitat(), newNode, newNode.getProxyType(), newNode.getKey()); return; if(nc.dom==reference) { itr.add(newChild); newNode.domDescriptor = addWithAlias(getHabitat(), newNode, newNode.getProxyType(), newNode.getKey());
Set<ConfigListener> listeners = typeListeners.get(dom.getProxyType()); if (listeners!=null) { configListeners.addAll(listeners); if (oldValue instanceof ConfigBeanProxy) { Dom domOldValue = Dom.unwrap((ConfigBeanProxy) oldValue); Set<ConfigListener> typedListeners = typeListeners.get(domOldValue.<ConfigBeanProxy>getProxyType()); if (typedListeners!=null) { configListeners.addAll(typedListeners);
throw new IllegalArgumentException("A " + master.getProxyType().getSimpleName() + " with the same key \"" + keyValue + "\" already exists in " + parent.getProxyType().getSimpleName() + " " + parent.getKey()) ;
? parent.domNodeByTypeElements(thisview.getProxyType()) : new ArrayList<Dom>();
/** * Creates a strongly-typed proxy to access values in this {@link Dom} object, */ public <T extends ConfigBeanProxy> T createProxy() { return createProxy(this.<T>getProxyType()); }
/** * Creates a strongly-typed proxy to access values in this {@link Dom} object, */ public <T extends ConfigBeanProxy> T createProxy() { return createProxy(this.<T>getProxyType()); }
/** * Another version of the {@link #invoke(Object, Method, Object[])}, * but instead of {@link Method} object, it takes the method name and argument types. */ public Object invoke(Object proxy, String methodName, Class[] argTypes, Object[] args) throws Throwable { return invoke( proxy, getProxyType().getMethod(methodName, argTypes), args ); }
/** * Creates a strongly-typed proxy to access values in this {@link Dom} object, */ public <T extends ConfigBeanProxy> T createProxy() { return createProxy(this.<T>getProxyType()); }
/** * Creates a strongly-typed proxy to access values in this {@link Dom} object, */ public <T extends ConfigBeanProxy> T createProxy() { return createProxy(this.<T>getProxyType()); }
/** * Another version of the {@link #invoke(Object, Method, Object[])}, * but instead of {@link Method} object, it takes the method name and argument types. */ public Object invoke(Object proxy, String methodName, Class[] argTypes, Object[] args) throws Throwable { return invoke( proxy, getProxyType().getMethod(methodName, argTypes), args ); }
/** * Another version of the {@link #invoke(Object, Method, Object[])}, * but instead of {@link Method} object, it takes the method name and argument types. */ public Object invoke(Object proxy, String methodName, Class[] argTypes, Object[] args) throws Throwable { return invoke( proxy, getProxyType().getMethod(methodName, argTypes), args ); }
/** * Another version of the {@link #invoke(Object, Method, Object[])}, * but instead of {@link Method} object, it takes the method name and argument types. */ public Object invoke(Object proxy, String methodName, Class[] argTypes, Object[] args) throws Throwable { return invoke( proxy, getProxyType().getMethod(methodName, argTypes), args ); }
public Object run(ConfigBeanProxy param) { PropertyBag bag = (PropertyBag) param; final List<Property> propertyList = new ArrayList<Property>(bag.getProperty()); setProperty(target, attribute, getValue(propertyList, property)); final String message = MessageFormat.format("Moved {0}.property.{1} to {0}.{2}", Dom.convertName(Dom.unwrap(target).getProxyType().getSimpleName()), property, Dom.convertName(attribute)); report(context, message); bag.getProperty().clear(); bag.getProperty().addAll(propertyList); return param; } }, target);
public Object run(ConfigBeanProxy param) { PropertyBag bag = (PropertyBag) param; final List<Property> propertyList = new ArrayList<Property>(bag.getProperty()); setProperty(target, attribute, getValue(propertyList, property)); final String message = MessageFormat.format("Moved {0}.property.{1} to {0}.{2}", Dom.convertName(Dom.unwrap(target).getProxyType().getSimpleName()), property, Dom.convertName(attribute)); report(context, message); bag.getProperty().clear(); bag.getProperty().addAll(propertyList); return param; } }, target);
static public List<NetworkListener> findNetworkListeners(ThreadPool threadpool) { NetworkConfig config = threadpool.getParent().getParent(NetworkConfig.class); if (!Dom.unwrap(config).getProxyType().equals(NetworkConfig.class)) { config = Dom.unwrap(config).element("network-config").createProxy(); } List<NetworkListener> listeners = config.getNetworkListeners().getNetworkListener(); List<NetworkListener> refs = new ArrayList<NetworkListener>(); for (NetworkListener listener : listeners) { if (listener.getThreadPool().equals(threadpool.getName())) { refs.add(listener); } } return refs; }
static public List<NetworkListener> findNetworkListeners(ThreadPool threadpool) { NetworkConfig config = threadpool.getParent().getParent(NetworkConfig.class); if (!Dom.unwrap(config).getProxyType().equals(NetworkConfig.class)) { config = Dom.unwrap(config).element("network-config").createProxy(); } List<NetworkListener> listeners = config.getNetworkListeners().getNetworkListener(); List<NetworkListener> refs = new ArrayList<NetworkListener>(); for (NetworkListener listener : listeners) { if (listener.getThreadPool().equals(threadpool.getName())) { refs.add(listener); } } return refs; }
static public List<NetworkListener> findNetworkListeners(ThreadPool threadpool) { NetworkConfig config = threadpool.getParent().getParent(NetworkConfig.class); if (!Dom.unwrap(config).getProxyType().equals(NetworkConfig.class)) { config = Dom.unwrap(config).element("network-config").createProxy(); } List<NetworkListener> listeners = config.getNetworkListeners().getNetworkListener(); List<NetworkListener> refs = new ArrayList<NetworkListener>(); for (NetworkListener listener : listeners) { if (listener.getThreadPool().equals(threadpool.getName())) { refs.add(listener); } } return refs; }