Hello Bruce,
first, a general example of the concept is decribed in this post (maybe you already saw it, as I also posted a link to the thread to Jira).
At the moment I have no example for SFSB at hand, but it is easily explained.
The configuration of the SimpleRemoteStatefulSessionProxyFactoryBean is exactly as its stateless counterpart. The difference is in its usage. While you can use a stateless proxy directly after injection and do not care about it, you need to initialize the stateful proxy first and have to deinitialize it afterwards. This corresponds to the parameterized invocation of create() before and the required invocation of remove() after using an SFSB.
If you, for example have a FooService (which is your business interface of the SFSB) your code might look like that:
Code:
public class Client {
// gets injected via Spring as SimpleRemoteStatefulSessionProxyFactoryBean
private FooService;
// ...
public void doSomething() {
// assuming that the SFSB's create method takes a String and an int/Integer parameter
SfsbHelper.initSfsbInstance(this.fooService, new Object[] {"Hello", new Integer(42)};
// invoke some method on the now initialized service
String result = this.fooService.bar(new Date());
// the service might be used further
// Not required to initialize/remove inside the same method but remove has to be called
SfsbHelper.removeSfsbInstance(this.fooService);
// fooService is still a valid proxy here, but to invoke methods on it,
// it has to be initialized again as shown above
}
}
I hope that makes it a bit clearer. If not, just follow up on this post.
And if you find this approach useful, feel free to vote for it on Jira
Regards,
Andreas