10.07.2015 Views

Using TCP Adapters with Ensemble - InterSystems Documentation

Using TCP Adapters with Ensemble - InterSystems Documentation

Using TCP Adapters with Ensemble - InterSystems Documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Using</strong> the <strong>TCP</strong> Counted Inbound AdapterFigure 2–1: <strong>Using</strong> the <strong>TCP</strong> Counted Inbound Adapter and Business ServiceThe figure above shows the flow of a request from an external data source into <strong>Ensemble</strong> after you have set up an <strong>Ensemble</strong>business service to work <strong>with</strong> an inbound adapter. This figure shows the ingoing data stream only; any response simplyretraces this path. The sequence is as follows:1. At production startup, <strong>Ensemble</strong> creates a background process for each of the business services in the productionconfiguration. <strong>Ensemble</strong> can allocate more than one background process per business service. The business service’sconfigured PoolSize specifies the number of background processes.2. Within each background process, <strong>Ensemble</strong> creates an instance of the business service class and an instance of itsassociated inbound adapter class.3. <strong>Ensemble</strong> calls the OnInit() methods of the business service object and inbound adapter object, respectively.4. Thereafter, whenever the production is running and the business service is enabled and scheduled to be active, thefollowing cycle can occur:• Each time the adapter encounters input from its configured data source, it calls the <strong>Ensemble</strong> framework’sProcessInput() method.• The call to ProcessInput() automatically prompts the <strong>Ensemble</strong> framework to call the associated business service’sOnProcessInput() method.• Code <strong>with</strong>in OnProcessInput() determines what to do <strong>with</strong> the incoming data stream. For example, if an<strong>Ensemble</strong> business process needs to be started, the business service formulates an <strong>Ensemble</strong> request message andissues the synchronous or asynchronous call that starts the business process.If the data source expects an acknowledgment or response of some kind, it is the business service’sOnProcessInput() that constructs it. The inbound adapter simply relays this response back to the external datasource.Note:There is no default implementation of OnProcessInput(). The developer of each business service classis responsible for writing an OnProcessInput() method for that class. For instructions, see the nextsection, “<strong>Using</strong> the Adapter.”6 <strong>Using</strong> <strong>TCP</strong> <strong>Adapters</strong> <strong>with</strong> <strong>Ensemble</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!