Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
docs:3500:0400:0410:0411 [2023/04/05 06:25] – ↷ Page moved and renamed from docs:3500:0400:0410_implementing_channel_s_source_and_sink:0411_writing_a_sink to docs:3500:0400:0410:0411 seandocs:3500:0400:0410:0411 [2025/06/12 02:36] (current) – Rename to AwareIM aware_support3
Line 1: Line 1:
-{{tag>Programmers_Reference Adding_Custom_Channels Source_and_sink Writing_Sink}}+{{tag>Programmers_Reference Adding_Custom_Channels Source_and_sink Writing_Sink example}}
 [<10>] [<10>]
 ==== Writing a Sink ==== ==== Writing a Sink ====
Line 7: Line 7:
   - Inherit the Sink from the ''AbstractSimpleSink'' class.   - Inherit the Sink from the ''AbstractSimpleSink'' class.
   - If necessary override init method to provide the Sink-specific initialization (if there’s any) – this method is called once when the Sink is initialized. The Sink-specific properties would have been entered by the user in the Configuration Tool (see also section 4.3)   - If necessary override init method to provide the Sink-specific initialization (if there’s any) – this method is called once when the Sink is initialized. The Sink-specific properties would have been entered by the user in the Configuration Tool (see also section 4.3)
-  - You must override the following method to provide your own handling of messages sent from //**Aware IM**//:<code java>public void processMessage (Message msg)  +  - You must override the following method to provide your own handling of messages sent from //**AwareIM**//:<code java>public void processMessage (Message msg)  
-throws PipelineException;</code> \\ You can translate messages from //**Aware IM**// using the following techniques:+throws PipelineException;</code> \\ You can translate messages from //**AwareIM**// using the following techniques:
       - get the array of DataObject’s from the message:<code java>DataObject [] dobs = msg.peekDataObjects ();</code>       - get the array of DataObject’s from the message:<code java>DataObject [] dobs = msg.peekDataObjects ();</code>
       - use MessageInterpreter class to interpret the message (see also 4.1.3):<code java>MessageInterpreter mi = new MessageInterpreter (dobs);       - use MessageInterpreter class to interpret the message (see also 4.1.3):<code java>MessageInterpreter mi = new MessageInterpreter (dobs);
Line 14: Line 14:
 String serviceName  = mi.getServiceName ();</code> String serviceName  = mi.getServiceName ();</code>
  
-As an example you can see the code snippet below that implements the Sink that sends outgoing e-mails from //**Aware IM**//. Note that this code is for illustration purposes only and certain details such as e-mail construction and sending and error handling are omitted.+As an example you can see the code snippet below that implements the Sink that sends outgoing e-mails from //**AwareIM**//. Note that this code is for illustration purposes only and certain details such as e-mail construction and sending and error handling are omitted.
  
 <code java> public  class EmailSink extends AbstractSimpleSink <code java> public  class EmailSink extends AbstractSimpleSink
  • Last modified: 2023/04/05 06:25