Interface EntryPoint

All Superinterfaces:
java.lang.AutoCloseable

public interface EntryPoint
extends java.lang.AutoCloseable

By using EntryPoint, iPLAss can be initialized/destroyed directly from the code even if outside the servlet container, and logic can be executed by specifying a tenant/user. There can be only one EntryPoint per class loader unit where the class is loaded.

EntryPoint usage example
   //initialize EntryPoint on application startup
   EntryPoint entryPoint = EntryPoint.builder()
       .config("/backend-service-config.xml")
       .serverRole("backendService")
       .build();
   
   :
   :
   
   //do process some logic while application is running
   entryPoint.withTenant(tenantId).withLang("en").run(() -> {
   
     :
     :
     
     Entity e = entityManager.load(oid, "SomeEntity");
     
     :
     :
     
   });
   
   :
   :
   
   //destroy EntryPoint when application is shutdown
   entryPoint.destroy();
 
 
  • Method Summary

    Modifier and Type Method Description
    static EntryPointBuilder builder()
    Get EntryPoint Builder.
    default void close()
    Implementation of the close() method of the AutoCloseable interface.
    void destroy()
    Destroy EntryPoint and release resources managed by iPLAss.
    static EntryPoint getInstance()
    Get an instance of EntryPoint.
    static EntryPoint init()
    Initialize EntryPoint and get an instance of it.
    static boolean isInited()
    Gets whether EntryPoint has already been initialized.
    Runner runner()
    Get Runner to execute logic in iPLAss.
    default Runner withAuth​(Credential credential)
    Get an instance of Runner logged in with Credential.
    default Runner withLang​(java.lang.String lang)
    Get an instance of Runner with language specified.
    default Runner withTenant​(java.lang.Integer tenantId)
    Get an instance of Runner with tenant specified.
    default Runner withTenant​(java.lang.String tenantUrl)
    Get an instance of Runner with tenant specified.
  • Method Details

    • getInstance

      static EntryPoint getInstance()
      Get an instance of EntryPoint. If EntryPoint has not been initialized, it will be initialized.
      Returns:
    • init

      static EntryPoint init()
      Initialize EntryPoint and get an instance of it. If there is an EntryPoint that has already been initialized, an AlreadyInitializedException is thrown.
      Returns:
      EntryPoint instance
      Throws:
      AlreadyInitializedException - When EntryPoint has already been initialized
    • builder

      static EntryPointBuilder builder()
      Get EntryPoint Builder. Parameters for building EntryPoint can be specified via Builder.
      Returns:
    • isInited

      static boolean isInited()
      Gets whether EntryPoint has already been initialized.
      Returns:
    • runner

      Runner runner()
      Get Runner to execute logic in iPLAss.
      Returns:
    • withLang

      default Runner withLang​(java.lang.String lang)
      Get an instance of Runner with language specified.
      Parameters:
      lang -
      Returns:
    • withAuth

      default Runner withAuth​(Credential credential)
      Get an instance of Runner logged in with Credential.
      Parameters:
      credential -
      Returns:
    • withTenant

      default Runner withTenant​(java.lang.String tenantUrl)
      Get an instance of Runner with tenant specified.
      Parameters:
      tenantUrl - Tenant URL (path of tenant)
      Returns:
    • withTenant

      default Runner withTenant​(java.lang.Integer tenantId)
      Get an instance of Runner with tenant specified.
      Parameters:
      tenantId - Tenant ID
      Returns:
    • destroy

      void destroy()
      Destroy EntryPoint and release resources managed by iPLAss.
    • close

      default void close()
      Implementation of the close() method of the AutoCloseable interface. Call destroy().
      Specified by:
      close in interface java.lang.AutoCloseable