|
Key
This line was removed.
This word was removed. This word was added.
This line was added.
|
Changes (2)
View Page HistoryTo make easier these different actions, a client library is provided. The next section of this document defines how to use this library to create an RMI client.
{note}The current version of the Petals SE RMI registers only one remote component context. So, just one client can be connected to this context on this component. This restriction will be deleted in a next version of the component. For now, if you want install several clients, you must install several rmi Petals SE RMI components.{note}
h1. Implementing RMI client interacting with a Petals SE RMI
h2. Accessing the RMI registry
The client package of the RMI component contains only one class (the {{ComponentContextLocator}}). To instantiate an object of this class, three inputs parameters are required in the constructor:
* the IP address of the RMI registry server,
* the port to access to the RMI registry (the port used by the RMI registry to handle requests),
* the reference name of the remote component context registered in the RMI registry.
The instantiation of object of this class is presented below:
{code}
ComponentContextLocator ccl = new ComponentContextLocator("192.168.1.150", 1099, "RMIComponentContext");
{code}
{note}To avoid some errors, you must inserted this line code below at the beginning of the program
{code}
System.setProperty( "com.sun.xml.namespace.QName.useCompatibleSerialVersionUID", "1.0" );
{code}
{note}
{note}If the Petals SE RMI component is not started when the {{ComponentContextLocator}} object is instantiated, a remote exception is raised.{note}
Once the object is instantiated, it is possible to access to remote component context.
{info}All objects handle in the code lines presented in the next sections are instantiated from all classes included in the jar artefact of the RMI component.{info}
h2. Accessing the RMI registry
The client package of the RMI component contains only one class (the {{ComponentContextLocator}}). To instantiate an object of this class, three inputs parameters are required in the constructor:
* the IP address of the RMI registry server,
* the port to access to the RMI registry (the port used by the RMI registry to handle requests),
* the reference name of the remote component context registered in the RMI registry.
The instantiation of object of this class is presented below:
{code}
ComponentContextLocator ccl = new ComponentContextLocator("192.168.1.150", 1099, "RMIComponentContext");
{code}
{note}To avoid some errors, you must inserted this line code below at the beginning of the program
{code}
System.setProperty( "com.sun.xml.namespace.QName.useCompatibleSerialVersionUID", "1.0" );
{code}
{note}
{note}If the Petals SE RMI component is not started when the {{ComponentContextLocator}} object is instantiated, a remote exception is raised.{note}
Once the object is instantiated, it is possible to access to remote component context.
{info}All objects handle in the code lines presented in the next sections are instantiated from all classes included in the jar artefact of the RMI component.{info}
h1. Installation