Hi, 
   I have a question on the XDoclet generation of Jboss-service.xml. I am trying to 
write a Standard Bean which will execute the start method when my EAR file id deployed 
on the Jboss Server. 

I am trying to Xdoclet for my class 

Code Snippet

  | /**
  |  * ServerSecurityDomain
  |  *
  |  * Server-side security domain of allByPrincipalName and their permissions
  |  *
  |  * @jmx.mbean
  |  * description = "Manages security domain for principals and permissions"
  |  * name="application.system:service=SecurityDomainMgr"
  |  * display-name="SecurityDomainMgr MBean"
  |  *
  |  *
  |  *
  |  * @jboss.service
  |  * servicefile="Security-jmx"
  |  *
  |  * @jboss.xmbean
  |  *
  |  *
  |  *
  |  */
  | public class ServerSecurityDomain extends AbstractSecurityDomain implements 
SecurityDomainMBean{
  | 
  |     // acls by Acl ID
  |     private Map aclsByAclID;
  | 
  |     // principals
  |     private Map groups;             // Just Groups
  |     private Map roles;              // Just Roles
  |     private Map users;              // Just Users
  |     private Map allByPrincipalID; // Union of all keyed on ID, not principal name
  |     private Map allByPrincipalName;  // Union of all keyed on principal name
  | 
  |     private Timestamp lastLoaded = null;
  |     private Log log = LogFactory.getLog(getClass());
  |   private boolean started;
  | 
  |   /**
  |      * Constructor
  |      *
  |      * @jmx:managed-constructor
  |      * description="Creates Security Service"
  |      *
  |      */
  |     public ServerSecurityDomain() {
  |             super();
  |     }
  | 
  |     /**
  |      * @jmx.managed-attribute access="read-only"
  |      * description = "Indicates the last time the domain was loaded."
  |      *
  |      * @return String
  |      */
  |     public String getLastLoadedTime() {
  |                 ...         
  |     }
  | 
  |     /**
  |      * @jmx.managed-operation impact = "INFO"
  |      * description = "Returns the groups in the domain"
  |      *
  |      * @return Map of java.security.acl.Group
  |      */
  |     public Map getGroups() {
  |     ...
  |     }
  | 
  |     /**
  |      * @jmx.managed-operation impact = "INFO"
  |      * description = "Returns the roles in the domain"
  |      *
  |      * @return Map of java.security.acl.Group
  |      */
  |     public Map getRoles() {
  |                 ...
  |     }
  | 
  |     /**
  |      * @jmx.managed-operation impact="ACTION_INFO"
  |      * description = "Returns the users in the role"
  |      *
  |      * @jmx.managed-parameter
  |      * name="roleName" description="The role to list members"
  |      * type="java.lang.String"
  |      *
  |      * @return Map of java.security.Principal
  |      */
  |     public Map getRoleMembers(String roleName) {
  | ....
  |             }
  |     /**
  |      * @jmx.managed-operation impact="ACTION_INFO"
  |      * description = "Returns the group members including roles and users"
  |      *
  |      * @jmx.managed-parameter
  |      * name="groupName" description="The group to list members"
  |      * type="java.lang.String"
  |      *
  |      * @return Map of java.security.Principal
  |      */
  |     public Map getGroupMembers(String groupName) {
  |     ...
  |                 }
  | 
  |     /**
  |      * @jmx.managed-operation impact = "INFO"
  |      * description = "Returns the of users in the domain"
  |      *
  |      * @return Map
  |      */
  |     public Map getUsers() {
  |             }
  | 
  |     /**
  |      * @jmx.managed-operation impact = "INFO"
  |      * description = "Returns the domain's acls as Map of java.security.acl.Acl"
  |      *
  |      * @return Map of java.security.acl.Acl
  |      */
  |     public Map getAcls() {
  |             
  |     }
  | 
  |     /**
  |      * @jmx.managed-operation impact = "INFO"
  |      * description = "Returns the domain's principals as Map of 
java.security.Principal"
  |      *
  |      * @return Map of java.security.Principal
  |      */
  | 
  |     public Map getPrincipals() {
  |                     }
  | 
  |     /**
  |      * @jmx.managed-operation
  |      * description="Loads the security domain users, groups, roles, and 
permissions"
  |      *
  |      *  (non-Javadoc)
  |      * @see cdot.ctms.layer.services.security.SecurityDomain#loadDomain()
  |      */
  |     public void loadDomain() throws SecurityServiceException {
  |     }
  | 
  |     /**
  |      * Loads the permissions for the domain
  |      * @param exchange  the SecurityDomainExchange to use
  |      */
  |     private void loadPermissions(SecurityDomainExchange exchange) throws 
FindException  {
  |     }
  | 
  |     /**
  |      * Loads the groups, roles, and users for the domain
  |      * @param exchange      SecurityDomainExchange to use
  |      */
  |     private void loadPrincipals(SecurityDomainExchange exchange) throws 
FindException {
  |     }
  | 
  |         public void start() throws Exception
  |          {
  |             started = true;
  |             log.debug("STARTING ....");
  |             this.loadDomain() ;
  |             log.debug("START SERVICE");
  | 
  |          }
  | 
  |          public void stop()
  |          {
  |             started = false;
  |             System.out.println("STOP SERVICE");
  | 
  |          }
  | 
  | 
  | }
  | 
After running Xdoclet on the above class the following file is generated

  | <?xml version="1.0" encoding="UTF-8"?>
  | 
  | <service>
  | 
  |   <mbean code="cdot.ctms.layer.services.security.ServerSecurityDomain"
  |          name="application.system:service=SecurityDomainMgr"
  |          xmbean-dd="cdot/ctms/layer/services/security/ServerSecurityDomain.xml">
  |     <!--Manages security domain for principals and permissions-->
  |   </mbean>
  | 
  |   <!--
  |   To use non XDoclet mbeans, create a jboss-service.ent file that
  |   contains the additional mbeans and place it in your
  |   project's merge dir.
  |   -->
  | 
  | </service>
  | 
The service element is generated yet the jboss 3.2.3 dtd states that
the outer-element is a server tag, is this ok ?

And what Xdoclet tags can be used to generate the server tag as the outer-element. 

Can somebody help me find the answers?

Thanks in Advance

Pawan Kharbanda




View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3841080#3841080

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3841080


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to