public interface Service
This service would typically be implemented in situations where the benefit is greater to send all, or a portion, of the code to the receiver; instead of passing a lot of data back or forth. This pattern is also ideal for the provision of graphical user interfaces to requesting JVMs.
All services are defined as plain-old Java interfaces. Typically these interfaces contain:
A JVM may furnish as many service objects as it wishes. Normally, related service interfaces are grouped into packages. Typically the javadoc package.html file is used to provide a detailed explanation of the service collection architecture. The package may also include any custom classes shared between the service interfaces, specifically; objects, interfaces, and exceptions. Once a service interface is defined and distributed, it should be considered immutable. Service feature enhancements should be handled through subclasses of the original service interface, to ensure backward compatibility.
Technically speaking:
NB: The service interface is completely cajo project agnostic, as all service definitions properly should be.
| Modifier and Type | Interface and Description |
|---|---|
static interface |
Service.Proxy
This class is both used by servers to install proxies in a client's JVM,
and by clients to install proxies in a server's JVM.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
isReal()
whilst semantically unrelated to this service, it is just too useful
to leave out.
|
Service.Proxy |
requestProxy()
used to request a client-side running, server proxy.
|
Object |
sendProxy(Service.Proxy proxy)
used to send a client's proxy code to run at the service.
|
Object sendProxy(Service.Proxy proxy) throws ClassNotFoundException
proxy - an object to be sent to the service, which will
be provided a local reference to the service upon its arrival.ClassNotFoundException - if the service JVM does not accept
client proxies.Service.Proxy requestProxy() throws ClassNotFoundException
ClassNotFoundException - if the client JVM does not accept
service proxies.boolean isReal()
Copyright © 2016. All Rights Reserved.