Class LibreOfficeInstancePool

  • All Implemented Interfaces:
    SelfRegistering, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.jmx.export.naming.SelfNaming

    @ManagedResource(description="LibreOffice instance pool")
    public class LibreOfficeInstancePool
    extends ManagedObjectPool<File,​com.levigo.jadice.server.libreoffice.server.internal.ManagedLibreOfficeInstance>
    • Constructor Detail

      • LibreOfficeInstancePool

        public LibreOfficeInstancePool()
        Initialize an LibreOfficeInstancePool with default parameters
      • LibreOfficeInstancePool

        public LibreOfficeInstancePool​(int maxActive,
                                       long maxWait,
                                       int maxIdle,
                                       int maxUsageCount)
    • Method Detail

      • doBorrowObject

        protected com.levigo.jadice.server.libreoffice.server.internal.ManagedLibreOfficeInstance doBorrowObject​(File tempFolder)
                                                                                                          throws Exception
        Borrows a LibreOffice instance that works within the given temporary folder
        Specified by:
        doBorrowObject in class ManagedObjectPool<File,​com.levigo.jadice.server.libreoffice.server.internal.ManagedLibreOfficeInstance>
        Parameters:
        tempFolder - the temporary folder which LO shall use
        Throws:
        Exception
        See Also:
        ManagedObjectPool.borrowObject(Object)
      • doReturnObject

        protected void doReturnObject​(com.levigo.jadice.server.libreoffice.server.internal.ManagedLibreOfficeInstance object)
                               throws Exception
        Specified by:
        doReturnObject in class ManagedObjectPool<File,​com.levigo.jadice.server.libreoffice.server.internal.ManagedLibreOfficeInstance>
        Throws:
        Exception
      • doInvalidateObject

        protected void doInvalidateObject​(com.levigo.jadice.server.libreoffice.server.internal.ManagedLibreOfficeInstance obj)
                                   throws Exception
        Specified by:
        doInvalidateObject in class ManagedObjectPool<File,​com.levigo.jadice.server.libreoffice.server.internal.ManagedLibreOfficeInstance>
        Throws:
        Exception
      • getName

        protected String getName()
        Specified by:
        getName in class ManagedObjectPool<File,​com.levigo.jadice.server.libreoffice.server.internal.ManagedLibreOfficeInstance>
      • getLogger

        protected org.jadice.util.log.Logger getLogger()
        Specified by:
        getLogger in class ManagedObjectPool<File,​com.levigo.jadice.server.libreoffice.server.internal.ManagedLibreOfficeInstance>
      • getPool

        protected org.apache.commons.pool.impl.GenericKeyedObjectPool getPool()
        Specified by:
        getPool in class ManagedObjectPool<File,​com.levigo.jadice.server.libreoffice.server.internal.ManagedLibreOfficeInstance>
      • isUseXvfb

        public boolean isUseXvfb()
      • setUseXvfb

        public void setUseXvfb​(boolean useXvfb)
      • isEnableDebug

        public boolean isEnableDebug()
      • setEnableDebug

        public void setEnableDebug​(boolean enableDebug)
      • getMaxUsageCount

        @ManagedAttribute(description="Maximum number of usages of a LibreOffice instance")
        public int getMaxUsageCount()
      • setMaxUsageCount

        @ManagedAttribute(description="Maximum number of usages of a LibreOffice instance")
        public void setMaxUsageCount​(int maxUsageCount)