I would like to write a method in a remote interface to a session bean that returns a remote interface to a different session bean. Both beans are stateful.
Consider ...
public interface SearchSession extends EJBObject {
public ResultSet search(String keyword);
}
public interface ResultSet extend EJBObject {
public RowDO getNextRow();
}
Questions:
1. Is this possible?
2. What would the code in the SearchSessionBean.seach() method look like?
M
I investigated this and the answer is yes and the code is quite straightforward.
The first class gets a handle to the Remote Home interface of the second, creates a remote interface and returns it.
Seems to work so far.