亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? transport.java

?? java Email you can use it to send email to others
?? JAVA
字號:
/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License").  You * may not use this file except in compliance with the License. You can obtain * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html * or glassfish/bootstrap/legal/LICENSE.txt.  See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. * Sun designates this particular file as subject to the "Classpath" exception * as provided by Sun in the GPL Version 2 section of the License file that * accompanied this code.  If applicable, add the following below the License * Header, with the fields enclosed by brackets [] replaced by your own * identifying information: "Portions Copyrighted [year] * [name of copyright owner]" * * Contributor(s): * * If you wish your version of this file to be governed by only the CDDL or * only the GPL Version 2, indicate your decision by adding "[Contributor] * elects to include this software in this distribution under the [CDDL or GPL * Version 2] license."  If you don't indicate a single choice of license, a * recipient has the option to distribute your version of this file under * either the CDDL, the GPL Version 2 or to extend the choice of license to * its licensees as provided above.  However, if you add GPL Version 2 code * and therefore, elected the GPL Version 2 license, then the option applies * only if the new code is made subject to such option by the copyright * holder. *//* * @(#)Transport.java	1.40 07/05/17 */package javax.mail;import java.io.IOException;import java.net.*;import java.util.Vector;import java.util.Hashtable;import java.util.Enumeration;import javax.mail.event.*;/** * An abstract class that models a message transport. * Subclasses provide actual implementations. <p> * * Note that <code>Transport</code> extends the <code>Service</code> * class, which provides many common methods for naming transports, * connecting to transports, and listening to connection events. * * @author John Mani * @author Max Spivak * @author Bill Shannon * @version 1.40, 07/05/17 *  * @see javax.mail.Service * @see javax.mail.event.ConnectionEvent * @see javax.mail.event.TransportEvent */public abstract class Transport extends Service {    /**     * Constructor.     *     * @param	session Session object for this Transport.     * @param	urlname	URLName object to be used for this Transport     */    public Transport(Session session, URLName urlname) {	super(session, urlname);    }    /**     * Send a message.  The message will be sent to all recipient     * addresses specified in the message (as returned from the     * <code>Message</code> method <code>getAllRecipients</code>),     * using message transports appropriate to each address.  The     * <code>send</code> method calls the <code>saveChanges</code>     * method on the message before sending it. <p>     *     * If any of the recipient addresses is detected to be invalid by     * the Transport during message submission, a SendFailedException     * is thrown. Clients can get more detail about the failure by examining     * the exception. Whether or not the message is still sent succesfully to     * any valid addresses depends on the Transport implementation. See      * SendFailedException for more details. Note also that success does      * not imply that the message was delivered to the ultimate recipient,     * as failures may occur in later stages of delivery.  Once a Transport      * accepts a message for delivery to a recipient, failures that occur later     * should be reported to the user via another mechanism, such as     * returning the undeliverable message. <p>     *     * Note that <code>send</code> is a static method that creates and     * manages its own connection.  Any connection associated with any     * Transport instance used to invoke this method is ignored and not     * used.  This method should only be invoked using the form     * <code>Transport.send(msg);</code>, and should never be invoked     * using an instance variable.     *     * @param	msg	the message to send     * @exception	SendFailedException if the message could not     *			be sent to some or any of the recipients.     * @exception	MessagingException     * @see		Message#saveChanges     * @see		Message#getAllRecipients     * @see		#send(Message, Address[])     * @see		javax.mail.SendFailedException     */    public static void send(Message msg) throws MessagingException {	msg.saveChanges(); // do this first	send0(msg, msg.getAllRecipients());    }    /**     * Send the message to the specified addresses, ignoring any     * recipients specified in the message itself. The     * <code>send</code> method calls the <code>saveChanges</code>     * method on the message before sending it. <p>     *     * @param	msg	the message to send     * @param	addresses the addresses to which to send the message     * @exception	SendFailedException if the message could not     *			be sent to some or any of the recipients.     * @exception	MessagingException     * @see		Message#saveChanges     * @see             #send(Message)     * @see		javax.mail.SendFailedException     */    public static void send(Message msg, Address[] addresses) 		throws MessagingException {	msg.saveChanges();	send0(msg, addresses);    }    // send, but without the saveChanges    private static void send0(Message msg, Address[] addresses) 		throws MessagingException {	if (addresses == null || addresses.length == 0)	    throw new SendFailedException("No recipient addresses");	/*	 * protocols is a hashtable containing the addresses	 * indexed by address type	 */	Hashtable protocols = new Hashtable();	// Vectors of addresses	Vector invalid = new Vector();	Vector validSent = new Vector();	Vector validUnsent = new Vector();	for (int i = 0; i < addresses.length; i++) {	    // is this address type already in the hashtable?	    if (protocols.containsKey(addresses[i].getType())) {		Vector v = (Vector)protocols.get(addresses[i].getType());		v.addElement(addresses[i]);	    } else {		// need to add a new protocol		Vector w = new Vector();		w.addElement(addresses[i]);		protocols.put(addresses[i].getType(), w);	    }	}	int dsize = protocols.size();	if (dsize == 0)	    throw new SendFailedException("No recipient addresses");	Session s = (msg.session != null) ? msg.session :		     Session.getDefaultInstance(System.getProperties(), null);	Transport transport;	/*	 * Optimize the case of a single protocol.	 */	if (dsize == 1) {	    transport = s.getTransport(addresses[0]);	    try {		transport.connect();		transport.sendMessage(msg, addresses);	    } finally {		transport.close();	    }	    return;	}	/*	 * More than one protocol.  Have to do them one at a time	 * and collect addresses and chain exceptions.	 */	MessagingException chainedEx = null;	boolean sendFailed = false;	Enumeration e = protocols.elements();	while (e.hasMoreElements()) {	    Vector v = (Vector)e.nextElement();	    Address[] protaddresses = new Address[v.size()];	    v.copyInto(protaddresses);	    // Get a Transport that can handle this address type.	    if ((transport = s.getTransport(protaddresses[0])) == null) {		// Could not find an appropriate Transport ..		// Mark these addresses invalid.		for (int j = 0; j < protaddresses.length; j++)		    invalid.addElement(protaddresses[j]);		continue;	    }	    try {		transport.connect();		transport.sendMessage(msg, protaddresses);	    } catch (SendFailedException sex) {		sendFailed = true;		// chain the exception we're catching to any previous ones		if (chainedEx == null)		    chainedEx = sex;		else		    chainedEx.setNextException(sex);		// retrieve invalid addresses		Address[] a = sex.getInvalidAddresses();		if (a != null)		    for (int j = 0; j < a.length; j++) 			invalid.addElement(a[j]);		// retrieve validSent addresses		a = sex.getValidSentAddresses();		if (a != null)		    for (int k = 0; k < a.length; k++) 			validSent.addElement(a[k]);		// retrieve validUnsent addresses		Address[] c = sex.getValidUnsentAddresses();		if (c != null)		    for (int l = 0; l < c.length; l++) 			validUnsent.addElement(c[l]);	    } catch (MessagingException mex) {		sendFailed = true;		// chain the exception we're catching to any previous ones		if (chainedEx == null)		    chainedEx = mex;		else		    chainedEx.setNextException(mex);	    } finally {		transport.close();	    }	}	// done with all protocols. throw exception if something failed	if (sendFailed || invalid.size() != 0 || validUnsent.size() != 0) { 	    Address[] a = null, b = null, c = null;	    // copy address vectors into arrays	    if (validSent.size() > 0) {		a = new Address[validSent.size()];		validSent.copyInto(a);	    }	    if (validUnsent.size() > 0) {		b = new Address[validUnsent.size()];		validUnsent.copyInto(b);	    }	    if (invalid.size() > 0) {		c = new Address[invalid.size()];		invalid.copyInto(c);	    }	    throw new SendFailedException("Sending failed", chainedEx, 					  a, b, c);	}    }    /**     * Send the Message to the specified list of addresses. An appropriate     * TransportEvent indicating the delivery status is delivered to any      * TransportListener registered on this Transport. Also, if any of     * the addresses is invalid, a SendFailedException is thrown.     * Whether or not the message is still sent succesfully to     * any valid addresses depends on the Transport implementation. <p>     *     * Unlike the static <code>send</code> method, the <code>sendMessage</code>     * method does <em>not</em> call the <code>saveChanges</code> method on     * the message; the caller should do so.     *     * @param msg	The Message to be sent     * @param addresses	array of addresses to send this message to     * @see 		javax.mail.event.TransportEvent     * @exception SendFailedException if the send failed because of     *			invalid addresses.     * @exception MessagingException if the connection is dead or not in the      * 				connected state     */    public abstract void sendMessage(Message msg, Address[] addresses) 				throws MessagingException;    // Vector of Transport listeners    private Vector transportListeners = null;    /**     * Add a listener for Transport events. <p>     *     * The default implementation provided here adds this listener     * to an internal list of TransportListeners.     *     * @param l         the Listener for Transport events     * @see             javax.mail.event.TransportEvent     */    public synchronized void addTransportListener(TransportListener l) {	if (transportListeners == null)	    transportListeners = new Vector();	transportListeners.addElement(l);    }    /**     * Remove a listener for Transport events. <p>     *     * The default implementation provided here removes this listener     * from the internal list of TransportListeners.     *     * @param l         the listener     * @see             #addTransportListener     */    public synchronized void removeTransportListener(TransportListener l) {	if (transportListeners != null)	    transportListeners.removeElement(l);    }    /**     * Notify all TransportListeners. Transport implementations are     * expected to use this method to broadcast TransportEvents.<p>     *     * The provided default implementation queues the event into     * an internal event queue. An event dispatcher thread dequeues     * events from the queue and dispatches them to the registered     * TransportListeners. Note that the event dispatching occurs     * in a separate thread, thus avoiding potential deadlock problems.     */    protected void notifyTransportListeners(int type, Address[] validSent,					    Address[] validUnsent,					    Address[] invalid, Message msg) {	if (transportListeners == null)	    return;		TransportEvent e = new TransportEvent(this, type, validSent, 					      validUnsent, invalid, msg);	queueEvent(e, transportListeners);    }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区激情视频| 亚洲图片欧美色图| 欧美日韩另类一区| 国产一区二区三区在线观看精品 | 中文字幕的久久| 777欧美精品| 99久久精品免费看国产 | 99久久精品国产精品久久| 日韩高清一区在线| 一区二区三区欧美亚洲| 国产欧美精品在线观看| 欧美videos中文字幕| 欧美男同性恋视频网站| 91在线视频网址| 国产91清纯白嫩初高中在线观看 | 欧美成人精品高清在线播放| 91福利精品视频| 成人涩涩免费视频| 韩国理伦片一区二区三区在线播放 | 亚洲午夜久久久久中文字幕久| 国产午夜精品久久久久久免费视| 欧美一区2区视频在线观看| 一本久久a久久免费精品不卡| 国产很黄免费观看久久| 精品一区二区三区日韩| 日韩成人一级片| 日韩电影在线观看电影| 午夜欧美在线一二页| 亚洲综合久久av| 一区二区欧美精品| 亚洲人xxxx| 亚洲精品视频自拍| 亚洲欧美日韩综合aⅴ视频| 日本一区二区动态图| 久久婷婷国产综合国色天香| 日韩欧美一级在线播放| 欧美一区二区三区在线看| 在线综合视频播放| 欧美一区二区精品在线| 欧美一区二区三区不卡| 日韩一区二区在线看| 日韩精品综合一本久道在线视频| 91精品国产综合久久福利软件| 在线成人免费视频| 精品少妇一区二区三区免费观看| 日韩欧美一区在线| 日韩精品在线看片z| 久久综合国产精品| 日本一区二区三级电影在线观看 | 成人一区二区三区视频| 99麻豆久久久国产精品免费| 一本大道av伊人久久综合| 日本高清不卡视频| 欧美色男人天堂| 欧美一级二级在线观看| 欧美大片免费久久精品三p| 欧美精品一区二区三区在线播放| 欧美精品一区二区三区在线 | 99久久精品情趣| 色女孩综合影院| 欧美日韩国产综合一区二区| 在线观看91av| 国产人久久人人人人爽| 日韩美女视频19| 天堂午夜影视日韩欧美一区二区| 麻豆久久久久久| 国产成人精品三级麻豆| 91性感美女视频| 5858s免费视频成人| 国产日韩精品久久久| 一区二区三区蜜桃| 久久疯狂做爰流白浆xx| www.日本不卡| 制服丝袜亚洲网站| 国产欧美1区2区3区| 亚洲综合无码一区二区| 久久精品国产精品青草| 92精品国产成人观看免费| 欧美日韩国产首页在线观看| 久久青草欧美一区二区三区| 亚洲色大成网站www久久九九| 日韩av电影天堂| 99久久精品国产一区二区三区| 欧美久久一区二区| 中文字幕不卡在线观看| 亚洲一区精品在线| 国产99一区视频免费| 欧美四级电影在线观看| 国产婷婷色一区二区三区在线| 夜夜嗨av一区二区三区四季av| 精品中文字幕一区二区| 在线一区二区三区| 国产亚洲精品aa午夜观看| 一区二区三区欧美| 成人污视频在线观看| 欧美变态凌虐bdsm| 亚洲国产精品久久人人爱| 粉嫩13p一区二区三区| 欧美伦理影视网| 亚洲免费在线观看| 麻豆成人91精品二区三区| 欧美午夜寂寞影院| 国产精品无遮挡| 国内成人精品2018免费看| 欧美色手机在线观看| 欧美国产精品一区二区三区| 捆绑调教美女网站视频一区| 欧美亚洲国产一卡| 国产精品国产三级国产aⅴ入口 | 成人性生交大片免费看视频在线 | 欧美性猛交xxxxxxxx| 国产日产欧美一区二区三区| 丝袜诱惑亚洲看片| 色悠久久久久综合欧美99| 国产午夜精品美女毛片视频| 久久99在线观看| 欧美裸体bbwbbwbbw| 亚洲成人综合视频| 色视频成人在线观看免| 亚洲欧洲综合另类| heyzo一本久久综合| 国产亚洲精久久久久久| 精品中文av资源站在线观看| 欧美电影在线免费观看| 亚洲国产精品久久艾草纯爱| 在线看国产日韩| 亚洲精品日韩专区silk| aaa亚洲精品一二三区| 欧美激情在线一区二区| 国产精品综合一区二区三区| 久久一区二区视频| 国产在线一区观看| 久久一二三国产| 国产成a人亚洲精| 日本一区二区三区四区| 国产91精品免费| 欧美激情综合五月色丁香小说| 国产精品1区2区3区| 国产目拍亚洲精品99久久精品| 国产69精品久久99不卡| 国产农村妇女精品| jlzzjlzz亚洲女人18| 中文字幕日韩一区| 91一区一区三区| 一区二区免费视频| 欧美日本不卡视频| 国产午夜亚洲精品午夜鲁丝片| 国产一区二区h| 中文av字幕一区| 色综合一个色综合| 午夜成人免费电影| 日韩免费视频线观看| 国产馆精品极品| 亚洲免费在线观看| 91精品一区二区三区在线观看| 美日韩一区二区| 久久久综合九色合综国产精品| 成人视屏免费看| 亚洲成a人v欧美综合天堂下载| 欧美一区二区三区视频免费| 一本到三区不卡视频| 日韩影院免费视频| 久久久亚洲精华液精华液精华液| 成人综合激情网| 亚洲一区二区偷拍精品| 91精品国产一区二区人妖| 黄色日韩网站视频| 亚洲人精品一区| 日韩免费高清视频| 97se狠狠狠综合亚洲狠狠| 爽好久久久欧美精品| 久久久精品免费网站| 一本大道久久精品懂色aⅴ | 97久久超碰国产精品电影| 亚洲综合视频在线观看| 2023国产精品自拍| 日本高清视频一区二区| 狠狠色综合日日| 夜色激情一区二区| 国产三级欧美三级日产三级99| 91精品91久久久中77777| 毛片不卡一区二区| 一区二区三区高清在线| 精品福利视频一区二区三区| av亚洲精华国产精华精华| 日韩不卡一区二区| 国产精品久久久久国产精品日日 | 26uuu久久天堂性欧美| 色综合天天性综合| 韩国精品久久久| 亚洲午夜免费电影| 日本一区免费视频| 日韩精品中文字幕一区二区三区| 99久久er热在这里只有精品66| 美美哒免费高清在线观看视频一区二区| 国产精品久久三区| 精品成人a区在线观看| 欧美精品777| 91美女片黄在线观看91美女| 国产在线播放一区二区三区|