geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject cvs commit: incubator-geronimo/specs/javamail/src/java/javax/mail Provider.java Service.java Store.java Transport.java
Date Thu, 04 Sep 2003 00:51:57 GMT
dblevins    2003/09/03 17:51:57

  Modified:    specs/javamail/src/java/javax/mail Provider.java
                        Service.java Store.java Transport.java
  Log:
  Patch: GERONIMO-52
  From:  Alex Blewitt
  
  Created a patch for missing constructor in Service. Also contains fixes
  for Transport and Session which are subtypes of service.
  
  Note that this patch also includes some implemented methods from Service
  as well.
  
  Revision  Changes    Path
  1.3       +2 -2      incubator-geronimo/specs/javamail/src/java/javax/mail/Provider.java
  
  Index: Provider.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/specs/javamail/src/java/javax/mail/Provider.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Provider.java	16 Aug 2003 04:29:52 -0000	1.2
  +++ Provider.java	4 Sep 2003 00:51:57 -0000	1.3
  @@ -63,7 +63,7 @@
    * @version $Revision$ $Date$
    */
   public class Provider {
  -    public Provider(
  +    private Provider(
           String protocol,
           String className,
           Type type,
  
  
  
  1.3       +24 -6     incubator-geronimo/specs/javamail/src/java/javax/mail/Service.java
  
  Index: Service.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/specs/javamail/src/java/javax/mail/Service.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Service.java	16 Aug 2003 04:29:52 -0000	1.2
  +++ Service.java	4 Sep 2003 00:51:57 -0000	1.3
  @@ -59,11 +59,14 @@
   // DO NOT add / change / or delete method signatures!
   //
   package javax.mail;
  +import java.net.InetAddress;
  +import java.net.UnknownHostException;
   import java.util.Enumeration;
   import java.util.Iterator;
   import java.util.LinkedList;
   import java.util.List;
   import java.util.Vector;
  +
   import javax.mail.event.ConnectionEvent;
   import javax.mail.event.ConnectionListener;
   import javax.mail.event.MailEvent;
  @@ -77,6 +80,10 @@
       protected boolean debug;
       protected Session session;
       protected URLName url;
  +    protected Service(Session session, URLName url) {
  +        this.session = session;
  +        this.url = url;
  +    }
       public void addConnectionListener(ConnectionListener listener) {
           _connectionListeners.add(listener);
       }
  @@ -97,16 +104,27 @@
           boolean retry = true;
           while (retry) {
               try {
  -                // TODO prompt the user for user/password somehow
  -                user = user;
  -                password = password;
                   retry = !protocolConnect(host, port, user, password);
               } catch (AuthenticationFailedException e) {
  -                // IGNORE; go round loop again and will re-prompt
  +                // TODO I18N
  +                try {
  +                    PasswordAuthentication pa =
  +                        session.requestPasswordAuthentication(
  +                            InetAddress.getByName(host),
  +                            port,
  +                            null,
  +                            "Please enter your password",
  +                            user);
  +                    password = pa.getPassword();
  +                    user = pa.getUserName();
  +                } catch (UnknownHostException uhe) {
  +                    throw new MessagingException(uhe.toString());
  +                }
               }
           }
           setConnected(true);
  -        // don't know what the URL needs to be?
  +        // Either the provider will implement getURL, or it will have already set it using
setURL.
  +        // In either case, this is safe.
           setURLName(getURLName());
       }
       public void connect(String host, String user, String password)
  
  
  
  1.3       +2 -3      incubator-geronimo/specs/javamail/src/java/javax/mail/Store.java
  
  Index: Store.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/specs/javamail/src/java/javax/mail/Store.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Store.java	16 Aug 2003 04:29:52 -0000	1.2
  +++ Store.java	4 Sep 2003 00:51:57 -0000	1.3
  @@ -74,8 +74,7 @@
       private List _folderListeners = new LinkedList();
       private List _storeListeners = new LinkedList();
       protected Store(Session session, URLName name) {
  -        this.session = session;
  -        this.url = name;
  +        super(session,name);
       }
       public void addFolderListener(FolderListener listener) {
           _folderListeners.add(listener);
  
  
  
  1.3       +2 -3      incubator-geronimo/specs/javamail/src/java/javax/mail/Transport.java
  
  Index: Transport.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/specs/javamail/src/java/javax/mail/Transport.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Transport.java	16 Aug 2003 04:29:52 -0000	1.2
  +++ Transport.java	4 Sep 2003 00:51:57 -0000	1.3
  @@ -79,8 +79,7 @@
       }
       private List _listeners = new LinkedList();
       public Transport(Session session, URLName name) {
  -        this.session = session;
  -        this.url = name;
  +        super(session,name);
       }
       public void addTransportListener(TransportListener listener) {
           _listeners.add(listener);
  
  
  

Mime
View raw message