[jboss-cvs] jboss-seam/src/main/org/jboss/seam/mail ...
Peter Muir
peter at bleepbleep.org.uk
Mon Oct 8 16:40:52 EDT 2007
User: pmuir
Date: 07/10/08 16:40:52
Modified: src/main/org/jboss/seam/mail MailSession.java
Log:
WS
Revision Changes Path
1.14 +240 -245 jboss-seam/src/main/org/jboss/seam/mail/MailSession.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: MailSession.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/mail/MailSession.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- MailSession.java 13 Aug 2007 20:21:02 -0000 1.13
+++ MailSession.java 8 Oct 2007 20:40:51 -0000 1.14
@@ -27,12 +27,13 @@
* Manager component for a javax.mail.Session
*/
@Name("org.jboss.seam.mail.mailSession")
- at Install(precedence=BUILT_IN, classDependencies="javax.mail.Session")
+ at Install(precedence = BUILT_IN, classDependencies = "javax.mail.Session")
@Scope(APPLICATION)
@BypassInterceptors
public class MailSession extends AbstractMutable implements Serializable
{
- private static final LogProvider log = Logging.getLogProvider(MailSession.class);
+ private static final LogProvider log = Logging
+ .getLogProvider(MailSession.class);
private Session session;
@@ -48,10 +49,10 @@
@Unwrap
public Session getSession() throws NamingException
{
- if ( session==null )
+ if (session == null)
{
// This simulates an EVENT scope component
- return (Session) Naming.getInitialContext().lookup( getSessionJndiName() );
+ return (Session) Naming.getInitialContext().lookup(getSessionJndiName());
}
else
{
@@ -69,7 +70,7 @@
@Create
public void create()
{
- if ( getSessionJndiName()==null )
+ if (getSessionJndiName() == null)
{
createSession();
}
@@ -84,16 +85,16 @@
// Enable debugging if set
properties.put("mail.debug", isDebug());
- if ( getUsername()!=null && getPassword()==null )
+ if (getUsername() != null && getPassword() == null)
{
log.warn("username supplied without a password (if an empty password is required supply an empty string)");
}
- if ( getUsername()==null && getPassword()!=null )
+ if (getUsername() == null && getPassword() != null)
{
log.warn("password supplied without a username (if no authentication required supply neither)");
}
- if ( getHost()!=null )
+ if (getHost() != null)
{
if (isSsl())
{
@@ -105,7 +106,7 @@
}
}
- if ( getPort()!=null )
+ if (getPort() != null)
{
if (isSsl())
{
@@ -115,8 +116,7 @@
{
properties.put("mail.smtp.port", getPort().toString());
}
- }
- else
+ } else
{
if (isSsl())
{
@@ -139,7 +139,7 @@
// Authentication if required
Authenticator authenticator = null;
- if ( getUsername()!=null && getPassword()!=null )
+ if (getUsername() != null && getPassword() != null)
{
if (isSsl())
{
@@ -167,7 +167,7 @@
}
session = javax.mail.Session.getInstance(properties, authenticator);
- session.setDebug( isDebug() );
+ session.setDebug(isDebug());
log.info("connected to mail server");
}
@@ -178,10 +178,9 @@
}
/**
- * @param 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.
+ * @param 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.
*/
public void setPassword(String password)
{
@@ -194,9 +193,8 @@
}
/**
- * @param username
- * The username to use to authenticate to the server. If not set
- * then no authentication is used. Must be set in conjunction
+ * @param 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.
*/
public void setUsername(String username)
@@ -210,8 +208,7 @@
}
/**
- * @param debug
- * Whether to display debug message logging. Warning, very
+ * @param debug Whether to display debug message logging. Warning, very
* verbose.
*/
public void setDebug(boolean debug)
@@ -225,9 +222,7 @@
}
/**
- * @param host
- * The host to connect to. Used unless overriden by a protocol
- * specific host
+ * @param host The host to connect to
*/
public void setHost(String host)
{
More information about the jboss-cvs-commits
mailing list