1 package org.simantics.databoard.channel;
\r
3 import org.simantics.databoard.binding.Binding;
\r
6 * This interface is intended to be used by service handler implementations.
\r
8 * @author Toni Kalajainen <toni.kalajainen@iki.fi>
\r
10 public interface ServiceRequest {
\r
13 * Context is an idetification of the requester. The actual implementation
\r
14 * depends on the implementation of the channel.
\r
16 * For example: TCP based implementation can publish user identification,
\r
17 * security policy, application instance certificate, session identifier,
\r
18 * socket address, etc..
\r
20 * Application local implementation may carry no data. <p>
\r
22 * @return client context
\r
24 Object getClientContext();
\r
27 * Get the command specification of the request.
\r
29 * The identifier of the spec is a well-known id of the requested service.
\r
31 * @return command specification
\r
33 CommandSpec getCommandSpec();
\r
36 * Get an access to the request object.
\r
39 * @return access to request
\r
41 Object getRequest(Binding binding);
\r
44 * Send a successful result. Result can be sent from any thread but only once.
\r
49 void sendResult( Binding binding, Object result );
\r
52 * Send an error result. Result can be sent from any thread but only once.
\r
57 void sendError( Binding binding, Object error );
\r