org.jboss.seam.mail
Class MailSession

java.lang.Object
  extended by org.jboss.seam.core.AbstractMutable
      extended by 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

Constructor Summary
MailSession()
           
MailSession(String transport)
           
 
Method Summary
 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
 String getHost()
           
 String getPassword()
           
 Integer getPort()
           
 javax.mail.Session getSession()
           
 String getSessionJndiName()
           
 String getTransport()
          Get the transport to used.
 String getUsername()
           
static javax.mail.Session instance()
           
 boolean isDebug()
           
 boolean isSsl()
           
 boolean isTls()
           
 void setDebug(boolean debug)
           
 void setHost(String host)
           
 void setPassword(String password)
           
 void setPort(Integer port)
           
 void setSessionJndiName(String jndiName)
           
 void setSsl(boolean ssl)
           
 void setTls(boolean tls)
           
 void setTransport(String transport)
          Explicitly set the transport to use
 void setUsername(String username)
           
 
Methods inherited from class org.jboss.seam.core.AbstractMutable
clearDirty, setDirty, setDirty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailSession

public MailSession()

MailSession

public MailSession(String transport)
Method Detail

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()


Copyright © 2011 Seam Framework. All Rights Reserved.