IAuthorizationSessionLocalHome  authorizationsessionhome = (IAuthorizationSessionLocalHome) locator.getLocalHome(IAuthorizationSessionLocalHome.COMP_NAME); IAuthorizationSessionLocal authorizationsession = authorizationsessionhome.create();  IUserAdminSessionLocalHome adminsessionhome = (IUserAdminSessionLocalHome) locator.getLocalHome(IUserAdminSessionLocalHome.COMP_NAME); IUserAdminSessionLocal useradminsession = adminsessionhome.create();  ICertificateStoreSessionLocalHome certificatestorehome = (ICertificateStoreSessionLocalHome) locator.getLocalHome(ICertificateStoreSessionLocalHome.COMP_NAME); ICertificateStoreSessionLocal certificatesession = certificatestorehome.create();   initialized=true;  this.informationmemory = ejbcawebbean.getInformationMemory();  this.hardtokenprofiledatahandler = new HardTokenProfileDataHandler(admin, hardtokensession, certificatesession, authorizationsession , useradminsession, informationmemory);  }
if(!initialized){ admin           = new Admin(((X509Certificate[]) request.getAttribute( "javax.servlet.request.X509Certificate" ))[0]);  final ServiceLocator locator = ServiceLocator.getInstance(); IHardTokenSessionLocalHome hardtokensessionhome = (IHardTokenSessionLocalHome) locator.getLocalHome(IHardTokenSessionLocalHome.COMP_NAME); hardtokensession = hardtokensessionhome.create();  IHardTokenBatchJobSessionLocalHome  hardtokenbatchsessionhome = (IHardTokenBatchJobSessionLocalHome) locator.getLocalHome(IHardTokenBatchJobSessionLocalHome.COMP_NAME); hardtokenbatchsession = hardtokenbatchsessionhome.create();  IAuthorizationSessionLocalHome  authorizationsessionhome = (IAuthorizationSessionLocalHome) locator.getLocalHome(IAuthorizationSessionLocalHome.COMP_NAME); IAuthorizationSessionLocal authorizationsession = authorizationsessionhome.create();  IUserAdminSessionLocalHome adminsessionhome = (IUserAdminSessionLocalHome) locator.getLocalHome(IUserAdminSessionLocalHome.COMP_NAME); IUserAdminSessionLocal useradminsession = adminsessionhome.create();  ICertificateStoreSessionLocalHome certificatestorehome = (ICertificateStoreSessionLocalHome) locator.getLocalHome(ICertificateStoreSessionLocalHome.COMP_NAME); ICertificateStoreSessionLocal certificatesession = certificatestorehome.create();   initialized=true;  this.informationmemory = ejbcawebbean.getInformationMemory();  this.hardtokenprofiledatahandler = new HardTokenProfileDataHandler(admin, hardtokensession, certificatesession, authorizationsession , useradminsession, informationmemory);  }
    public void initialize(HttpServletRequest request, EjbcaWebBean ejbcawebbean) throws  Exception{      if(!initialized){        admininformation = new AdminInformation(((X509Certificate[]) request.getAttribute( "javax.servlet.request.X509Certificate" ))[0]);        admin           = new Admin(((X509Certificate[]) request.getAttribute( "javax.servlet.request.X509Certificate" ))[0]);        final ServiceLocator locator = ServiceLocator.getInstance();        IHardTokenSessionLocalHome hardtokensessionhome = (IHardTokenSessionLocalHome) locator.getLocalHome(IHardTokenSessionLocalHome.COMP_NAME);        hardtokensession = hardtokensessionhome.create();        IHardTokenBatchJobSessionLocalHome  hardtokenbatchsessionhome = (IHardTokenBatchJobSessionLocalHome) locator.getLocalHome(IHardTokenBatchJobSessionLocalHome.COMP_NAME);        hardtokenbatchsession = hardtokenbatchsessionhome.create();        		IAuthorizationSessionLocalHome  authorizationsessionhome = (IAuthorizationSessionLocalHome) locator.getLocalHome(IAuthorizationSessionLocalHome.COMP_NAME);		IAuthorizationSessionLocal authorizationsession = authorizationsessionhome.create();		IUserAdminSessionLocalHome adminsessionhome = (IUserAdminSessionLocalHome) locator.getLocalHome(IUserAdminSessionLocalHome.COMP_NAME);		IUserAdminSessionLocal useradminsession = adminsessionhome.create();		ICertificateStoreSessionLocalHome certificatestorehome = (ICertificateStoreSessionLocalHome) locator.getLocalHome(ICertificateStoreSessionLocalHome.COMP_NAME);		ICertificateStoreSessionLocal certificatesession = certificatestorehome.create();		        initialized=true;                this.informationmemory = ejbcawebbean.getInformationMemory();                              this.hardtokenprofiledatahandler = new HardTokenProfileDataHandler(admin, hardtokensession, certificatesession, authorizationsession , useradminsession, informationmemory);		      }    }