users@glassfish.java.net

Re: How to invoke Client Callback Handler from EJB3 Session Bean

From: <glassfish_at_javadesktop.org>
Date: Wed, 07 May 2008 18:22:58 PDT

OK, thanks for clearing that up.

The callback handler is not the right approach for what you need to do. It's usefulness is limited to the authentication step before an access-controlled EJB is accessed in the first place.

You may need to rearchitect this part of your app. Here is one possible way, not necessarily the best but it would work.

Instead of thinking of having the EJB method call back to the client, think of the EJB doing two separate pieces of work: the part before when it would do the callback and the part it does after collecting the additional information. Then separate the EJB method into two different methods.

The first method invocation would accomplish the first part of the EJB logic and would return a value that tells your app client code whether it needs to collect more information from the user (and perhaps what information to collect). Then your app client logic would examine that return value to tell what to do. If more info is needed from the user, your app would display an additional window or a dialog to collect that information. Once the user enters that info your client could invoke a different EJB method that represents the second part of the work, the work you planned to happen after the callback returned in your original design.

Does that make sense?

- Tim
[Message sent by forum member 'tjquinn' (tjquinn)]

http://forums.java.net/jive/thread.jspa?messageID=273237