com.caucho.hemp.services
Class BamMailService

java.lang.Object
  extended by com.caucho.bam.stream.AbstractMessageStream
      extended by com.caucho.bam.actor.SimpleActor
          extended by com.caucho.hemp.services.BamMailService
All Implemented Interfaces:
Actor, ActorHolder, ManagedActor, MessageStream, AlarmListener, java.util.EventListener

public class BamMailService
extends SimpleActor
implements AlarmListener

mail service


Constructor Summary
BamMailService()
           
 
Method Summary
 void addTo(java.lang.String to)
          Adds a 'to'
 void close()
           
 void handleAlarm(Alarm alarm)
          Handles a callback from an alarm.
 void init()
           
 void message(java.lang.String to, java.lang.String from, java.io.Serializable value)
          Sends to a mailbox
protected  java.lang.String messageToText(java.io.Serializable value)
           
 void setDelayTime(Period period)
          Sets the delay time, i.e.
 void setMailSession(Session session)
          Sets the mail session
 void setProperties(java.util.Properties props)
          Sets properties
 void setProperty(java.lang.String key, java.lang.String value)
          Sets a property
 void setSubject(java.lang.String subject)
          Sets subject
 
Methods inherited from class com.caucho.bam.actor.SimpleActor
getActor, getAddress, getBroker, getMailbox, getSender, setAddress, setBroker, setMailbox
 
Methods inherited from class com.caucho.bam.stream.AbstractMessageStream
isClosed, messageError, query, queryError, queryResult, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.caucho.bam.stream.MessageStream
isClosed, messageError, query, queryError, queryResult
 

Constructor Detail

BamMailService

public BamMailService()
Method Detail

setDelayTime

public void setDelayTime(Period period)
Sets the delay time, i.e. how long the service should accumulate messages before sending them.


setMailSession

public void setMailSession(Session session)
Sets the mail session


setProperty

public void setProperty(java.lang.String key,
                        java.lang.String value)
Sets a property


setProperties

public void setProperties(java.util.Properties props)
Sets properties


setSubject

public void setSubject(java.lang.String subject)
Sets subject


addTo

public void addTo(java.lang.String to)
           throws AddressException
Adds a 'to'

Throws:
AddressException

init

@PostConstruct
public void init()

message

public void message(java.lang.String to,
                    java.lang.String from,
                    java.io.Serializable value)
Sends to a mailbox

Specified by:
message in interface MessageStream
Overrides:
message in class AbstractMessageStream
Parameters:
to - the target actor's address
from - the source actor's address
value - the message payload

messageToText

protected java.lang.String messageToText(java.io.Serializable value)

handleAlarm

public void handleAlarm(Alarm alarm)
Description copied from interface: AlarmListener
Handles a callback from an alarm.

Specified by:
handleAlarm in interface AlarmListener

close

@PreDestroy
public void close()