0 Replies Latest reply: Aug 17, 2012 7:40 PM by 956484 RSS

    Singleton implementation for Subject

      Can the singleton pattern be applied for
      javax.security.auth.Subject ?
      I am using the below code

      Subject authSubject = null;
      authSubject = Security.login(UserName, password);

      My question is if it is okay to create the Subject as a singleton and use the same object in subsequent calls? The call Security.login will try to do a login operation. I want to not perform this operation over and over again. Is it advisable to create this object as a Singleton?