4 Replies Latest reply on Jul 12, 2008 7:58 PM by Diego Coronel

    About ConversationIdGenerator

    Diego Coronel Apprentice

      Hi,


      I just wanna know if its secure create my own ConversationIdGenerator, my system will have almost 40 simultaneous users, and i think a unique generator id is really weird because its beeing so high....


      can anyone comment about my generator ? if is there any problem, pls.



      @BypassInterceptors
      @Name("org.jboss.seam.core.ConversationIdGenerator")
      @Scope(ScopeType.SESSION)
      @Install(precedence=Install.FRAMEWORK)
      public class IDoctorConversationIdGenerator extends ConversationIdGenerator {
           
          private AtomicInteger uniqueIDoctorId = new AtomicInteger(0);
      
          @Override
          public String getNextId() {
              //TODO: this is not cluster safe ?
              return Integer.toString(uniqueIDoctorId.incrementAndGet());
          }   
      
          public static ConversationIdGenerator instance() {
               IDoctorConversationIdGenerator instance = 
                  (IDoctorConversationIdGenerator) Component.getInstance("org.jboss.seam.core.ConversationIdGenerator");
              return (instance!=null) ? instance : new IDoctorConversationIdGenerator();
          }
           
      
      }
      



      I did a session id generator, and im using



      @BypassInterceptors



      because the seam default generator does not any injection, or seam generator does not have bypass because any other problem ?


      Sry about english, waiting all possible suggestions, ty !!! ;)