Hi Willem,
abstract="true" allows you to skip the class name and has the effect
that no bean is ever created from that bean info.
In fact this is what we want, as in the case of the CXF bus the
instrumentation manager is created by the runtime - therefore we don't
need the IOC container create another one for us. It would be a big
deal to, even if we restricted the type of what's created to be only the
base class, i.e.
class="org.apache.cxf.management.InstrumentationManagerConfigBean" -
it's just not necessary to have two instances.
All we need from the IOC container is the bean definition - in order to
inject the properties into the already created object.
Another option is to set the lazy-init attribute to true, but in that
case you have to specify a class name (does not matter which one though
as in the CXF bus case this bean is normally not referenced, and hence
never instantiated).
The cfg file will look a bit different when you are using the SpringBus
- in that case it'll be:
<bean id="org.apache.cxf.management.InstrumentationManager"
class="org.apache.cxf.management.InstrumentationManagerImpl">
<property name="bus" ref="cxf"/>
<property name="instrumentation">
<value>
<im:instrumentation Enabled="true" JMXEnabled="true"/>
</value>
</property>
</bean>
i.e. overwriting the bean definition in the cxf-extensions.xml fragment
in cxf-rt-management.
Now the class of the bean matters, and the bean cannot be declared abtract!
Andrea.
Jiang Ning wrote:
Hi Andrea
Just a quick question about your latest commit which includes an
management configuration.
<bean id="org.apache.cxf.management.InstrumentationManager"
abstract="true">
I checked abstract with the spring reference :
Is this bean "abstract", i.e. not meant to be instantiated itself but
rather just serving as parent for concrete child bean definitions.
I can't tell which is the parent and which is child.
I got the example from spring reference CH3
<bean id="inheritedTestBeanWithoutClass" abstract="true">
<property name="name" value="parent"/>
<property name="age" value="1"/>
</bean>
<bean id="inheritsWithClass"
class="org.springframework.beans.DerivedTestBean"
parent="inheritedTestBeanWithoutClass" init-method="initialize">
<property name="name" value="override"/>
/<!-- age will inherit value of 1 from parent -->/
</bean>
So org.apache.cxf.management.InstrumentationManager just the Templet
bean. How can this bean value be set to InstrumentationManagerConfigBean?
What does the bean's id mean to InstrumentationManagerConfigBean which
is really used in management?
Thanks
Willem.
Andrea Smyth wrote:
Jiang Ning wrote:
Hi Andrea,
Thank you for your replay. Just one more question I want to ask,
current configuration Spring Beans provider getter ,setter method
and can be set the value by Spring reading the configure xml, but If
the Spring Beans values of complex types which are generated by JAXB
not support this.
Hi Willem,
This is supported - see test case
org.apache.cxf.configuraton.spring.JaxbPropertyEditorTest in
cxf-common-utilities.
It's just that these complex types, or rather property editors for
them, have to be registered.
I'll commit a fix soon.
Cheers,
Andrea.
eg. If I just want to enable the JMS In the configuration, how can I
just write the configuration like this.
<bean class="org.apache.cxf.management.InstrumentationConfigBean">
<property name="instrumentationControl">
<value>
<bean
class="org.apache.cxf.management.InstrumentationType">
<property name
="jMXEnabled" value= "true"/>
</bean>
</value>
</property>
</bean>
Thanks,
Willem.
Andrea Smyth wrote:
Hi Willem,
First I need to get the property editors for the non-standard types
registered - I have created JIRA CXF-123 for this.
Second, you should update the contents of the value elements below
to conform to the new (simplified) instrumentation.xsd schema.
Will let you know when the CXF-123 is resolved.
Andrea.
Jiang Ning wrote:
Hi Adrea,
I had tried to use the new cxf configuration for management. I
can't make the xjc created class be set value by spring config xml.
Here is the Celtix style configuration to enable the JMX and setup
the JMX Connetor's URL.
<bean class="org.apache.cxf.management.InstrumentationConfigBean">
<property name="instrumentationControl">
<value>
<im:instrumentation>
<im:InstrumentationEnabled>true</im:InstrumentationEnabled>
<im:JMXEnabled>true</im:JMXEnabled>
</im:instrumentation>
</value>
</property>
<property name="MBServer">
<value>
<im:MBServer>
<im:JMXConnector>
<im:Threaded>true</im:Threaded>
<im:Daemon>false</im:Daemon>
<im:JMXServiceURL>service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi/server</im:JMXServiceURL>
</im:JMXConnector>
</im:MBServer>
</value>
</property>
</bean>
Can you get me the example how can these complex value type can be
set with the new CXF configuration.
Thanks,
Willem.