5 Replies Latest reply on Jan 28, 2013 6:42 PM by duc trung tran

    Multi-threading -- using the Java Callable interface with Seam

    James Falek Newbie
      We have a Seam component which contains and another Seam component (using @In (required=true) ).  We decided to break apart the activities in one of the methods in the first component into four concurrent threads to improve performance using the Callable/Future/ExecutorService framework of Java 1.5.

      We noticed that the "inner" Seam component was not always being created by Seam and therefore, we were getting null pointer errors (the code assumes that Seam creates all @In components).  We've been told that each thread causes a new Seam context to be created and therefore we would not be able to simply create a new Callables and calling get() on their associated Future objects. 

      Has anyone come across this problem of making a Seam component multi-threaded and are there any recommendations or examples on how to implement Callable(s) on a Seam component?

      Thank you,
        James