0 Replies Latest reply on Apr 12, 2010 5:20 PM by Lee Gerakos

    configure dlq in ejb3-interceptors-aop.xml file

    Lee Gerakos Newbie

      Hi,

       

      I've setup the SecurityStore used with JBoss Messaging to use an ldap based authentication security domain.

       

      The "messaging" security domain allows for an "unauthenticatedIdentity" which is not possible with the login module I am using.  Instead I would like to specify the DLQUser and DLQPassword on a global basis.

       

      I see that for ejb2, I can specify these parameters in the standardjboss.xml file that is in the conf directory.

       

      According to http://www.jboss.org/ejb3/docs/tutorial/configuration/configuration.html the standardjboss.xml file is not used for ejb3.  So I am trying to understand how I can configure the ejb3-interceptors-aop.xml file to have the DLQUser and DLQPassword listed as a default when not overridden by the MDB itself.

       

      I see how the existence of annotations can be used in "expr" attributes.  But I am not sure how to determine if a specific property is set.

       

      So for example, if the MDB has the DLQUser/DLQPassword values set:

       

      @MessageDriven( activationConfig = {
              @ActivationConfigProperty( propertyName = "destination", propertyValue = "/queue/MyDestination" ),
              @ActivationConfigProperty( propertyName = "messageSelector", propertyValue = "service_msg_type = 'instance_state'" ),
              @ActivationConfigProperty( propertyName = "providerAdapterJNDI", propertyValue="java:/RemoteJMSProvider"),
              @ActivationConfigProperty( propertyName = "user", propertyValue = "foo" ),
              @ActivationConfigProperty( propertyName = "DLQUser", propertyValue = "foo" ),
              @ActivationConfigProperty( propertyName = "DLQPassword", propertyValue = "bar" ),

              @ActivationConfigProperty( propertyName = "password", propertyValue = "bar" ) } )

       

      I don't want to overwrite them.  But if they weren't specified, like below:

       

      @MessageDriven( activationConfig = {
              @ActivationConfigProperty( propertyName = "destination", propertyValue = "/queue/MyDestination" ),
              @ActivationConfigProperty( propertyName = "messageSelector", propertyValue = "service_msg_type = 'instance_state'" ),
              @ActivationConfigProperty( propertyName = "providerAdapterJNDI", propertyValue="java:/RemoteJMSProvider"),
              @ActivationConfigProperty( propertyName = "user", propertyValue = "foo" ),
              @ActivationConfigProperty( propertyName = "password", propertyValue = "bar" ) } )

       

      How do I inject them in the ejb3-interceptors-aop.xml file below:

       

      <domain name="Message Driven Bean" extends="Intercepted Bean" inheritBindings="true">
            <bind pointcut="execution(public * *->*(..))">
               <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
               <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
            </bind>
            <!-- TODO: Authorization? -->
            <bind pointcut="execution(public * *->*(..))">
               <interceptor-ref name="org.jboss.ejb3.tx.CMTTxInterceptorFactory"/>
               <interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
               <interceptor-ref name="org.jboss.ejb3.tx.BMTTxInterceptorFactory"/>
               <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
               <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
               <!-- interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/ -->
               <stack-ref name="EJBInterceptors"/>
            </bind>
            <annotation expr="class(*) AND !class(@org.jboss.ejb3.annotation.Pool)">
               @org.jboss.ejb3.annotation.Pool (value="StrictMaxPool", maxSize=15, timeout=10000)
            </annotation>
         </domain>

       

      I also read through http://docs.jboss.org/aop/1.3/aspect-framework/reference/en/html_single/index.html but didn't see anything specific to annotations with properties being specified.  I see how to check for the existence of an annotation, just not one specified with values.

       

      Any information is greatly appreciated.

       

      Thanks!