0 Replies Latest reply on Aug 18, 2012 12:40 AM by 956484

    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?