3 Replies Latest reply on Apr 7, 2006 1:42 PM by delkant

    do we have a security-proxy on ejb3?

    delkant

      i mean.. if i have a method in a SessionBean like.

      @SecurityProxy( ComplexValidator ) //like a interceptor
      @Stateless
      public class ComplexSessionBean {
       public string createHello( String yourName ){
       return "Hello "+yourName;
       }
      }


      i would like to do the validation in another class..
      public class ComplexValidator{
       public string createHello( String yourName ) throws IllegalArgumentException{
       if(yourName == null){
       throw new IllegalArgumentException("DONT LIE TO ME, i Know you hava a name!! ");
       }
       }
      }
      


      like the security-proxy with j2ee

        • 1. Re: do we have a security-proxy on ejb3?
          bill.burke

          security proxy bad

          interceptors good.

          use ejb3 interceptors.

          • 2. Re: do we have a security-proxy on ejb3?
            delkant

            interceptors???
            i made some test with the interceptors, and looks nice when the intention is to log some process, but if i have to do an "if" per method to see if is an specific method what is called, and after that see if the parameter is empty or not (null for example) that doesn't have much sense.
            is better to have a class with every method mapped and just make a if per parameter to validate the content of this one.

            i dont know if i'm not do it the best because with my knowledge i have to write a lot of code on my interceptors to validate a simple null value. i just want to have a reference to the parameter and make the cuestion.

            before, with the last specification of ejb i just have to put the sign of the method and after that make my validations, as simple as that.

            is it a special type of interceptors to this purpose?
            i just want to have a class level interceptor in that way i dont have to annotate all my methods.

            • 3. Re: do we have a security-proxy on ejb3?
              delkant

              mr. bill.burke@jboss.com or somebody else,

              can you please help me?
              what is the correct way to deal with this?
              if the interceptors are the answer, how i can do this easily without have to make and "if-else" per method declared to see if this is the method what i want to validate?