|
eXo Kernel :: Component :: Common Service 2.4.0-CR2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exoplatform.services.mail.impl.MailServiceImpl
public class MailServiceImpl
Basically this is MailService implementation build on top of javax.mail package.
You may define the behaviour of the service via InitParams, which can
be set in configuration file of the ExoContainer.
Note: To be able to send mails you must provide active SMTP server and mention it in service configuration.
Created by The eXo Platform SAS Author : Phung Hai Nam phunghainam@gmail.com Dec 23, 2005
| Constructor Summary | |
|---|---|
MailServiceImpl(InitParams params,
ExoContainerContext ctx)
|
|
| Method Summary | |
|---|---|
protected String[] |
getArrs(String toArray)
|
javax.mail.Session |
getMailSession()
Provides Session instance, which is to be used throughout MailService methods |
String |
getOutgoingMailServer()
Provides outgoing server information, which is basically its hostname or ip address. |
void |
sendMessage(Message message)
Sends mail message based on Message instance |
void |
sendMessage(javax.mail.internet.MimeMessage message)
Sends mail message based on MimeMessage instance |
void |
sendMessage(String from,
String to,
String subject,
String body)
Sends mail message based on passed String parameters. |
Future<Boolean> |
sendMessageInFuture(Message message)
Asynchronous variant of MailService.sendMessage(Message). |
Future<Boolean> |
sendMessageInFuture(javax.mail.internet.MimeMessage message)
Asynchronous variant of MailService.sendMessage(MimeMessage). |
Future<Boolean> |
sendMessageInFuture(String from,
String to,
String subject,
String body)
Asynchronous variant of MailService.sendMessage(String, String, String, String). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MailServiceImpl(InitParams params,
ExoContainerContext ctx)
throws Exception
Exception| Method Detail |
|---|
public javax.mail.Session getMailSession()
Session instance, which is to be used throughout MailService methods
getMailSession in interface MailServiceSessionpublic String getOutgoingMailServer()
MailService should send message
to the server first and than server will resend messages to the receivers.
getOutgoingMailServer in interface MailService
public void sendMessage(String from,
String to,
String subject,
String body)
throws Exception
String parameters.
sendMessage in interface MailServicefrom - - String identificator of mail sender. For example 'test.sender@test.test'to - - String identificator of mail receiver. For example 'test.receiver@test.test'subject - - String subject of mail messagebody - - String contents of mail message
Exception - is thrown if something's gone wrong during mail send procedure
public void sendMessage(Message message)
throws Exception
Message instance
sendMessage in interface MailServicemessage - - Message provides mail message related data (e.g. subject, content etc.)
Exception - is thrown if something's gone wrong during mail send procedure
public void sendMessage(javax.mail.internet.MimeMessage message)
throws Exception
MimeMessage instance
sendMessage in interface MailServicemessage - - MimeMessage provides mail message related data (e.g. subject, content etc.)
Exception - is thrown if something's gone wrong during mail send procedure
public Future<Boolean> sendMessageInFuture(String from,
String to,
String subject,
String body)
MailService.sendMessage(String, String, String, String).
Returns Future object, which allows to track mail sending result. Calling Future.get()
for this object returns Boolean.TRUE if mail is sent successfully,
throws ExecutionException if some exception occured during mail sending.
Calling Throwable.getCause() for the thrown exception object provides the exception,
which indeed occured during sending mail.
sendMessageInFuture in interface MailServicefrom - - String identificator of mail sender. For example 'test.sender@test.test'to - - String identificator of mail receiver. For example 'test.receiver@test.test'subject - - String subject of mail messagebody - - String contents of mail message
Future object to watch the result of asynchronous calculationpublic Future<Boolean> sendMessageInFuture(Message message)
MailService.sendMessage(Message).
Returns Future object, which allows to track mail sending result. Calling Future.get()
for this object returns Boolean.TRUE if mail is sent successfully,
throws ExecutionException if some exception occured during mail sending.
Calling Throwable.getCause() for the thrown exception object provides the exception,
which indeed occured during sending mail.
sendMessageInFuture in interface MailServicemessage - - Message provides mail message related data (e.g. subject, content etc.)
Future object to watch the result of asynchronous calculationpublic Future<Boolean> sendMessageInFuture(javax.mail.internet.MimeMessage message)
MailService.sendMessage(MimeMessage).
Returns Future object, which allows to track mail sending result. Calling Future.get()
for this object returns Boolean.TRUE if mail is sent successfully,
throws ExecutionException if some exception occured during mail sending.
Calling Throwable.getCause() for the thrown exception object provides the exception,
which indeed occured during sending mail.
sendMessageInFuture in interface MailServicemessage - - MimeMessage provides mail message related data (e.g. subject, content etc.)
Future object to watch the result of asynchronous calculationprotected String[] getArrs(String toArray)
|
eXo Kernel :: Component :: Common Service 2.4.0-CR2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||