Guest User

Untitled

a guest
Jan 22nd, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. /**
  2. * PLM: This is version 3 of the Resources class (see notes above).
  3. *
  4. * PLM: V3 shows how we can override a default at any point, without needing to
  5. * define the intermediate producers.
  6. * PLM Here we change the convention that sessions are auto-acknowledge for all
  7. * types of JMS resource injection annotated with @Foo
  8. */
  9. public class Resources {
  10.  
  11. @Produces @Foo
  12. @Resource(lookup = "jms/connFactory")
  13. ConnectionFactory connFact;
  14.  
  15. @Produces @Foo
  16. public Session createSession(@Foo Connection c) {
  17. return c.createSession(false, Session.DUPS_OK_ACKNOWLEDGE);
  18. }
  19.  
  20. }
Add Comment
Please, Sign In to add comment