O'Reilly logo

IBM Rational Application Developer V6 Portlet Application Development and Portal Tools by Ryan Wilson, Gianfranco Rutigliano, George Kroner, Belen Gonzalez, Karla Galvan, Cristiano Cesario, Juan R. Rodriguez

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

7.2. MessageListener

The org.apache.jetspeed.portlet.event.MessageListener interface must be implemented by the portlets receiving a message. The interface defines the single method listed in Example 7-1 on page 227. Since the portlet may be notified by more than one other portlet and therefore may receive different types of messages, it should validate the type of message received prior to working with the object. This is illustrated in Example 7-1 on page 227.

Example 7-1. Implementing the MessageListener interface
public void messageReceived(MessageEvent event) throws PortletException { PortletMessage msg = event.getMessage(); if( msg instanceof DefaultPortletMessage ) { String messageText = ((DefaultPortletMessage)msg).getMessage(); // Add ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required