- All Superinterfaces:
- Message
- See Also:
- Top Examples, Source Code,
Session.createObjectMessage()
,
Session.createObjectMessage(Serializable)
,
BytesMessage
,
MapMessage
,
StreamMessage
,
TextMessage
public Serializable getObject()
throws JMSException
- See Also:
- MessageFormatException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
[468]MDB example
By aneezh { at } ibsplc { dot } com on 2003/10/22 13:07:51 Rate
package com.ibsplc.dacs.testing;
import javax.ejb.*;
import javax.jms.*;
import com.ibsplc.dacs.vo.EmailMessageVO;
public class TestMDB implements MessageDrivenBean ,MessageListener
{
public TestMDB ( ) { }
public void ejbCreate ( ) {
System.out.println ( "ejbCreate ( ) invoked" ) ;
}
public void ejbRemove ( ) {
System.out.println ( "ejbRemove invoked" ) ;
}
public void onMessage ( Message message ) {
try {
//if ( message instanceof ObjectMessage ) {
System.out.println ( "Entered the onMessage ( ) " ) ;
System.out.println ( "The JMS type is" + message.getJMSType ( ) ) ;
ObjectMessage msg = ( ObjectMessage ) message;
System.out.println ( "Object Found ::: " ) ;
EmailMessageVO messageObject = ( EmailMessageVO ) msg.getObject ( ) ;
System.out.println ( "********************************" ) ;
System.out.println ( messageObject.getMailFrom ( ) ) ;
System.out.println ( "********************************" ) ;
System.out.println ( "********************************" ) ;
// }
} catch ( JMSException je ) {
System.out.println ( je.toString ( ) ) ;
}
}
public void setMessageDrivenContext ( MessageDrivenContext ctx ) {
this.ctx = ctx;
}
private MessageDrivenContext ctx;
}
public void setObject(Serializable object)
throws JMSException
- See Also:
- MessageNotWriteableException, MessageFormatException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples