users@glassfish.java.net

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

From: Miroslav Nachev <miro_at_space-comm.com>
Date: Thu, 08 May 2008 09:59:46 +0300

Hi,

Thank you very much. The problem is that the application don't know
preliminary from what information will need. That's why it is not
possible preliminary to ask the user for all possible questions.
I have another idea. During the application initialization to pass as
parameter the ApplicationCallbackHandler to the server and that value to
be stored in the session.


Regards,
Miro.


glassfish_at_javadesktop.org wrote:
> 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
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>
>