5 Replies Latest reply on Oct 11, 2006 4:45 PM by Wolfgang Knauf

    @SecurityDomain

    Keyur Shah Newbie

      To associate my EJB with a security domain, I have to use a JBoss specific @org.jboss.ejb3.security.SecurityDomain annotation. I'd like to write my bean in a portable manner - is there a standard annotation that I can use instead of this one? If not, what would the portable way be?

      Thanks.

        • 1. Re: @SecurityDomain
          Bill Burke Master

          There are two ways:

          One, you just include the JBoss JARs with your distribution. Other EJB containers will just ignore the @SecurityDomain annotation.

          The other is with an jboss specific XML deployment descriptor. We have not implemented that yet for our EJB3 impl.

          • 2. Re: @SecurityDomain
            Keyur Shah Newbie

            Thanks, Bill... In that case I'll wait for the EJB3 DDs...

            Another question pertaining to EJB3 deployment descriptors - I haven't yet been successful in injecting custom variable values into my EJBs using the @Inject annotation... Will this also have to wait for the new DDs? Or is there another way to specify values for injection?

            For instance in this bean below, how do I inject testName?

            @Stateless public class MyBean {
            
             @Inject private String testName;
             ...
             ...
            }
            


            • 3. Re: @SecurityDomain
              Bill Burke Master

              Unti the XML DDs come out, try this:

              abstract public MyBaseSession {
               private int field;
              
               protected MyBaseSession(int f) { this.field = f; }
              }
              
              @Stateless
              public MySession extends MyBaseSession implements MyRemote {
              
              
               public MySession() {
               super(5555);
               }
              }
              





              • 4. Re: @SecurityDomain
                Markus Wahl Newbie

                Hi

                Is there now a solution to avoid using the JBoss specific SecurityDomain annotation or supplying the JBoss jar files?

                "bill.burke@jboss.com" wrote:
                The other is with an jboss specific XML deployment descriptor. We have not implemented that yet for our EJB3 impl.


                • 5. Re: @SecurityDomain
                  Wolfgang Knauf Master

                  For RC 9 it can be declared in "jboss.xml" in the ejb project:

                  <?xml version="1.0" encoding="UTF-8"?>
                  <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 4.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_4_0.dtd">


                  <security-domain>MySecurityDomain</security-domain>



                  Important is that the security domain name must not be prefixed with "java:/jaas/".