[jboss-dev-forums] [Design of POJO Server] - Re: ProfileService Guidance
sguilhen@redhat.com
do-not-reply at jboss.com
Wed Nov 26 11:03:43 EST 2008
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.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4192543#4192543
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4192543
More information about the jboss-dev-forums
mailing list