That should be all. I'll take a look at what the mcbean deployer managed object factory is doing.
Its related to JBMICROCONT-362.
I'll have this working tomorrow with the 2.0.0.CR3 release of jboss-managed/jboss-metatype. I'll commit a SecurityManagedObjectsTestCase for the managed objects that should be validated as part of the profileservice unit tests. We'll have to do some work on the security beans as they are still too mbean-ish with xml parsing embedded.
Scott, we still support the legacy parsing methods. But we recommend stefan's work on BeanMetaDataFactory
An example of the latest config would be:
<authentication> <authorization> <audit> blocks
If we are going to keep the old security objects they really should have a similar management interface to the new beans where it make sense. Beans annotated at the bean class level with @ManagementObject are now showing up and the SecurityManagedObjectsTestCase shows obtaining the SecurityConfig whose component type is "MCBean","Security". There is an annotation on the JNDIBasedSecurityRegistration deployment:
<bean name="JNDIBasedSecurityRegistration" class="org.jboss.security.integration.JNDIBasedSecurityRegistration"> <!-- This has to be on one line, see JBMDR-49 --> <annotation>@org.jboss.managed.api.annotation.ManagementObject(name="JNDIBasedSecurityRegistration",componentTypefirstname.lastname@example.org.ManagementComponent(type="MCBean", subtype="Security"))</annotation> <property name="policyRegistration"><inject bean="JBossSecurityPolicyRegistration" /></property> <property name="securityManagement"><inject bean="JNDIBasedSecurityManagement" /></property> </bean>
which should also be showing up, but currently is not as the metadata level annotation is not propagated to the management object factory. I'm looking into what to do about that.
the SecurityManagedObjectsTestCase includes a test for a security bean annotated with @ManagedObject in the security-jboss-beans.xml deployment, and this test started failing since build #1080. You mentioned problems with this specific test before (metadata level annotation not being propagated to the management object factory). Do you think we have the same issue again or is it possible that something else is preventing this bean from showing up through in ManagementView.getComponent?
Its passing locally for me with the changes I have for a few different profile service issues. I'll check the changes in once a couple other regressions are fixed.
This should be working in trunk for you now.
Yes, it is working again in trunk. Thanks, Scott.
I am developing a test case for managed security domains, and as part of this test I deploy a sample testdomains-jboss-beans.xml that contains some JaasSecurityDomain bean declarations:
<?xml version="1.0" encoding="UTF-8"?> <!-- sample security domain beans used in the profile service tests --> <deployment xmlns="urn:jboss:bean-deployer:2.0"> <annotation>@org.jboss.managed.api.annotation.ManagementDeployment(description="JBoss SecurityDomain Beans")</annotation> <bean name="TestDomain1" class="org.jboss.security.plugins.JaasSecurityDomain"> <constructor> <parameter>TestDomain1</parameter> </constructor> <property name="keyStorePass">somepass1</property> <property name="salt">abcdefgh</property> <property name="iterationCount">13</property> </bean> <bean name="TestDomain2" class="org.jboss.security.plugins.JaasSecurityDomain"> <constructor> <parameter>TestDomain2</parameter> </constructor> <property name="keyStorePass">somepass2</property> <property name="salt">abcdefgh</property> <property name="iterationCount">17</property> </bean> </deployment>
However, I noticed that the JaasSecurityDomain beans are only processed by the Management view if the testdomains-jboss-beans.xml file is deployed before starting the profileservice partition. If I deploy this file after the server has been started, it is not processed by the management layer and thus the JaasSecurityDomain managed objects cannot be found when calling ManagementView.getComponent().
In the test method, I am doing something along the lines of
String resource = getResource("profileservice/security/testdomains-jboss-beans.xml"); super.deploy(resource); ManagementView managementView = getManagementView(); managementView.reloadProfile(); ComponentType type = new ComponentType("MCBean", "Security"); ManagedComponent mc = managementView.getComponent("TestDomain1", type); assertNotNull(mc); super.undeploy(resource);
The code above returns a null ManagedComponent, unless I deploy the testdomains-jboss-beans.xml before starting the AS. So, my question is what do I need to do to properly register the managed components at runtime? I'm guessing that only deploying the -jboss-beans.xml is not enough and that I need somehow to notify the management components to process the newly created beans.
The test would need to use the profileservice DeploymentManager api rather than the old MainDeployer as this bypasses registration of the deployment with the profileservice and it won't be visible in the profile. See the org.jboss.test.profileservice.test.DeployUnitTestCase.