public abstract class Transport extends Service
Constructor and Description |
---|
Transport(Session session,
URLName name)
Constructor taking Session and URLName parameters required for
Service.Service(Session, URLName) . |
Modifier and Type | Method and Description |
---|---|
void |
addTransportListener(TransportListener listener) |
protected void |
notifyTransportListeners(int type,
Address[] validSent,
Address[] validUnsent,
Address[] invalid,
Message message) |
void |
removeTransportListener(TransportListener listener) |
static void |
send(Message message)
Send a message to all recipient addresses it contains (as returned by
Message.getAllRecipients() )
using message transports appropriate for each address. |
static void |
send(Message message,
Address[] addresses)
Send a message to all addresses provided irrespective of any recipients contained in the message itself
using message transports appropriate for each address.
|
abstract void |
sendMessage(Message message,
Address[] addresses)
Send a message to the supplied addresses using this transport; if any of the addresses are
invalid then a
SendFailedException is thrown. |
addConnectionListener, close, connect, connect, connect, connect, finalize, getURLName, isConnected, notifyConnectionListeners, protocolConnect, queueEvent, removeConnectionListener, setConnected, setURLName, toString
public Transport(Session session, URLName name)
Service.Service(Session, URLName)
.session
- the Session this transport is forname
- the location this transport is forpublic static void send(Message message) throws MessagingException
Message.getAllRecipients()
)
using message transports appropriate for each address. Message addresses are checked during submission,
but there is no guarantee that the ultimate address is valid or that the message will ever be delivered.
Message.saveChanges()
will be called before the message is actually sent.message
- the message to sendMessagingException
- if there was a problem sending the messagepublic static void send(Message message, Address[] addresses) throws MessagingException
Message.saveChanges()
will be called before the message is actually sent.message
- the message to sendaddresses
- the addesses to send toMessagingException
- if there was a problem sending the messagepublic abstract void sendMessage(Message message, Address[] addresses) throws MessagingException
SendFailedException
is thrown. Whether the message is actually sent
to any of the addresses is undefined.
Unlike the static send(Message, Address[])
method, Message.saveChanges()
is
not called. A TransportEvent
will be sent to registered listeners once the delivery
attempt has been made.message
- the message to sendaddresses
- list of addresses to send it toSendFailedException
- if the send failedMessagingException
- if there was a problem sending the messagepublic void addTransportListener(TransportListener listener)
public void removeTransportListener(TransportListener listener)
Copyright © 2013. All Rights Reserved.