toc

Usage Scenarios

This section is aimed at describing the various scenarios in which the POP3 suite of beans may be used and how they should be used in each scenario. Some of the scenarios in which the POP3 beans may be used are:


{short description of image}Using POP3 UserInterfaceBean, POP3 CoreProtocolBean and MimeDecoderBean in an application

In this scenario application builders would use both the POP3 UserInterfaceBean and CoreProtocolBean in their applications. It is also assumed that the MimeDecoderBean provided with the POP3 suite of beans will be used. This would involve the following kinds of wiring : wiring the UserInterfaceBean to the CoreProtocolBean and the MimeDecoderBean, and wiring the application container requests to the UserInterfaceBean.

Wiring the UserInterfaceBean to the CoreProtocolBean in this case is extremely simple, and would require the following four connections :

Wiring the application to the UserInterfaceBean would depend (to some extent) on the kind of functionality the application builder will provide through the menubar. A host of API's are provided by the UserInterfaceBean which can be initiated from the application toolbar / menu bar. However, three of these are mandatory, they are :

Further, the user will be required to wire the UserInterfaceBean to the MimeDecoderBean as follows :


{short description of image}Developing a custom POP3 user interface for the CoreProtocolBean and MimeDecoder beans

This scenario assumes that the application developer wants to develop a custom user interface for the CoreProtocolBean, and that they do not plan to use the provided UserInterfaceBean. In this scenario, it is recommended that the developer analyze the events which are generated or received by the CoreProtocolBean and the MimeDecoderBean, namely MessageEvent, StatusEvent, ConfigEvent, DecodeMessageEventand the DecodeEvent.

The UserInterfaceBean should make requests to the CoreProtocolBean using ConfigEvent and calling the receiveMessage method, and update its display by implementing listener interfaces for providing methods to process MessageEventand StatusEvent. Similarly, for its interaction with the MimeDecoderBean it will use DecodeMessageEvent and implement a listener for DecodeEvent. In order to terminate the operation of receiving messages, the abort method of the CoreProtocolBean should be called by the application. Using this mechanism of interaction would minimize the number of connections required to link the user interface with the CoreProtocolBean and the MimeDecoderBean.


{short description of image}Integrating the POP3 CoreProtocolBean and MimeDecoderBean with an existing user interface

For the CoreProtocolBean and the MimeDecoderBean to be usable with an existing user interface, the following criteria would need to be met :

The user interface component should have APIs using which adapter classes can deliver to it mail and status messages and notification about completion of decoding. The user interface component should also fire events which would initiate actions on the CoreProtocolBean for receiving messages or changing the configuration, and which would initiate decoding on the MimeDecoderBean.

The events fired by the user interface component would need to be trapped by the adapter classes to create appropriate events as required by the CoreProtocol and the MimeDecoder beans, or the adapter class could call the corresponding methods on the CoreProtocolBean and MimeDecoderBeans.