Writing Applications - EntireX Java ACI

This document covers the following topics:


Introduction

Interaction with the API occurs through instantiating objects of different classes, invoking their methods and manipulating their inner state. Not all features are necessary for all applications, depending on whether you are writing a client or a server application. The following is a general list of basic steps you have to perform.

Required Steps

  • Instantiate a Broker object. This is the central object you will work with. One object instance represents one session to an EntireX Broker on your network. If you want to work with multiple EntireX Brokers or with multiple sessions, create one object for each session to an EntireX Broker. Using the same object instance in multiple sessions may result in slow response times and performance issues.

  • Use the Broker object to log on the application to EntireX Broker.

  • Instantiate a BrokerService object. If you are writing a server application, use the BrokerService object to register your service with the EntireX Broker.

  • Declare a BrokerMessage variable. If you want to send a message, instantiate a new BrokerMessage object, complete it with your message and send it using one of the send methods. Messages received from the Broker are received in a newly created BrokerMessage object.

  • Non-conversational communication is handled by the BrokerService and BrokerMessage objects. Use the send, sendReceive and receive methods of BrokerService for synchronous and asynchronous non-conversational communication. When writing a server, you can use the reply method of BrokerMessage.

  • Conversational communication is handled by the Conversation and BrokerMessage objects.

  • Unit-of-work communication is handled by the UnitofWork and BrokerMessage objects.

  • Perform all your business logic processing on the message contents.

  • When finished, end your conversations, deregister your service (if you are writing a server) and log off from EntireX Broker.