Email Answering System
Version 1.0

com.ninecode.email.beans.master
Class EmailResponder

java.lang.Object
  |
  +--com.ninecode.email.beans.master.EmailResponder
All Implemented Interfaces:
EnterpriseBean, MessageDrivenBean, MessageListener, Serializable

public class EmailResponder
extends Object
implements MessageDrivenBean, MessageListener

Reply to original email sender with contents of a jms message.

Author:
Derrick Oswald
See Also:
Serialized Form

Field Summary
protected  Connection mConnection
           
protected  RecordFactory mFactory
           
 
Constructor Summary
EmailResponder()
          Creates a new instance of EmailResponder
 
Method Summary
 void ejbCreate()
          Startup call.
 void ejbRemove()
          Shutdown call.
 Connection getConnection()
           
 RecordFactory getFactory()
           
 void onMessage(Message message)
          Process a message.
 void sendMessage(InternetAddress address, String subject, String text, int retries)
          Send a message using the resource adapter.
 void sendMessage(TextMessage msg)
          Send a message using the resource adapter.
 void setMessageDrivenContext(MessageDrivenContext mdc)
          Remember the context for this instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mConnection

protected Connection mConnection

mFactory

protected RecordFactory mFactory
Constructor Detail

EmailResponder

public EmailResponder()
Creates a new instance of EmailResponder

Method Detail

ejbCreate

public void ejbCreate()
Startup call.


getConnection

public Connection getConnection()

getFactory

public RecordFactory getFactory()

sendMessage

public void sendMessage(InternetAddress address,
                        String subject,
                        String text,
                        int retries)
Send a message using the resource adapter.

Parameters:
address - The address to send it to.
subject - The subject line.
text - The body of the message.
retries - The number of times to retry on resource adapter failure.

sendMessage

public void sendMessage(TextMessage msg)
Send a message using the resource adapter.

Parameters:
msg - The message to send. Property 'To' and 'Subject' are used as the recipient and subject line while the text of the message is sent as the body.

ejbRemove

public void ejbRemove()
               throws EJBException
Shutdown call.

Specified by:
ejbRemove in interface MessageDrivenBean
EJBException

setMessageDrivenContext

public void setMessageDrivenContext(MessageDrivenContext mdc)
                             throws EJBException
Remember the context for this instance.

Specified by:
setMessageDrivenContext in interface MessageDrivenBean
EJBException

onMessage

public void onMessage(Message message)
Process a message.

Specified by:
onMessage in interface MessageListener
Parameters:
message - The message to process.

Email Answering System
Version 1.0

Copyright © 2003 Derrick Oswald. All rights reserved.