Developing Apama Applications > Developing Adapters > Apama File Adapter > LineWritten event
LineWritten event
After the File adapter writes a line to a file, the adapter sends a LineWritten event. The event definition is as follows:
event LineWritten
{
/* The name of the transport being used within the File adapter */
string transportName;
 
/* Request ID this event is in response to. */
integer requestId;
 
/* The sessionId the FileLine was sent for */
integer sessionId;
}
This is useful when you want your application to send FileLine events in a batch to control flow. If you need to do flow control, you would typically set all the requestIds to positive values and emit the next FileLine events only after receiving the LineWritten notification for the previous FileLine event you sent. If you do not need to do flow control, you could set requestId=-1 for all but the last FileLine event, but set it to a positive value for the very last FileLine event so you get a single LineWritten notification when everything has been written.
The file remains open for the lifetime of the adapter unless you emit a CloseFile event. See Opening files for reading for the CloseFile event definition.
Copyright © Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its Subsidiaries and or/its Affiliates and/or their licensors.
Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG.