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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Using</strong> the AdapterAn <strong>Ensemble</strong> production continues running until it is stopped, either programmatically or by an administrator using theManagement Portal. When a production stops, the following events related to inbound adapters occur:1. <strong>Ensemble</strong> disables each business service; no more incoming requests are accepted for this production.2. The OnTearDown() method in each inbound adapter is called.3. All inbound adapter and business service objects are destroyed and their background processes are killed.4. Each business service’s OnProductionStop class method is called, once for each configured item of that class in theproduction.When a business service is disabled by a system administrator, or becomes inactive according to its configured schedule,the production continues to run but the associated inbound adapter is shut down, and its OnTearDown() method is executed,as described above.6.2 <strong>Using</strong> the AdapterOnce you determine that your production needs the EnsLib.<strong>TCP</strong>.TextLineInboundAdapter, you can include it in the productionconfiguration as follows:1. Choose or create a business service class that uses the EnsLib.<strong>TCP</strong>.TextLineInboundAdapter.2. If you create a new business service class, be sure to:• Implement its OnProcessInput() method.• Compile the class.3. Configure the production. Add a business service of the chosen class.4. Configure the new business service. To do so, click it and specify values for the settings on the right.To enable it, select the Enabled box.The next sections provide details.6.3 Creating a New Business Service ClassThe simplest way to deploy the EnsLib.<strong>TCP</strong>.TextLineInboundAdapter is to choose an existing business service class thatalready uses it. You can choose any business service class that uses the EnsLib.<strong>TCP</strong>.TextLineInboundAdapter, for examplethis built-in business service:• EnsLib.<strong>TCP</strong>.StatusService — Parses a string request to determine what type of production status information is beingrequested. Produces a reply string suitable for writing out to a console screen.If no existing class has the functionality you need, create a new business service class that uses theEnsLib.<strong>TCP</strong>.TextLineInboundAdapter. Create the new class in Studio as follows:1. From the File menu, choose New. A dialog pops up. Edit it as follows:• Click on the Production tab.• Select the Business Service icon and click OK.• Enter a package and class name and click Next.<strong>Using</strong> <strong>TCP</strong> <strong>Adapters</strong> <strong>with</strong> <strong>Ensemble</strong> 37

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

Saved successfully!

Ooh no, something went wrong!