Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

petstore servicelocator  RSS feed

Marie Pierre Courbevoie
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In petstore 1.3.2 ServiceLocator class is used to lookup ejb references, jms resources, data sources, url, strings.... but mail session is retrieved in the code of the MailHelper class:
try {
InitialContext ic = new InitialContext();
Session session = (Session) ic.lookup(JNDINames.MAIL_SESSION);
JNDINames is only a class container with a public static final String variable (Mail_SESSION= "java:comp/env/mail/MailSession"

Any coherent explaination ?

Marie Pierre
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!