-
1. Re: ManagedObjects for MBeans
alesj Mar 23, 2009 1:40 PM (in response to ips)"ips" wrote:
Otherwise, we would have to parse the component names to figure out which type of jboss.web MBean we are dealing with.
This is definitely how it should _not_ be done. ;-)
Depending on the name is just bad contract.
e.g. we might drop the names in MC, just have aliases for some beans -
2. Re: ManagedObjects for MBeans
ips Mar 23, 2009 3:34 PM (in response to ips)I'm glad you agree :)
The jboss.web ManagedComponents are not the only place such lumping together is done. For example, the ComponentType{type=MCBean, subtype=*} component type is used as the type for a bunch of different types of underlying MBeans. -
3. Re: ManagedObjects for MBeans
starksm64 Mar 27, 2009 1:11 PM (in response to ips)The generic mbean to ManagedComponent feature I'm working on will allow the ComponentType to be specified, so it can be unique to the ManagedComponent.
-
4. Re: ManagedObjects for MBeans
starksm64 Apr 1, 2009 5:26 PM (in response to ips)We can have whatever ComponentType we want on a ManagedObject as these are being set explicitly for the current set of MangedObjects. We should setup a Wiki page that lists the standard ManangedComponent names and their ComponentTypes, and we can start updating the ComponentType based on that.
-
5. Re: ManagedObjects for MBeans
starksm64 May 4, 2009 6:12 PM (in response to ips)For the GA I have taken a new turn that adds a ManagedMBeanDeploymentFactory notion along with injection into the ManagementView bean to allow one to setup the mapping between mbeans and ManagedDeployment/ManagedComponents. Its not completely finished or tested, but an example of getting some of the web app/servlet components are:
<bean name="WarManagerManagedDeploymentFactory" class="org.jboss.profileservice.management.ProxyManagedDeploymentFactory"> <property name="factoryName">WarManager</property> <property name="compType">MBean</property> <property name="compSubtype">WebApplicationManager</property> <property name="pattern">jboss.web:host=localhost,type=Manager,*</property> <property name="patternKey">path</property> </bean> <bean name="WebModuleManagedDeploymentFactory" class="org.jboss.profileservice.management.ProxyManagedDeploymentFactory"> <property name="factoryName">WebModule</property> <property name="compType">MBean</property> <property name="compSubtype">WebApplication</property> <property name="pattern">jboss.web:J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,*</property> <property name="patternKey">name</property> <property name="componetInfo"> <map keyClass="java.lang.String" valueClass="java.lang.String"> <!-- Process the servlets components --> <entry> <key>servlets</key> <value>MBean:Servlet</value> </entry> </map> </property> </bean>
The WarManagerManagedDeploymentFactory simply maps the mbeans matching pattern "jboss.web:host=localhost,type=Manager,*" name. This would match names like:
jboss.web:host=localhost,path=/admin-console,type=Manager
jboss.web:host=localhost,path=/jbossws,type=Manager
...
The patternKey property indicates which key in the matching object names provides the unique name of the deployment. This will create ManagedDeployments with a name equal to the path key value, with a single ManagedComponent of type/subtype MBean/WebApplicationManager.
The WebModuleManagedDeploymentFactory is similar, but now defines that the servlets attribute of the root component should be treated as a refeferences to other mbeans that should be have ManagedObjects created for their MBeans, and be included in the deployment as MangedComponents(type=MBean,subtype=Servlet). The component name will be the mbean object name that is referenced. -
6. Re: ManagedObjects for MBeans
starksm64 May 4, 2009 9:22 PM (in response to ips)Also note that ManagedMBeanDeploymentFactory deployments can be done anywhere as long as there is a dependency on the ManagementView which defines the incallback/uncallback context injection for this type:
<bean name="ManagementView" class="org.jboss.profileservice.management.ManagementViewImpl"> ... <!-- Accept any implementor of ManagedMBeanDeploymentFactory --> <incallback method="addManagedMBeanDeployments"/> <uncallback method="removeManagedMBeanDeployments"/> </bean>
-
7. Re: ManagedObjects for MBeans
jason.greene May 6, 2009 7:28 PM (in response to ips)I am currently looking into a way to provide overrides for statistic properties. The code mentions supporting annotation metadata on MBeanInfo Descriptors, however that would require patching tomcat to provide this info.
-
8. Re: ManagedObjects for MBeans
jason.greene May 7, 2009 11:26 PM (in response to ips)Another problem I am having is that the tomcat mbeans are not invokable via the KernelDispatcher, I guess because the MC was not the creation source of this mbean. So, I guess this needs a special mbean dispatcher:
Caused by: java.lang.IllegalArgumentException: No such context: jboss.web:host=localhost,path=/jmx-console,type=Manager at org.jboss.kernel.plugins.registry.basic.BasicKernelBus.execute(BasicKernelBus.java:51) at org.jboss.kernel.plugins.registry.basic.BasicKernelBus.get(BasicKernelBus.java:59) at org.jboss.profileservice.management.KernelBusRuntimeComponentDispatcher.get(KernelBusRuntimeComponentDispatcher.java:85)
-
9. Re: ManagedObjects for MBeans
jason.greene May 8, 2009 4:05 AM (in response to ips)"jason.greene@jboss.com" wrote:
So, I guess this needs a special mbean dispatcher
Ok I have a prototype for this in my workspace that i will commit tomorrow morning once I verify it doesn't introduce regressions. For awhile I thought about registering MBeans into the MC via a kernel registry plugin, but then I realized that clearing these entries would require detecting and acting on unregistering (not so ideal).
-
10. Re: ManagedObjects for MBeans
jason.greene May 8, 2009 4:10 AM (in response to ips)Another issue that needs to be solved is association of a WAR deployment managed object to a tomcat Manager JMX entry. One possible way to correlate is to use the docBase property on the JSR-77 WebModule object.
Even better would be a way to set the context root on the ManagedDeployment of the WAR.
Is there an easy way for the AbstractWarDeployer to add a new ManagedProperty to the ManagedDeployment? -
11. Re: ManagedObjects for MBeans
jason.greene May 9, 2009 4:59 AM (in response to ips)I have committed the new mbean dispatcher, and also introduced a temporary ViewUse default property, which I have set to statistic (until we come up with a better solution).
I also added a simple test case that verifies properties are working for all web component types (JMXMappingUnitTestCase). -
12. Re: ManagedObjects for MBeans
emuckenhuber May 11, 2009 2:11 AM (in response to ips)"jason.greene@jboss.com" wrote:
Even better would be a way to set the context root on the ManagedDeployment of the WAR.
Hmm, can't we just connect the creation of statistic MBeans to a ManagedObject/ManagedComponent type?
So instead of having a pattern to do a jmx lookup it would be based on e.g. a JBossWebMetaData component when doing the processing in ManagementView. This would have the benefit that it could get the required information from the MO/component and has it's reference to the ManagedDeployment. -
13. Re: ManagedObjects for MBeans
starksm64 May 11, 2009 4:36 PM (in response to ips)"emuckenhuber" wrote:
Hmm, can't we just connect the creation of statistic MBeans to a ManagedObject/ManagedComponent type?
So instead of having a pattern to do a jmx lookup it would be based on e.g. a JBossWebMetaData component when doing the processing in ManagementView. This would have the benefit that it could get the required information from the MO/component and has it's reference to the ManagedDeployment.
That is what we need to do in the future, but currently the mbeans are created deep inside of the jbosweb layer as a side effect of creating various components. -
14. Re: ManagedObjects for MBeans
starksm64 May 11, 2009 4:50 PM (in response to ips)"jason.greene@jboss.com" wrote:
I am currently looking into a way to provide overrides for statistic properties. The code mentions supporting annotation metadata on MBeanInfo Descriptors, however that would require patching tomcat to provide this info.
Right. The only other way to pass this information in would be via the MDR MetaData interface.