Extension would be realized as Tuscany binding extension (both service and reference). JInterface ("The Jinterface Application is a java communication tool package to erlang") wuold be used.
Responsible for publishing SCA components as Erlang processes/nodes. Instance of service binding would be equivalent to one Erlang node. It would support:
Responsible for accessing existing Erlang processes/nodes. It would support:
Name mapping: local composite operation name will be used to call remote Erlang procedure. Java types would be used and translated transparently to/from OtpErlang* types.
Message boxes would be configured in binding configuration, as follows:
<binding.erlang nodePointer="..."> <mbox name="mbox1" operation="handleMessageOnMbox1"/> <mbox name="mbox2" operation="handleMessageOnMbox2"/> </binding.erlang> |
Java interface for this binding would be:
public interface SCAErlangProcess {
void handleMessageOnMbox1(String pid, String message); // first mbox mapped in binding configuration. Methods arguments are example and shows that we expect message in such format.
void handleMessageOnMbox2(String pid, String mPart1, String mPart2); // second mbox mapped in binding configuration
}
|
Incoming messages will trigger calling operation which is assigned to certain mbox.
Message boxes would be configured in binding configuration, as follows:
<binding.erlang nodePointer="..."> <mbox name="mbox1" operation="sendToMbox1"/> <mbox name="mbox2" operation="sendToMbox2"> </binding.erlang> |
Java interface for this binding would be:
public interface RemoteErlangProcess {
void sendToMbox1(String pid, String message); // first mbox mapped in binding configuration. Methods arguments are example and shows that we allow to send such message.
void sendToMbox1(String mPart1, String mPart2); // second mbox mapped in binding configuration
}
|
User call on mapped operation will cause to send message to mbox which is pointed in configuration.
In Erlang processes are being created dynamically and without registering mbox name user cannot guess its PID. In Erlang communication processes often sends their PIDs as first part of message (as an return address), so similar mechanism should be provided. In example it could be additional parameter in binding configuration which would cause sending messages preceeded with its mbox PID.
Link - it's a bi-directional propagation path for exit signals - see http://www.erlang.org/course/error_handling.html.
It's optional feature.
<binding.erlang nodePointer="..."> <link process="x" operation="handleSignal"> <!-- operation for handling exit signal --> </binding.erlang> |
Proposed linking approach does not provide any way to configure links in runtime. Imagine that after receiving exit signal linked process ended, link was canceled and we would like to establish another link.