Note that there are some explanatory texts on larger screens.

plurals
  1. POSeam Classes and @Asynchronous processing related issue
    text
    copied!<p>I have an Interface defined as:</p> <pre><code>public interface DocExporter{ public void exportDoc(); } </code></pre> <p>with two implementing classes defined as:</p> <pre><code>@Service(value="docExporter") @Scope(value="BeanDefinition.SCOPE_PROTOTYPE) public class PdfDocExporter implements DocExporter{ public void exportDoc(){ // do Pdf Export stuff } } </code></pre> <p>AND</p> <pre><code>@Service(value="docExporter") @Scope(value="BeanDefinition.SCOPE_PROTOTYPE) public class ExcelDocExporter implements DocExporter{ public void exportDoc(){ // do Excel Export stuff } } </code></pre> <p>So can I say like :</p> <pre><code>@Name("docExportReporter") @Scope(ScopeType.EVENT) public class DocExportReporter { @In("#{docExporter}") private DocExporter pdfDocExporter; @In("#{docExporter}") private DocExporter excelDocExporter; @Asynchronous public void reportGen(){ **excelDocExporter.exportDoc()** // THIS THROWS Seam Exception @In attribute requires a not null value } } </code></pre> <p>I am new to Seam with Spring and would like to know if in both impl classes @Service would have values as "docExporter" (name of interface) or would it be like "pdfDocExporter" "excelDocExporter" ?</p> <p>And with the above, I get @In attribute requires a non null value exception when using pdfDocExporter or excelDocExporter objects within the reportGen async method. Can two implementations of an interface be declared in a third class and work fine with Seam @Asynchronous annotation ?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload