org.apache.james.transport.mailets
Class RemoteDeliverySocketFactory

java.lang.Object
  extended by javax.net.SocketFactory
      extended by org.apache.james.transport.mailets.RemoteDeliverySocketFactory

public class RemoteDeliverySocketFactory
extends javax.net.SocketFactory

It is used by RemoteDelivery in order to make possible to bind the client socket to a specific ip address. This is not a nice solution because the ip address must be shared by all RemoteDelivery instances. It would be better to modify JavaMail (current version 1.3) to support a corresonding property, e.g. mail.smtp.bindAdress. This used to not extend javax.net.SocketFactory descendant, because 1. it was not necessary because JavaMail 1.2 uses reflection when accessing this class; 2. it was not desirable because it would require java 1.4. But since James 2.3.0a1: 1. we require Java 1.4 so the dependency on SocketFactory is not really an issue; 2. Javamail 1.4 cast the object returned by getDefault to SocketFactory and fails to create the socket if we don't extend SocketFactory. Note: Javamail 1.4 should correctly support mail.smtp.localaddr so we could probably get rid of this class and simply add that property to the Session.


Constructor Summary
RemoteDeliverySocketFactory()
           
 
Method Summary
 java.net.Socket createSocket()
          the same as the similarly named javax.net.SocketFactory operation.
 java.net.Socket createSocket(java.net.InetAddress host, int port)
          the same as the similarly named javax.net.SocketFactory operation.
 java.net.Socket createSocket(java.net.InetAddress address, int port, java.net.InetAddress clientAddress, int clientPort)
          the same as the similarly named javax.net.SocketFactory operation.
 java.net.Socket createSocket(java.lang.String host, int port)
          the same as the similarly named javax.net.SocketFactory operation.
 java.net.Socket createSocket(java.lang.String host, int port, java.net.InetAddress clientHost, int clientPort)
          the same as the similarly named javax.net.SocketFactory operation.
static javax.net.SocketFactory getDefault()
          the same as the similarly named javax.net.SocketFactory operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteDeliverySocketFactory

public RemoteDeliverySocketFactory()
Method Detail

getDefault

public static javax.net.SocketFactory getDefault()
the same as the similarly named javax.net.SocketFactory operation.


createSocket

public java.net.Socket createSocket()
                             throws java.io.IOException
the same as the similarly named javax.net.SocketFactory operation. Just to be safe, it is not used by JavaMail 1.3. This is the only method used by JavaMail 1.4.

Overrides:
createSocket in class javax.net.SocketFactory
Throws:
java.io.IOException

createSocket

public java.net.Socket createSocket(java.lang.String host,
                                    int port)
                             throws java.io.IOException,
                                    java.net.UnknownHostException
the same as the similarly named javax.net.SocketFactory operation. This is the one which is used by JavaMail 1.3. This is not used by JavaMail 1.4.

Specified by:
createSocket in class javax.net.SocketFactory
Throws:
java.io.IOException
java.net.UnknownHostException

createSocket

public java.net.Socket createSocket(java.lang.String host,
                                    int port,
                                    java.net.InetAddress clientHost,
                                    int clientPort)
                             throws java.io.IOException,
                                    java.net.UnknownHostException
the same as the similarly named javax.net.SocketFactory operation. Just to be safe, it is not used by JavaMail 1.3. This is not used by JavaMail 1.4.

Specified by:
createSocket in class javax.net.SocketFactory
Throws:
java.io.IOException
java.net.UnknownHostException

createSocket

public java.net.Socket createSocket(java.net.InetAddress host,
                                    int port)
                             throws java.io.IOException
the same as the similarly named javax.net.SocketFactory operation. Just to be safe, it is not used by JavaMail 1.3. This is not used by JavaMail 1.4.

Specified by:
createSocket in class javax.net.SocketFactory
Throws:
java.io.IOException

createSocket

public java.net.Socket createSocket(java.net.InetAddress address,
                                    int port,
                                    java.net.InetAddress clientAddress,
                                    int clientPort)
                             throws java.io.IOException
the same as the similarly named javax.net.SocketFactory operation. Just to be safe, it is not used by JavaMail 1.3. This is not used by JavaMail 1.4.

Specified by:
createSocket in class javax.net.SocketFactory
Throws:
java.io.IOException


Copyright © 2002-2007 The Apache Software Foundation. All Rights Reserved.