Class JavaThreadPool

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void attach()
      Attaches this thread to the thread pool.
      java.lang.Object attach​(ThreadId threadId)
      As above, but hands in an already existing instance of the threadid of the current thread.
      void destroy()
      Destroys the thread pool and tries to join all created threads immediately.
      void detach()
      Detaches this thread from the thread pool.
      void detach​(java.lang.Object handle, ThreadId id)
      As above, but hands in an already existing instance of the threadid of the current thread and a handle returned by attach.
      void dispose​(java.lang.Throwable throwable)
      Disposes this thread pool, thus releasing all threads by throwing a DisposedException with the given Throwable cause.
      java.lang.Object enter()
      Lets this thread enter the thread pool.
      java.lang.Object enter​(java.lang.Object handle, ThreadId threadId)
      As above but hands in an already existing instance of the threadid of the current thread and a handle returned by attach.
      ThreadId getThreadId()
      Retrieves the global threadId for the current thread.
      void putJob​(Job job)
      Queues a job into the jobQueue of the thread belonging to the jobs threadId.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getThreadId

        public ThreadId getThreadId()
        Description copied from interface: IThreadPool
        Retrieves the global threadId for the current thread.
        Specified by:
        getThreadId in interface IThreadPool
        Returns:
        the thread id.
      • attach

        public java.lang.Object attach​(ThreadId threadId)
        Description copied from interface: IThreadPool
        As above, but hands in an already existing instance of the threadid of the current thread.

        The function exists for performance.

        Specified by:
        attach in interface IThreadPool
        Returns:
        Returns a handle which can be used in enter and detach calls.
        See Also:
        IThreadPool.attach()
      • detach

        public void detach​(java.lang.Object handle,
                           ThreadId id)
        Description copied from interface: IThreadPool
        As above, but hands in an already existing instance of the threadid of the current thread and a handle returned by attach.

        The function exists for performance.

        Specified by:
        detach in interface IThreadPool
        See Also:
        IThreadPool.attach(), IThreadPool.detach()
      • enter

        public java.lang.Object enter​(java.lang.Object handle,
                                      ThreadId threadId)
                               throws java.lang.Throwable
        Description copied from interface: IThreadPool
        As above but hands in an already existing instance of the threadid of the current thread and a handle returned by attach.

        This thread then executes all jobs put via putJob until a reply job arrives.

        Specified by:
        enter in interface IThreadPool
        Throws:
        java.lang.Throwable
        See Also:
        IThreadPool.putJob(com.sun.star.lib.uno.environments.remote.Job)
      • putJob

        public void putJob​(Job job)
        Description copied from interface: IThreadPool
        Queues a job into the jobQueue of the thread belonging to the jobs threadId.
        Specified by:
        putJob in interface IThreadPool
        Parameters:
        job - the job
      • dispose

        public void dispose​(java.lang.Throwable throwable)
        Description copied from interface: IThreadPool
        Disposes this thread pool, thus releasing all threads by throwing a DisposedException with the given Throwable cause.
        Specified by:
        dispose in interface IThreadPool
        Parameters:
        throwable - the cause
      • destroy

        public void destroy()
        Description copied from interface: IThreadPool
        Destroys the thread pool and tries to join all created threads immediately.
        Specified by:
        destroy in interface IThreadPool