When netlet A invokes a method on an interface exported by netlet
B, either the method returns or an exception is thrown. The passing
of arguments and return values follows the Java RMI semantics8:
- Primitive types are copied.
- Objects that implement org.jtrix.service.IRemote are proxied.
By default, the proxy has the type declared in the signature. Using
org.jtrix.base.FacetHandle, the proxy type can be controlled
at run-time.
- Objects that do not implement IRemote but implement java.io.Serializable
are transmitted in serialised form. Serialization requires the Class
of the passed implementation object to be the same in both parties'
codebases.
- Objects of other types cannot be passed between netlets.
- Exceptions are always checked for equality with the exception classes
declared in the signature. If an undeclared exception is thrown (even
if it is a subclass of a declared exception), org.jtrix.base.InternalError
is thrown instead.
As an optimisation, instances of org.jtrix.base.Immutable
that are held by the node can be passed directly.
The node may limit the number of active invocations into a netlet
or into the node.
Mediation introduces new error conditions. A new exception type is
defined to indicate those:
-
- org.jtrix.base.MediationError
Ulf Leonhardt
2001-08-16