public class QFactory
extends java.lang.Object
Constructor and Description |
---|
QFactory(javax.management.ObjectName loaderName,
Q2 q2) |
Modifier and Type | Method and Description |
---|---|
static void |
autoconfigure(java.lang.Object obj,
Configuration cfg) |
void |
configureQBean(javax.management.MBeanServer server,
javax.management.ObjectName objectName,
org.jdom2.Element e) |
javax.management.ObjectInstance |
createQBean(Q2 server,
org.jdom2.Element e,
java.lang.Object obj) |
void |
destroyQBean(Q2 server,
javax.management.ObjectName objectName,
java.lang.Object obj) |
javax.management.AttributeList |
getAttributeList(org.jdom2.Element e) |
java.lang.String |
getAttributeName(java.lang.String name)
sets the first character of the string to the upper case
|
static java.lang.String |
getAttributeValue(org.jdom2.Element e,
java.lang.String name) |
protected java.util.Collection |
getCollection(java.lang.Class type,
org.jdom2.Element e)
Creats a collection from a definition element with the format.
|
Configuration |
getConfiguration(org.jdom2.Element e) |
static java.lang.String |
getEagerStartAttribute(org.jdom2.Element e) |
static java.lang.String |
getEnabledAttribute(org.jdom2.Element e) |
protected java.lang.Object |
getObject(org.jdom2.Element childElement)
Creates an object from a definition element.
|
Q2 |
getQ2() |
java.lang.Object |
instantiate(Q2 server,
org.jdom2.Element e) |
static void |
invoke(java.lang.Object obj,
java.lang.String m,
java.lang.Object p)
Try to invoke a method (usually a setter) on the given object
silently ignoring if method does not exist
|
static void |
invoke(java.lang.Object obj,
java.lang.String m,
java.lang.Object p,
java.lang.Class pc)
Try to invoke a method (usually a setter) on the given object
silently ignoring if method does not exist
|
static boolean |
isEagerStart(org.jdom2.Element e) |
static boolean |
isEnabled(org.jdom2.Element e) |
<T> T |
newInstance(java.lang.Class<T> clazz) |
<T> T |
newInstance(java.lang.String clazz) |
void |
setAttribute(javax.management.MBeanServer server,
javax.management.ObjectName objectName,
java.lang.String attribute,
java.lang.Object value) |
void |
setConfiguration(java.lang.Object obj,
org.jdom2.Element e) |
void |
setLogger(java.lang.Object obj,
org.jdom2.Element e) |
void |
startQBean(Q2 server,
javax.management.ObjectName objectName) |
public QFactory(javax.management.ObjectName loaderName, Q2 q2)
public java.lang.Object instantiate(Q2 server, org.jdom2.Element e) throws javax.management.ReflectionException, javax.management.MBeanException, javax.management.InstanceNotFoundException
javax.management.ReflectionException
javax.management.MBeanException
javax.management.InstanceNotFoundException
public javax.management.ObjectInstance createQBean(Q2 server, org.jdom2.Element e, java.lang.Object obj) throws javax.management.MalformedObjectNameException, javax.management.InstanceAlreadyExistsException, javax.management.InstanceNotFoundException, javax.management.MBeanException, javax.management.NotCompliantMBeanException, javax.management.InvalidAttributeValueException, javax.management.ReflectionException, ConfigurationException
javax.management.MalformedObjectNameException
javax.management.InstanceAlreadyExistsException
javax.management.InstanceNotFoundException
javax.management.MBeanException
javax.management.NotCompliantMBeanException
javax.management.InvalidAttributeValueException
javax.management.ReflectionException
ConfigurationException
public Q2 getQ2()
public void setAttribute(javax.management.MBeanServer server, javax.management.ObjectName objectName, java.lang.String attribute, java.lang.Object value) throws javax.management.InstanceNotFoundException, javax.management.MBeanException, javax.management.InvalidAttributeValueException, javax.management.ReflectionException
javax.management.InstanceNotFoundException
javax.management.MBeanException
javax.management.InvalidAttributeValueException
javax.management.ReflectionException
public void startQBean(Q2 server, javax.management.ObjectName objectName) throws javax.management.InstanceNotFoundException, javax.management.MBeanException, javax.management.ReflectionException
javax.management.InstanceNotFoundException
javax.management.MBeanException
javax.management.ReflectionException
public void destroyQBean(Q2 server, javax.management.ObjectName objectName, java.lang.Object obj) throws javax.management.InstanceNotFoundException, javax.management.MBeanException, javax.management.ReflectionException
javax.management.InstanceNotFoundException
javax.management.MBeanException
javax.management.ReflectionException
public void configureQBean(javax.management.MBeanServer server, javax.management.ObjectName objectName, org.jdom2.Element e) throws ConfigurationException
ConfigurationException
public javax.management.AttributeList getAttributeList(org.jdom2.Element e) throws ConfigurationException
ConfigurationException
protected java.lang.Object getObject(org.jdom2.Element childElement) throws ConfigurationException
childElement
- Dom Element with the definition of the object.ConfigurationException
- If an exception is found trying to create the object.protected java.util.Collection getCollection(java.lang.Class type, org.jdom2.Element e) throws ConfigurationException
<{attr|item} type="...">- ...
...
type
- class typee
- the ElementConfigurationException
public java.lang.String getAttributeName(java.lang.String name)
name
- attribute namepublic <T> T newInstance(java.lang.String clazz) throws ConfigurationException
ConfigurationException
public <T> T newInstance(java.lang.Class<T> clazz) throws ConfigurationException
ConfigurationException
public Configuration getConfiguration(org.jdom2.Element e) throws ConfigurationException
ConfigurationException
public void setLogger(java.lang.Object obj, org.jdom2.Element e)
public static java.lang.String getAttributeValue(org.jdom2.Element e, java.lang.String name)
public void setConfiguration(java.lang.Object obj, org.jdom2.Element e) throws ConfigurationException
ConfigurationException
public static void invoke(java.lang.Object obj, java.lang.String m, java.lang.Object p) throws ConfigurationException
obj
- the objectm
- method to invokep
- parameterConfigurationException
- if method happens to throw an exceptionpublic static void invoke(java.lang.Object obj, java.lang.String m, java.lang.Object p, java.lang.Class pc) throws ConfigurationException
obj
- the objectm
- method to invokep
- parameterpc
- parameter classConfigurationException
- if method happens to throw an exceptionpublic static boolean isEnabled(org.jdom2.Element e)
public static boolean isEagerStart(org.jdom2.Element e)
public static java.lang.String getEnabledAttribute(org.jdom2.Element e)
public static java.lang.String getEagerStartAttribute(org.jdom2.Element e)
public static void autoconfigure(java.lang.Object obj, Configuration cfg) throws java.lang.IllegalAccessException
java.lang.IllegalAccessException