org.jboss.seam.mail
Class MailSession
java.lang.Object
org.jboss.seam.core.AbstractMutable
org.jboss.seam.mail.MailSession
- All Implemented Interfaces:
- Serializable, Mutable
@Name(value="org.jboss.seam.mail.mailSession")
@Install(precedence=0,
classDependencies="javax.mail.Session")
@Scope(value=APPLICATION)
@BypassInterceptors
public class MailSession
- extends AbstractMutable
- implements Serializable
Manager component for a javax.mail.Session
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MailSession
public MailSession()
MailSession
public MailSession(String transport)
getSession
@Unwrap
public javax.mail.Session getSession()
throws NamingException
- Throws:
NamingException
create
@Create
public MailSession create()
- Initialise mail session
Unless disabled, if a mail Session can be found in JNDI, then just manage
be a simple wrapper; otherwise configure the session as specified in
components.xml
getPassword
public String getPassword()
setPassword
public void setPassword(String password)
- Parameters:
password
- The password to use to authenticate to the sending
server. If no authentication is required it should be left
empty. Must be supplied in conjunction with username.
getUsername
public String getUsername()
setUsername
public void setUsername(String username)
- Parameters:
username
- The username to use to authenticate to the server. If not
set then no authentication is used. Must be set in conjunction
with password.
isDebug
public boolean isDebug()
setDebug
public void setDebug(boolean debug)
- Parameters:
debug
- Whether to display debug message logging. Warning, very
verbose.
getHost
public String getHost()
setHost
public void setHost(String host)
- Parameters:
host
- The host to connect to
setPort
public void setPort(Integer port)
getPort
public Integer getPort()
getSessionJndiName
public String getSessionJndiName()
setSessionJndiName
public void setSessionJndiName(String jndiName)
isSsl
public boolean isSsl()
setSsl
public void setSsl(boolean ssl)
isTls
public boolean isTls()
setTls
public void setTls(boolean tls)
getTransport
public String getTransport()
- Get the transport to used. If the not explicitly specified smtp or smtps
is used
setTransport
public void setTransport(String transport)
- Explicitly set the transport to use
instance
public static javax.mail.Session instance()