0 Replies Latest reply on Oct 28, 2008 1:33 PM by Sean Burns

    Using Seam messages from MDB

    Sean Burns Newbie

      Hello,


      How do you setup a MDB in order to use the messages resource.



      @MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName = "cronTrigger", propertyValue = "0 * * * * ?") })
      @ResourceAdapter("quartz-ra.rar")
      @Name("someJob")
      public class SomeJob implements Job {
           public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
                String text = Messages.instance().get("key");
                System.out.println(text);
           }
      }



      This prints out key instead of value  (because if seam can't find the key/value pair for some reason it just gives back the key).


      The reason I need this is not for this simplistic example (becuase I can just manually get the correct info



      SeamResourceBundle.getBundle("messages")




      but I inject other seam components (business logic used by the website) that use the normal seam messaging for generating emails etc..


      Thanks,
      Sean.