net.sf.hajavamail
Class TransportProxy
java.lang.Object
javax.mail.Service
javax.mail.Transport
net.sf.hajavamail.TransportProxy
public class TransportProxy
- extends Transport
- Since:
- 1.0
- Version:
- $Revision: 1.3 $
- Author:
- Paul Ferraro
| Methods inherited from class javax.mail.Service |
addConnectionListener, connect, connect, connect, getURLName, isConnected, notifyConnectionListeners, queueEvent, removeConnectionListener, setConnected, setURLName, toString |
POOL_SIZE
public static final String POOL_SIZE
- See Also:
- Constant Field Values
SENDER_STRATEGY
public static final String SENDER_STRATEGY
- See Also:
- Constant Field Values
CONNECT_RETRY_PERIOD
public static final String CONNECT_RETRY_PERIOD
- See Also:
- Constant Field Values
CONNECT_TIMEOUT
public static final String CONNECT_TIMEOUT
- See Also:
- Constant Field Values
TransportProxy
public TransportProxy(Session session,
URLName url)
throws MessagingException
- Constructs a new TransportProxy.
- Parameters:
session - url -
- Throws:
MessagingException
protocolConnect
protected boolean protocolConnect(String hostList,
int port,
String user,
String password)
throws MessagingException
- Creates and starts a new connector thread for each underlying transport.
This method returns after the first successful transport connection is made.
- Overrides:
protocolConnect in class Service
- Throws:
MessagingException - if no transports were connected within the timeout configured via the CONNECT_TIMEOUT session property.- See Also:
Service.protocolConnect(java.lang.String, int, java.lang.String, java.lang.String)
sendMessage
public void sendMessage(Message message,
Address[] addresses)
throws MessagingException
- Performs simple message validation before sending using the sender strategy configured via the
SENDER_STRATEGY session property.
- Specified by:
sendMessage in class Transport
- Throws:
MessagingException- See Also:
Transport.sendMessage(javax.mail.Message, javax.mail.Address[])
addTransportListener
public void addTransportListener(TransportListener listener)
- Overrides:
addTransportListener in class Transport
- See Also:
Transport.addTransportListener(javax.mail.event.TransportListener)
removeTransportListener
public void removeTransportListener(TransportListener listener)
- Overrides:
removeTransportListener in class Transport
- See Also:
Transport.removeTransportListener(javax.mail.event.TransportListener)
close
public void close()
throws MessagingException
- Closes the Transport proxy. Implementation is as follows:
- Waits until until all sender threads have completed.
- Interrupts the execution of any active connector threads
- Closes the underlying transports
- Calls
javax.mail.Service.close()
- Overrides:
close in class Service
- Throws:
MessagingException- See Also:
Service.close()
finalize
protected void finalize()
throws Throwable
- Closes the transpory proxy, if not closed already.
- Overrides:
finalize in class Service
- Throws:
Throwable- See Also:
Object.finalize()