0 Replies Latest reply on Aug 25, 2005 2:09 PM by platinumdragon

    Can AOP help me?

    platinumdragon Newbie

      Hi,

      I have an issue resolving public and internal interfaces, and I am hoping AOP can help me. I've been through the documentation, but I'm hoping somebody with more experience in AOP can see a solution.

      Basically, my question is this: Can I set the value of a method-level field with the value from the calling object? I am essentially looking for parameter functionality without the explicit parameter.

      More specifically, I'm looking to do something like..

      public interface PublicInterface
      {
       public void callMe(String name);
      }
      
      @Stateless
      public class Target implements PublicInterface
      {
       public void callMe(String name)
       {
       CallerContext ctx = null;
      
       // Use valid ctx here...
       }
      }
      
      @Stateful
      public class Caller implements PublicInterface
      {
       private CallerContext ctx;
       private Target target;
      
       public void callMe(String name)
       {
       target.callMe(name);
       }
      }
      


      I could do this:

      public interface PrivateInterface
      {
       public void callMe(String name, CallerContext);
      }
      


      and make Target implement PrivateInterface instead, but I really hate the idea of maintaining another interface almost exactly the same, and without any compiler-level enforcement for changes to one interface or the other. Also in real life there's about 45 methods in PublicInterface *ugh*.

      Any ideas would be appreciated. If I'm missing something basic, please be gentle :)

      Thanks,
      Mike