]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.databoard/src-isv/doc/rpc.mediawiki
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.databoard / src-isv / doc / rpc.mediawiki
index 8e209e3016c2a81446de8519692ee7bc7b40dcb9..eda3bfdfd7fde70f59b2d99c26d9d392c8b547e5 100644 (file)
@@ -1,55 +1,55 @@
-=Remote Procedure Call=\r
-Utilities [../javadoc/org/simantics/databoard/method/Server.html|Server] and [../javadoc/org/simantics/databoard/method/Client.html|Client] put MethodInterface over TCP Socket. \r
-<pre class="code">\r
-    Server myServer      = new Server(8192, mi);\r
-    MethodInterface mi   = new Client("localhost", 8192);\r
-</pre>\r
-\r
-MethodInterface with Server and Client together forms a Remote Procedure Call (RPC) mechanism.\r
-<pre class="code">\r
-    public interface MyInterface { String helloWorld(String msg); }\r
-    \r
-    [Server]\r
-    MethodInterface mi   = Methods.bindInterface( MyInterface.class, myObject );\r
-    Server myServer      = new Server(8192, mi);\r
-    \r
-    [Client]\r
-    MethodInterface mi   = new Client("localhost", 8192);\r
-    MyInterface myObject = Methods.createProxy( MyInterface.class, mi );\r
-</pre>\r
-\r
-==Interface Types==\r
-There are interfaces, method types and method type definitions. \r
-Interface type describes a software interface. It is a collection of methods type definitions. \r
-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
-Method type definition is nominal method description.\r
-\r
-The respective Java classes are:\r
-*[../javadoc/org/simantics/databoard/method/Interface.html|Interface] \r
-*[../javadoc/org/simantics/databoard/method/MethodTypeDefinition.html|MethodTypeDefinition]\r
-*[../javadoc/org/simantics/databoard/method/MethodType.html|MethodType]\r
-\r
-In java InterfaceType description can be created with one of the following methods:\r
-* Implementing InterfaceType\r
-* Reading an Java Interface Class using reflection\r
-<pre class="code">\r
-    Interface it = new Interface( ... methodDefinitions );\r
-    Interface it = getInterface( MyInterface.class );\r
-</pre>\r
-\r
-[../javadoc/org/simantics/databoard/method/MethodInterface.html|MethodInterface] is a binding of an\r
-Java Instance and an Interface Type. It decouples the method invocation from the object.\r
-\r
-MethodInterface can be created with the following methods:\r
-* Implementation\r
-* Reflection\r
-<pre class="code">\r
-    MethodInterface mi   = new MethodInterface() {...}\r
-    MethodInterface mi   = Datatypes.bindInterface( MyInterface.class, myObject );\r
-</pre>\r
-\r
-Utilities <code>Datatypes.createProxy()</code> and <code>Datatypes.bindInterface()</code> adapt between MethodInterface and Java Instance.\r
-<pre class="code">\r
-    MethodInterface mi   = Datatypes.bindInterface( MyInterface.class, myObject );\r
-    MyInterface myObject = Datatypes.createProxy( MyInterface.class, mi );\r
-</pre>\r
+=Remote Procedure Call=
+Utilities [../javadoc/org/simantics/databoard/method/Server.html|Server] and [../javadoc/org/simantics/databoard/method/Client.html|Client] put MethodInterface over TCP Socket. 
+<pre class="code">
+    Server myServer      = new Server(8192, mi);
+    MethodInterface mi   = new Client("localhost", 8192);
+</pre>
+
+MethodInterface with Server and Client together forms a Remote Procedure Call (RPC) mechanism.
+<pre class="code">
+    public interface MyInterface { String helloWorld(String msg); }
+    
+    [Server]
+    MethodInterface mi   = Methods.bindInterface( MyInterface.class, myObject );
+    Server myServer      = new Server(8192, mi);
+    
+    [Client]
+    MethodInterface mi   = new Client("localhost", 8192);
+    MyInterface myObject = Methods.createProxy( MyInterface.class, mi );
+</pre>
+
+==Interface Types==
+There are interfaces, method types and method type definitions. 
+Interface type describes a software interface. It is a collection of methods type definitions. 
+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.
+Method type definition is nominal method description.
+
+The respective Java classes are:
+*[../javadoc/org/simantics/databoard/method/Interface.html|Interface] 
+*[../javadoc/org/simantics/databoard/method/MethodTypeDefinition.html|MethodTypeDefinition]
+*[../javadoc/org/simantics/databoard/method/MethodType.html|MethodType]
+
+In java InterfaceType description can be created with one of the following methods:
+* Implementing InterfaceType
+* Reading an Java Interface Class using reflection
+<pre class="code">
+    Interface it = new Interface( ... methodDefinitions );
+    Interface it = getInterface( MyInterface.class );
+</pre>
+
+[../javadoc/org/simantics/databoard/method/MethodInterface.html|MethodInterface] is a binding of an
+Java Instance and an Interface Type. It decouples the method invocation from the object.
+
+MethodInterface can be created with the following methods:
+* Implementation
+* Reflection
+<pre class="code">
+    MethodInterface mi   = new MethodInterface() {...}
+    MethodInterface mi   = Datatypes.bindInterface( MyInterface.class, myObject );
+</pre>
+
+Utilities <code>Datatypes.createProxy()</code> and <code>Datatypes.bindInterface()</code> adapt between MethodInterface and Java Instance.
+<pre class="code">
+    MethodInterface mi   = Datatypes.bindInterface( MyInterface.class, myObject );
+    MyInterface myObject = Datatypes.createProxy( MyInterface.class, mi );
+</pre>