Server Smalltalk Guide
-
- To better understand this section, examine the sample
SstPingPong.
There are many different execution semantics possible with method
invocation. Although the basics of the request/reply operations remain
the same, most details can be modified through the
SstInvocationConfiguration associated with an invocation
handler. Invocation configurations allow the specification of the
following options:
- context
- The name of the application context in which the handler will
execute. If this option is non-nil then the space option
must be nil or an error will occur.
- dispatcher
- A dispatcher configuration or applicable dispatcher class. If the
configured dispatcher is a class, a new instance of that class is used as the
dispatcher for the invocation handler. If it is a configuration, the
configuration is instantiated to build a dispatcher with the specified
behavior.
- forwardExceptions
- A boolean stating whether or not exceptions raised in application code are
trapped and handled by the associated invocation handler or passed on for
normal system handling. The invocation handler will either invoke the
error handler associated with the current logical process (if logical process
dispatching is being used; see Logical process invocation) or pass the exception back to the relevant request
sender. Note that if exceptions are trapped, useful debugging
exceptions such as ExHalt will not appear on the machine where they
occur. This behavior may effectively hide them from the user but
maintains normal Smalltalk exception semantics.
- handlerClass
- The class of invocation handler to be used when instantiating the
configuration.
- marshaler
- The marshaler, marshaler class or marshaler configuration to be used when
an invocation handler is instantiated. If the configured marshaler is a
class, a new instance of this class is used. If it is a configuration,
the configuration is instantiated and the result used as the marshaler.
- replyClass
- The class of object to use when sending a reply (for example,
SstReply).
- replyFutureClass
- The class of reply future to use internally. The kind of future
used affects whether or not processes blocked waiting for message results can
be interrupted. Example values are
SstInterruptableReplyFuture and
SstExplicitFuture.
If the logical process model is being used, the replyFutureClass
must be interruptable.
- requestClass
- The class of object to use when sending a request (for example,
SstRequest).
- restartMode
- A description of what to do with the invocation handler and its associated
components on image startup. See Invocation handler restart modes.
- space
- An object space or the class of object space to use. If the option
is a class, a new instance of that class is used. If the value is
nil then the local space is found in the specified context (see the
context option above) is used. If this option is
non-nil then the context option must be nil
or an error will occur.
- trapExceptions
- A boolean stating whether or not exceptions raised in SST code while
processing are trapped and ignored by the invocation handler or passed on for
normal system handling. This option prevents the invocation handler
from dying. A warning is displayed on the transcript if an exception is
trapped. Note that if exceptions are trapped, useful debugging
exceptions (such as, ExHalt) will also be trapped. Also note
that if exceptions are trapped, but user exceptions are not forwarded (see
forwardExceptions above), then exceptions occurring in user code
executed by the server process will also be ignored.
Invocation configurations support getter and setter accessors for each of
these options in addition to the following API for instantiating invocation
handlers:
- instantiateOn: endpoint
- Creates and answers a new instance of the receiver's
handlerClass on the local @endpoint. The new
handler is set up to behave according to the receiver's
description.
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]