PMP Protocol Specification

This document provides a detailed technical description of the ProSyst Message Protocol.

Contents:


Communication Levels

PMP has two communication level - message and operation. An operation may be a request as well as a response. An operation is transported over the network using several messages.

Messages

Each message carried by PMP has the following structure:

Operations

Every operation in PMP consists of one or more messages. All messages within a single operation have the same Message ID.

Invoking Methods. PMP is a powerful means for remote invocation of service methods. The protocol point-to-point communication includes the following operations:

Invoking Methods

Figure 1: Invoking Methods using PMP.
  1. The PMP point on framework A issues a Connect command to connect to the PMP point on framework B which authenticates it. Currently, a user name and a password provide authentication.
  2. The PMP point on framework B examines the login parameters of the point on framework A, and if the latter is a valid framework user, sends Connect Reply.
  3. To get a reference to a service by its interface and a search filter, a Get Reference request is sent.
  4. The PMP point on framework B point sends back the requested reference by performing a Reference operation.
  5. To invoke a method or methods, Get Method is issued.
  6. The PMP point on framework B returns the requested method or methods if such exist in a Method or Methods reply.
  7. To invoke the method, the PMP point on framework A issues an Invoke Method request.
  8. The PMP point on framework B returns the result as primitive data or as a serialized object in an Object response.
  9. After you receive all necessary data, you can dispose engaged resources on the PMP point through a Dispose command.
  10. If there is an error in the PMP point while executing requests, it sends a Disconnect command to terminate the connection.

Receiving Events. To receive a notification about certain events from another framework, a PMP point should subscribe an event listener. Next, it is able to perform specific operations in response.

Events are standard and custom. Standard events are about the mBS framework, bundles and services. Custom events are created by the PMP consumers and are posted in more specific situations.

Supposing that you have already connected to a PMP point, the following message sequence takes place:

Eventing

Figure 2: PMP Eventing Process.
  1. To subscribe an event listener to an event type, the PMP point sends an Add Listener request.
  2. If the listener is successfully registered, the point receives Add Listener Success. If the registration fails, it gets Add Listener Failure.
  3. On an event on the remote framework, the PMP point is notified through Event.
  4. To dismiss the event listener, the PMP point sends a Remove Listener request.
  5. For confirmation, the PMP point gets Remove Listener Success. For an error, it receives Remove Listener Failure.

Refer to the "Registering Event Listeners" section of the PMP Bundle description for information about using Java for event subscription.

Operations

Connect

Disconnect

Get Reference

Get Reference by ID

Get Method

Invoke Method

Invoke Method with Remote Reference Arguments

This operation takes place when a method is invoked with arguments provided as remote reference objects.

Dispose

Add Listener

Remove Listener

Connect Reply

Reference

The Reference operation returns objects by reference.

Methods

Method

Object

The Object operation returns method's results by value.

Add/Remove Listener Success

Add/Remove Listener Failure

Event Type Registered

This operation confirms the registration of a custom event.

Event

Transferred Data Types

PMP uses several data types for information transfer.

Primitive Data Types

The PMP supports the int, byte and long primitive types. Such data is carried as with java.io.DataInputStream and java.io.DataOutputStream.

Objects

Each object is transported by PMP in the following format:

Primitive Type Wrappers. Primitive type wrappers are objects that represent primitive types of data: java.lang.Integer, java.lang.Boolen, and so on. The primitive value of such objects is extracted and transported as with java.io.DataOutputStream.

Strings. PMP transfers java.lang.String objects as bytes in the following format:

Arrays. PMP carries arrays using the following format:

com.prosyst.util.io.Externalizable. Developers may implement the Externalizable interface to serialize objects. PMP transfers only data that is assigned in the writeObject and readObject methods.

java.io.InputStream. PMP delivers data in java.io.InputStream objects as bytes in the following format:

java.io.Serializable. PMP delivers Serializable objects through the standard java.io.ObjectInputStream and java.io.ObjectOutputStream.

References


RPC Category