SilverStream
Application Server 3.5

com.sssw.srv.busobj
Interface AgiInvokedListener


public interface AgiInvokedListener

This interface is implemented by all business objects which listen for invoked events. It provides a way to remotely call a business object, passing a parameter, perform some function, and return a result. When an invoked triggered business object is created, SilverStream automatically adds the implements AgiInvokedListener clause to the object's class definition.

This interface provides a very simple form of a remote procedure call, and is limited to one call that takes an object as a parameter, and returns an Object as a result. To use multiple methods with different parameters, you must use CORBA, RMI, or DCOM. For more information, see the SilverStream Programmer's Guide.

Invoked Listeners receive requests as an HTTP POST request. A business object can be invoked by coding an HTML form with the ACTION attribute pointing to the URL of the business object and the METHOD attribute being set to POST, thereby generating custom POST requests. See AgoInvokedEvent for methods to get the parameters of such a request (i.e., the values of the other fields in an HTML form). You cannot invoke a business object from a GET or any other kind of HTTP request. For that purpose use an HTTP listener (aka Servlet).

See Also:
AgoInvokedEvent

Method Summary
 void invoked(AgoInvokedEvent e)
          Fires when this listener is invoked by calling invokeAgent on either agGeneral or AgiDatabase or by the object's resource receiving an HTTP POST request.
 

Method Detail

invoked

public void invoked(AgoInvokedEvent e)
             throws Exception
Fires when this listener is invoked by calling invokeAgent on either agGeneral or AgiDatabase or by the object's resource receiving an HTTP POST request.
Parameters:
e - an instance of an AgoInvokedEvent.
Usage:

The goal in coding this event is to produce a result to be sent back to the caller. If the caller is a java client of some form, a serializable java object should be returned. Use evt.setResult() to do this.

If the caller is an HTML form, the result returned to an HTML client making the call will probably be an HTML page or perhaps an image. In addition to evt.setResult(), the evt.setResultMimeType() or the two-parameter version of evt.setResult() call can be used to set the MIME type (content type) of the result so a browser knows how to display it.

See Also:
AgoInvokedEvent

SilverStream
Application Server 3.5