package javax.mail;
public class Authenticator {
- // Dummy implementation
+ protected PasswordAuthentication getPasswordAuthentication() {
+ return null;
+ }
}
*
* @param obj The reference object describing the Bean
*/
+ @Override
public Object getObjectInstance(Object obj, Name name, Context nameCtx,
Hashtable<?,?> environment)
throws NamingException {
valueArray[0] = value;
} else if (propType.equals(Character.class)
|| propType.equals(char.class)) {
- valueArray[0] = new Character(value.charAt(0));
+ valueArray[0] =
+ Character.valueOf(value.charAt(0));
} else if (propType.equals(Byte.class)
|| propType.equals(byte.class)) {
valueArray[0] = new Byte(value);
public static final String OPENEJB_EJB_FACTORY =
Package + ".OpenEjbFactory";
- public static final String OBJECT_FACTORIES = "";
-
public static final String FACTORY = "factory";
}
*
* @param obj The reference object describing the DataSource
*/
+ @Override
public Object getObjectInstance(Object obj, Name name, Context nameCtx,
Hashtable<?,?> environment)
throws Exception {
*
* @exception Exception if an error occurs during object creation
*/
+ @Override
public Object getObjectInstance(Object refObj, Name name, Context context,
Hashtable<?,?> env) throws Exception {
//
// Bugzilla 31288, 33077: add support for authentication.
return AccessController.doPrivileged(new PrivilegedAction<Session>() {
+ @Override
public Session run() {
// Create the JavaMail properties we will use
if(user != null) {
final PasswordAuthentication pa = new PasswordAuthentication(user, password);
auth = new Authenticator() {
+ @Override
protected PasswordAuthentication getPasswordAuthentication() {
return pa;
}
*
* @param obj The reference object describing the DataSource
*/
+ @Override
public Object getObjectInstance(Object obj, Name name, Context nameCtx,
Hashtable<?,?> environment)
throws Exception {
*
* @param obj The reference object describing the DataSource
*/
+ @Override
public Object getObjectInstance(Object obj, Name name, Context nameCtx,
Hashtable<?,?> environment)
throws Exception {
*
* @param obj The reference object describing the DataSource
*/
+ @Override
public Object getObjectInstance(Object obj, Name name, Context nameCtx,
Hashtable<?,?> environment)
throws Exception {
*
* @param obj The reference object describing the DataSource
*/
+ @Override
public Object getObjectInstance(Object obj, Name name, Context nameCtx,
Hashtable<?,?> environment)
throws NamingException {
import javax.mail.Session;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
-import javax.mail.internet.MimePart;
import javax.mail.internet.MimePartDataSource;
import javax.naming.Context;
import javax.naming.Name;
protected final String DataSourceClassName =
"javax.mail.internet.MimePartDataSource";
+ @Override
public Object getObjectInstance(Object RefObj, Name Nm, Context Ctx,
Hashtable<?,?> Env) throws Exception {
final Reference Ref = (Reference)RefObj;
return AccessController.doPrivileged(
new PrivilegedAction<MimePartDataSource>()
{
+ @Override
public MimePartDataSource run() {
// set up the smtp session that will send the message
Properties props = new Properties();
message.setFrom(new InternetAddress(from));
message.setSubject("");
} catch (Exception e) {}
- MimePartDataSource mds = new MimePartDataSource(
- (MimePart)message);
+ MimePartDataSource mds = new MimePartDataSource(message);
return mds;
}
} );
*
* @param obj The reference object describing the DataSource
*/
+ @Override
public Object getObjectInstance(Object obj, Name name, Context nameCtx,
Hashtable<?,?> environment)
throws Exception {