1 =Remote Procedure Call=
\r
2 Utilities [../javadoc/org/simantics/databoard/method/Server.html|Server] and [../javadoc/org/simantics/databoard/method/Client.html|Client] put MethodInterface over TCP Socket.
\r
4 Server myServer = new Server(8192, mi);
\r
5 MethodInterface mi = new Client("localhost", 8192);
\r
8 MethodInterface with Server and Client together forms a Remote Procedure Call (RPC) mechanism.
\r
10 public interface MyInterface { String helloWorld(String msg); }
\r
13 MethodInterface mi = Methods.bindInterface( MyInterface.class, myObject );
\r
14 Server myServer = new Server(8192, mi);
\r
17 MethodInterface mi = new Client("localhost", 8192);
\r
18 MyInterface myObject = Methods.createProxy( MyInterface.class, mi );
\r
22 There are interfaces, method types and method type definitions.
\r
23 Interface type describes a software interface. It is a collection of methods type definitions.
\r
24 Method type is an unnamed function with the following properties : Response Type, Request Type and ErrorType; where Response Type is any Data Type, Request Type is a Record and Error Type is an Union.
\r
25 Method type definition is nominal method description.
\r
27 The respective Java classes are:
\r
28 *[../javadoc/org/simantics/databoard/method/Interface.html|Interface]
\r
29 *[../javadoc/org/simantics/databoard/method/MethodTypeDefinition.html|MethodTypeDefinition]
\r
30 *[../javadoc/org/simantics/databoard/method/MethodType.html|MethodType]
\r
32 In java InterfaceType description can be created with one of the following methods:
\r
33 * Implementing InterfaceType
\r
34 * Reading an Java Interface Class using reflection
\r
36 Interface it = new Interface( ... methodDefinitions );
\r
37 Interface it = getInterface( MyInterface.class );
\r
40 [../javadoc/org/simantics/databoard/method/MethodInterface.html|MethodInterface] is a binding of an
\r
41 Java Instance and an Interface Type. It decouples the method invocation from the object.
\r
43 MethodInterface can be created with the following methods:
\r
47 MethodInterface mi = new MethodInterface() {...}
\r
48 MethodInterface mi = Datatypes.bindInterface( MyInterface.class, myObject );
\r
51 Utilities <code>Datatypes.createProxy()</code> and <code>Datatypes.bindInterface()</code> adapt between MethodInterface and Java Instance.
\r
53 MethodInterface mi = Datatypes.bindInterface( MyInterface.class, myObject );
\r
54 MyInterface myObject = Datatypes.createProxy( MyInterface.class, mi );
\r