Subversion Repositories javautils

Rev

Blame | Last modification | View Log | RSS feed

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <!--NewPage-->
  3. <HTML>
  4. <HEAD>
  5. <!-- Generated by javadoc (build 1.6.0_10) on Tue Nov 17 12:13:38 PST 2009 -->
  6. <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  7. <TITLE>
  8. Service (JavaMail API documentation)
  9. </TITLE>
  10.  
  11. <META NAME="date" CONTENT="2009-11-17">
  12.  
  13. <LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
  14.  
  15. <SCRIPT type="text/javascript">
  16. function windowTitle()
  17. {
  18.     if (location.href.indexOf('is-external=true') == -1) {
  19.         parent.document.title="Service (JavaMail API documentation)";
  20.     }
  21. }
  22. </SCRIPT>
  23. <NOSCRIPT>
  24. </NOSCRIPT>
  25.  
  26. </HEAD>
  27.  
  28. <BODY BGCOLOR="white" onload="windowTitle();">
  29. <HR>
  30.  
  31.  
  32. <!-- ========= START OF TOP NAVBAR ======= -->
  33. <A NAME="navbar_top"><!-- --></A>
  34. <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
  35. <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
  36. <TR>
  37. <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
  38. <A NAME="navbar_top_firstrow"><!-- --></A>
  39. <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  40.   <TR ALIGN="center" VALIGN="top">
  41.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  42.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  43.   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  44.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Service.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  45.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  46.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  47.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  48.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  49.   </TR>
  50. </TABLE>
  51. </TD>
  52. <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
  53. </EM>
  54. </TD>
  55. </TR>
  56.  
  57. <TR>
  58. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  59. &nbsp;<A HREF="../../javax/mail/SendFailedException.html" title="class in javax.mail"><B>PREV CLASS</B></A>&nbsp;
  60. &nbsp;<A HREF="../../javax/mail/Session.html" title="class in javax.mail"><B>NEXT CLASS</B></A></FONT></TD>
  61. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  62.   <A HREF="../../index.html?javax/mail/Service.html" target="_top"><B>FRAMES</B></A>  &nbsp;
  63. &nbsp;<A HREF="Service.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
  64. &nbsp;<SCRIPT type="text/javascript">
  65.   <!--
  66.   if(window==top) {
  67.     document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
  68.   }
  69.   //-->
  70. </SCRIPT>
  71. <NOSCRIPT>
  72.   <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
  73. </NOSCRIPT>
  74.  
  75.  
  76. </FONT></TD>
  77. </TR>
  78. <TR>
  79. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  80.   SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
  81. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  82. DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
  83. </TR>
  84. </TABLE>
  85. <A NAME="skip-navbar_top"></A>
  86. <!-- ========= END OF TOP NAVBAR ========= -->
  87.  
  88. <HR>
  89. <!-- ======== START OF CLASS DATA ======== -->
  90. <H2>
  91. <FONT SIZE="-1">
  92. javax.mail</FONT>
  93. <BR>
  94. Class Service</H2>
  95. <PRE>
  96. <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
  97.   <IMG SRC="../../resources/inherit.gif" ALT="extended by "><B>javax.mail.Service</B>
  98. </PRE>
  99. <DL>
  100. <DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../javax/mail/Store.html" title="class in javax.mail">Store</A>, <A HREF="../../javax/mail/Transport.html" title="class in javax.mail">Transport</A></DD>
  101. </DL>
  102. <HR>
  103. <DL>
  104. <DT><PRE>public abstract class <B>Service</B><DT>extends <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
  105. </PRE>
  106.  
  107. <P>
  108. An abstract class that contains the functionality
  109.  common to messaging services, such as stores and transports. <p>
  110.  A messaging service is created from a <code>Session</code> and is
  111.  named using a <code>URLName</code>.  A service must be connected
  112.  before it can be used.  Connection events are sent to reflect
  113.  its connection status.
  114. <P>
  115.  
  116. <P>
  117. <HR>
  118.  
  119. <P>
  120. <!-- =========== FIELD SUMMARY =========== -->
  121.  
  122. <A NAME="field_summary"><!-- --></A>
  123. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  124. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  125. <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
  126. <B>Field Summary</B></FONT></TH>
  127. </TR>
  128. <TR BGCOLOR="white" CLASS="TableRowColor">
  129. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  130. <CODE>protected &nbsp;boolean</CODE></FONT></TD>
  131. <TD><CODE><B><A HREF="../../javax/mail/Service.html#debug">debug</A></B></CODE>
  132.  
  133. <BR>
  134. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Debug flag for this service.</TD>
  135. </TR>
  136. <TR BGCOLOR="white" CLASS="TableRowColor">
  137. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  138. <CODE>protected &nbsp;<A HREF="../../javax/mail/Session.html" title="class in javax.mail">Session</A></CODE></FONT></TD>
  139. <TD><CODE><B><A HREF="../../javax/mail/Service.html#session">session</A></B></CODE>
  140.  
  141. <BR>
  142. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The session from which this service was created.</TD>
  143. </TR>
  144. <TR BGCOLOR="white" CLASS="TableRowColor">
  145. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  146. <CODE>protected &nbsp;<A HREF="../../javax/mail/URLName.html" title="class in javax.mail">URLName</A></CODE></FONT></TD>
  147. <TD><CODE><B><A HREF="../../javax/mail/Service.html#url">url</A></B></CODE>
  148.  
  149. <BR>
  150. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The <code>URLName</code> of this service.</TD>
  151. </TR>
  152. </TABLE>
  153. &nbsp;
  154. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  155.  
  156. <A NAME="constructor_summary"><!-- --></A>
  157. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  158. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  159. <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
  160. <B>Constructor Summary</B></FONT></TH>
  161. </TR>
  162. <TR BGCOLOR="white" CLASS="TableRowColor">
  163. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  164. <CODE>protected </CODE></FONT></TD>
  165. <TD><CODE><B><A HREF="../../javax/mail/Service.html#Service(javax.mail.Session, javax.mail.URLName)">Service</A></B>(<A HREF="../../javax/mail/Session.html" title="class in javax.mail">Session</A>&nbsp;session,
  166.         <A HREF="../../javax/mail/URLName.html" title="class in javax.mail">URLName</A>&nbsp;urlname)</CODE>
  167.  
  168. <BR>
  169. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructor.</TD>
  170. </TR>
  171. </TABLE>
  172. &nbsp;
  173. <!-- ========== METHOD SUMMARY =========== -->
  174.  
  175. <A NAME="method_summary"><!-- --></A>
  176. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  177. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  178. <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
  179. <B>Method Summary</B></FONT></TH>
  180. </TR>
  181. <TR BGCOLOR="white" CLASS="TableRowColor">
  182. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  183. <CODE>&nbsp;void</CODE></FONT></TD>
  184. <TD><CODE><B><A HREF="../../javax/mail/Service.html#addConnectionListener(javax.mail.event.ConnectionListener)">addConnectionListener</A></B>(<A HREF="../../javax/mail/event/ConnectionListener.html" title="interface in javax.mail.event">ConnectionListener</A>&nbsp;l)</CODE>
  185.  
  186. <BR>
  187. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Add a listener for Connection events on this service.</TD>
  188. </TR>
  189. <TR BGCOLOR="white" CLASS="TableRowColor">
  190. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  191. <CODE>&nbsp;void</CODE></FONT></TD>
  192. <TD><CODE><B><A HREF="../../javax/mail/Service.html#close()">close</A></B>()</CODE>
  193.  
  194. <BR>
  195. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Close this service and terminate its connection.</TD>
  196. </TR>
  197. <TR BGCOLOR="white" CLASS="TableRowColor">
  198. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  199. <CODE>&nbsp;void</CODE></FONT></TD>
  200. <TD><CODE><B><A HREF="../../javax/mail/Service.html#connect()">connect</A></B>()</CODE>
  201.  
  202. <BR>
  203. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A generic connect method that takes no parameters.</TD>
  204. </TR>
  205. <TR BGCOLOR="white" CLASS="TableRowColor">
  206. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  207. <CODE>&nbsp;void</CODE></FONT></TD>
  208. <TD><CODE><B><A HREF="../../javax/mail/Service.html#connect(java.lang.String, int, java.lang.String, java.lang.String)">connect</A></B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;host,
  209.         int&nbsp;port,
  210.         <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;user,
  211.         <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;password)</CODE>
  212.  
  213. <BR>
  214. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Similar to connect(host, user, password) except a specific port
  215.  can be specified.</TD>
  216. </TR>
  217. <TR BGCOLOR="white" CLASS="TableRowColor">
  218. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  219. <CODE>&nbsp;void</CODE></FONT></TD>
  220. <TD><CODE><B><A HREF="../../javax/mail/Service.html#connect(java.lang.String, java.lang.String)">connect</A></B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;user,
  221.         <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;password)</CODE>
  222.  
  223. <BR>
  224. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Connect to the current host using the specified username
  225.  and password.</TD>
  226. </TR>
  227. <TR BGCOLOR="white" CLASS="TableRowColor">
  228. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  229. <CODE>&nbsp;void</CODE></FONT></TD>
  230. <TD><CODE><B><A HREF="../../javax/mail/Service.html#connect(java.lang.String, java.lang.String, java.lang.String)">connect</A></B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;host,
  231.         <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;user,
  232.         <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;password)</CODE>
  233.  
  234. <BR>
  235. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Connect to the specified address.</TD>
  236. </TR>
  237. <TR BGCOLOR="white" CLASS="TableRowColor">
  238. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  239. <CODE>protected &nbsp;void</CODE></FONT></TD>
  240. <TD><CODE><B><A HREF="../../javax/mail/Service.html#finalize()">finalize</A></B>()</CODE>
  241.  
  242. <BR>
  243. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Stop the event dispatcher thread so the queue can be garbage collected.</TD>
  244. </TR>
  245. <TR BGCOLOR="white" CLASS="TableRowColor">
  246. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  247. <CODE>&nbsp;<A HREF="../../javax/mail/URLName.html" title="class in javax.mail">URLName</A></CODE></FONT></TD>
  248. <TD><CODE><B><A HREF="../../javax/mail/Service.html#getURLName()">getURLName</A></B>()</CODE>
  249.  
  250. <BR>
  251. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return a URLName representing this service.</TD>
  252. </TR>
  253. <TR BGCOLOR="white" CLASS="TableRowColor">
  254. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  255. <CODE>&nbsp;boolean</CODE></FONT></TD>
  256. <TD><CODE><B><A HREF="../../javax/mail/Service.html#isConnected()">isConnected</A></B>()</CODE>
  257.  
  258. <BR>
  259. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Is this service currently connected?</TD>
  260. </TR>
  261. <TR BGCOLOR="white" CLASS="TableRowColor">
  262. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  263. <CODE>protected &nbsp;void</CODE></FONT></TD>
  264. <TD><CODE><B><A HREF="../../javax/mail/Service.html#notifyConnectionListeners(int)">notifyConnectionListeners</A></B>(int&nbsp;type)</CODE>
  265.  
  266. <BR>
  267. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Notify all ConnectionListeners.</TD>
  268. </TR>
  269. <TR BGCOLOR="white" CLASS="TableRowColor">
  270. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  271. <CODE>protected &nbsp;boolean</CODE></FONT></TD>
  272. <TD><CODE><B><A HREF="../../javax/mail/Service.html#protocolConnect(java.lang.String, int, java.lang.String, java.lang.String)">protocolConnect</A></B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;host,
  273.                 int&nbsp;port,
  274.                 <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;user,
  275.                 <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;password)</CODE>
  276.  
  277. <BR>
  278. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The service implementation should override this method to
  279.  perform the actual protocol-specific connection attempt.</TD>
  280. </TR>
  281. <TR BGCOLOR="white" CLASS="TableRowColor">
  282. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  283. <CODE>protected &nbsp;void</CODE></FONT></TD>
  284. <TD><CODE><B><A HREF="../../javax/mail/Service.html#queueEvent(javax.mail.event.MailEvent, java.util.Vector)">queueEvent</A></B>(<A HREF="../../javax/mail/event/MailEvent.html" title="class in javax.mail.event">MailEvent</A>&nbsp;event,
  285.            <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/util/Vector.html?is-external=true" title="class or interface in java.util">Vector</A>&nbsp;vector)</CODE>
  286.  
  287. <BR>
  288. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Add the event and vector of listeners to the queue to be delivered.</TD>
  289. </TR>
  290. <TR BGCOLOR="white" CLASS="TableRowColor">
  291. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  292. <CODE>&nbsp;void</CODE></FONT></TD>
  293. <TD><CODE><B><A HREF="../../javax/mail/Service.html#removeConnectionListener(javax.mail.event.ConnectionListener)">removeConnectionListener</A></B>(<A HREF="../../javax/mail/event/ConnectionListener.html" title="interface in javax.mail.event">ConnectionListener</A>&nbsp;l)</CODE>
  294.  
  295. <BR>
  296. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Remove a Connection event listener.</TD>
  297. </TR>
  298. <TR BGCOLOR="white" CLASS="TableRowColor">
  299. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  300. <CODE>protected &nbsp;void</CODE></FONT></TD>
  301. <TD><CODE><B><A HREF="../../javax/mail/Service.html#setConnected(boolean)">setConnected</A></B>(boolean&nbsp;connected)</CODE>
  302.  
  303. <BR>
  304. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the connection state of this service.</TD>
  305. </TR>
  306. <TR BGCOLOR="white" CLASS="TableRowColor">
  307. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  308. <CODE>protected &nbsp;void</CODE></FONT></TD>
  309. <TD><CODE><B><A HREF="../../javax/mail/Service.html#setURLName(javax.mail.URLName)">setURLName</A></B>(<A HREF="../../javax/mail/URLName.html" title="class in javax.mail">URLName</A>&nbsp;url)</CODE>
  310.  
  311. <BR>
  312. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the URLName representing this service.</TD>
  313. </TR>
  314. <TR BGCOLOR="white" CLASS="TableRowColor">
  315. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  316. <CODE>&nbsp;<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
  317. <TD><CODE><B><A HREF="../../javax/mail/Service.html#toString()">toString</A></B>()</CODE>
  318.  
  319. <BR>
  320. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return <code>getURLName.toString()</code> if this service has a URLName,
  321.  otherwise it will return the default <code>toString</code>.</TD>
  322. </TR>
  323. </TABLE>
  324. &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
  325. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  326. <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
  327. <TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
  328. </TR>
  329. <TR BGCOLOR="white" CLASS="TableRowColor">
  330. <TD><CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
  331. </TR>
  332. </TABLE>
  333. &nbsp;
  334. <P>
  335.  
  336. <!-- ============ FIELD DETAIL =========== -->
  337.  
  338. <A NAME="field_detail"><!-- --></A>
  339. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  340. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  341. <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
  342. <B>Field Detail</B></FONT></TH>
  343. </TR>
  344. </TABLE>
  345.  
  346. <A NAME="session"><!-- --></A><H3>
  347. session</H3>
  348. <PRE>
  349. protected <A HREF="../../javax/mail/Session.html" title="class in javax.mail">Session</A> <B>session</B></PRE>
  350. <DL>
  351. <DD>The session from which this service was created.
  352. <P>
  353. <DL>
  354. </DL>
  355. </DL>
  356. <HR>
  357.  
  358. <A NAME="url"><!-- --></A><H3>
  359. url</H3>
  360. <PRE>
  361. protected <A HREF="../../javax/mail/URLName.html" title="class in javax.mail">URLName</A> <B>url</B></PRE>
  362. <DL>
  363. <DD>The <code>URLName</code> of this service.
  364. <P>
  365. <DL>
  366. </DL>
  367. </DL>
  368. <HR>
  369.  
  370. <A NAME="debug"><!-- --></A><H3>
  371. debug</H3>
  372. <PRE>
  373. protected boolean <B>debug</B></PRE>
  374. <DL>
  375. <DD>Debug flag for this service.  Set from the session's debug
  376. flag when this service is created.
  377. <P>
  378. <DL>
  379. </DL>
  380. </DL>
  381.  
  382. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  383.  
  384. <A NAME="constructor_detail"><!-- --></A>
  385. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  386. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  387. <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
  388. <B>Constructor Detail</B></FONT></TH>
  389. </TR>
  390. </TABLE>
  391.  
  392. <A NAME="Service(javax.mail.Session, javax.mail.URLName)"><!-- --></A><H3>
  393. Service</H3>
  394. <PRE>
  395. protected <B>Service</B>(<A HREF="../../javax/mail/Session.html" title="class in javax.mail">Session</A>&nbsp;session,
  396.                  <A HREF="../../javax/mail/URLName.html" title="class in javax.mail">URLName</A>&nbsp;urlname)</PRE>
  397. <DL>
  398. <DD>Constructor.
  399. <P>
  400. <DL>
  401. <DT><B>Parameters:</B><DD><CODE>session</CODE> - Session object for this service<DD><CODE>urlname</CODE> - URLName object to be used for this service</DL>
  402. </DL>
  403.  
  404. <!-- ============ METHOD DETAIL ========== -->
  405.  
  406. <A NAME="method_detail"><!-- --></A>
  407. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  408. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  409. <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
  410. <B>Method Detail</B></FONT></TH>
  411. </TR>
  412. </TABLE>
  413.  
  414. <A NAME="connect()"><!-- --></A><H3>
  415. connect</H3>
  416. <PRE>
  417. public void <B>connect</B>()
  418.             throws <A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
  419. <DL>
  420. <DD>A generic connect method that takes no parameters. Subclasses
  421. can implement the appropriate authentication schemes. Subclasses
  422. that need additional information might want to use some properties
  423. or might get it interactively using a popup window. <p>
  424.  
  425. If the connection is successful, an "open" <code>ConnectionEvent</code>
  426. is delivered to any <code>ConnectionListeners</code> on this service. <p>
  427.  
  428. Most clients should just call this method to connect to the service.<p>
  429.  
  430. It is an error to connect to an already connected service. <p>
  431.  
  432. The implementation provided here simply calls the following
  433. <code>connect(String, String, String)</code> method with nulls.
  434. <P>
  435. <DD><DL>
  436.  
  437. <DT><B>Throws:</B>
  438. <DD><CODE><A HREF="../../javax/mail/AuthenticationFailedException.html" title="class in javax.mail">AuthenticationFailedException</A></CODE> - for authentication failures
  439. <DD><CODE><A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE> - for other failures
  440. <DD><CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the service is already connected<DT><B>See Also:</B><DD><A HREF="../../javax/mail/event/ConnectionEvent.html" title="class in javax.mail.event"><CODE>ConnectionEvent</CODE></A></DL>
  441. </DD>
  442. </DL>
  443. <HR>
  444.  
  445. <A NAME="connect(java.lang.String, java.lang.String, java.lang.String)"><!-- --></A><H3>
  446. connect</H3>
  447. <PRE>
  448. public void <B>connect</B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;host,
  449.                    <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;user,
  450.                    <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;password)
  451.             throws <A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
  452. <DL>
  453. <DD>Connect to the specified address. This method provides a simple
  454. authentication scheme that requires a username and password. <p>
  455.  
  456. If the connection is successful, an "open" <code>ConnectionEvent</code>
  457. is delivered to any <code>ConnectionListeners</code> on this service. <p>
  458.  
  459. It is an error to connect to an already connected service. <p>
  460.  
  461. The implementation in the Service class will collect defaults
  462. for the host, user, and password from the session, from the
  463. <code>URLName</code> for this service, and from the supplied
  464. parameters and then call the <code>protocolConnect</code> method.
  465. If the <code>protocolConnect</code> method returns <code>false</code>,
  466. the user will be prompted for any missing information and the
  467. <code>protocolConnect</code> method will be called again.  The
  468. subclass should override the <code>protocolConnect</code> method.
  469. The subclass should also implement the <code>getURLName</code>
  470. method, or use the implementation in this class. <p>
  471.  
  472. On a successful connection, the <code>setURLName</code> method is
  473. called with a URLName that includes the information used to make
  474. the connection, including the password. <p>
  475.  
  476. If the username passed in is null, a default value will be chosen
  477. as described above.
  478.  
  479. If the password passed in is null and this is the first successful
  480. connection to this service, the user name and the password
  481. collected from the user will be saved as defaults for subsequent
  482. connection attempts to this same service when using other Service object
  483. instances (the connection information is typically always saved within
  484. a particular Service object instance).  The password is saved using the
  485. Session method <code>setPasswordAuthentication</code>.  If the
  486. password passed in is not null, it is not saved, on the assumption
  487. that the application is managing passwords explicitly.
  488. <P>
  489. <DD><DL>
  490. <DT><B>Parameters:</B><DD><CODE>host</CODE> - the host to connect to<DD><CODE>user</CODE> - the user name<DD><CODE>password</CODE> - this user's password
  491. <DT><B>Throws:</B>
  492. <DD><CODE><A HREF="../../javax/mail/AuthenticationFailedException.html" title="class in javax.mail">AuthenticationFailedException</A></CODE> - for authentication failures
  493. <DD><CODE><A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE> - for other failures
  494. <DD><CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the service is already connected<DT><B>See Also:</B><DD><A HREF="../../javax/mail/event/ConnectionEvent.html" title="class in javax.mail.event"><CODE>ConnectionEvent</CODE></A>,
  495. <A HREF="../../javax/mail/Session.html#setPasswordAuthentication(javax.mail.URLName, javax.mail.PasswordAuthentication)"><CODE>Session.setPasswordAuthentication(javax.mail.URLName, javax.mail.PasswordAuthentication)</CODE></A></DL>
  496. </DD>
  497. </DL>
  498. <HR>
  499.  
  500. <A NAME="connect(java.lang.String, java.lang.String)"><!-- --></A><H3>
  501. connect</H3>
  502. <PRE>
  503. public void <B>connect</B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;user,
  504.                     <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;password)
  505.              throws <A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
  506. <DL>
  507. <DD>Connect to the current host using the specified username
  508.  and password.  This method is equivalent to calling the
  509.  <code>connect(host, user, password)</code> method with null
  510.  for the host name.
  511. <P>
  512. <DD><DL>
  513. <DT><B>Parameters:</B><DD><CODE>user</CODE> - the user name<DD><CODE>password</CODE> - this user's password
  514. <DT><B>Throws:</B>
  515. <DD><CODE><A HREF="../../javax/mail/AuthenticationFailedException.html" title="class in javax.mail">AuthenticationFailedException</A></CODE> - for authentication failures
  516. <DD><CODE><A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE> - for other failures
  517. <DD><CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the service is already connected<DT><B>Since:</B></DT>
  518.  <DD>JavaMail 1.4</DD>
  519. <DT><B>See Also:</B><DD><A HREF="../../javax/mail/event/ConnectionEvent.html" title="class in javax.mail.event"><CODE>ConnectionEvent</CODE></A>,
  520. <A HREF="../../javax/mail/Session.html#setPasswordAuthentication(javax.mail.URLName, javax.mail.PasswordAuthentication)"><CODE>Session.setPasswordAuthentication(javax.mail.URLName, javax.mail.PasswordAuthentication)</CODE></A>,
  521. <A HREF="../../javax/mail/Service.html#connect(java.lang.String, java.lang.String, java.lang.String)"><CODE>connect(java.lang.String, java.lang.String, java.lang.String)</CODE></A></DL>
  522. </DD>
  523. </DL>
  524. <HR>
  525.  
  526. <A NAME="connect(java.lang.String, int, java.lang.String, java.lang.String)"><!-- --></A><H3>
  527. connect</H3>
  528. <PRE>
  529. public void <B>connect</B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;host,
  530.                    int&nbsp;port,
  531.                    <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;user,
  532.                    <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;password)
  533.             throws <A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
  534. <DL>
  535. <DD>Similar to connect(host, user, password) except a specific port
  536. can be specified.
  537. <P>
  538. <DD><DL>
  539. <DT><B>Parameters:</B><DD><CODE>host</CODE> - the host to connect to<DD><CODE>port</CODE> - the port to connect to (-1 means the default port)<DD><CODE>user</CODE> - the user name<DD><CODE>password</CODE> - this user's password
  540. <DT><B>Throws:</B>
  541. <DD><CODE><A HREF="../../javax/mail/AuthenticationFailedException.html" title="class in javax.mail">AuthenticationFailedException</A></CODE> - for authentication failures
  542. <DD><CODE><A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE> - for other failures
  543. <DD><CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the service is already connected<DT><B>See Also:</B><DD><A HREF="../../javax/mail/Service.html#connect(java.lang.String, java.lang.String, java.lang.String)"><CODE>connect(java.lang.String, java.lang.String, java.lang.String)</CODE></A>,
  544. <A HREF="../../javax/mail/event/ConnectionEvent.html" title="class in javax.mail.event"><CODE>ConnectionEvent</CODE></A></DL>
  545. </DD>
  546. </DL>
  547. <HR>
  548.  
  549. <A NAME="protocolConnect(java.lang.String, int, java.lang.String, java.lang.String)"><!-- --></A><H3>
  550. protocolConnect</H3>
  551. <PRE>
  552. protected boolean <B>protocolConnect</B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;host,
  553.                                   int&nbsp;port,
  554.                                   <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;user,
  555.                                   <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;password)
  556.                            throws <A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
  557. <DL>
  558. <DD>The service implementation should override this method to
  559.  perform the actual protocol-specific connection attempt.
  560.  The default implementation of the <code>connect</code> method
  561.  calls this method as needed. <p>
  562.  
  563.  The <code>protocolConnect</code> method should return
  564.  <code>false</code> if a user name or password is required
  565.  for authentication but the corresponding parameter is null;
  566.  the <code>connect</code> method will prompt the user when
  567.  needed to supply missing information.  This method may
  568.  also return <code>false</code> if authentication fails for
  569.  the supplied user name or password.  Alternatively, this method
  570.  may throw an AuthenticationFailedException when authentication
  571.  fails.  This exception may include a String message with more
  572.  detail about the failure. <p>
  573.  
  574.  The <code>protocolConnect</code> method should throw an
  575.  exception to report failures not related to authentication,
  576.  such as an invalid host name or port number, loss of a
  577.  connection during the authentication process, unavailability
  578.  of the server, etc.
  579. <P>
  580. <DD><DL>
  581. <DT><B>Parameters:</B><DD><CODE>host</CODE> - the name of the host to connect to<DD><CODE>port</CODE> - the port to use (-1 means use default port)<DD><CODE>user</CODE> - the name of the user to login as<DD><CODE>password</CODE> - the user's password
  582. <DT><B>Returns:</B><DD>true if connection successful, false if authentication failed
  583. <DT><B>Throws:</B>
  584. <DD><CODE><A HREF="../../javax/mail/AuthenticationFailedException.html" title="class in javax.mail">AuthenticationFailedException</A></CODE> - for authentication failures
  585. <DD><CODE><A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE> - for non-authentication failures</DL>
  586. </DD>
  587. </DL>
  588. <HR>
  589.  
  590. <A NAME="isConnected()"><!-- --></A><H3>
  591. isConnected</H3>
  592. <PRE>
  593. public boolean <B>isConnected</B>()</PRE>
  594. <DL>
  595. <DD>Is this service currently connected? <p>
  596.  
  597. This implementation uses a private boolean field to
  598. store the connection state. This method returns the value
  599. of that field. <p>
  600.  
  601. Subclasses may want to override this method to verify that any
  602. connection to the message store is still alive.
  603. <P>
  604. <DD><DL>
  605.  
  606. <DT><B>Returns:</B><DD>true if the service is connected, false if it is not connected</DL>
  607. </DD>
  608. </DL>
  609. <HR>
  610.  
  611. <A NAME="setConnected(boolean)"><!-- --></A><H3>
  612. setConnected</H3>
  613. <PRE>
  614. protected void <B>setConnected</B>(boolean&nbsp;connected)</PRE>
  615. <DL>
  616. <DD>Set the connection state of this service.  The connection state
  617. will automatically be set by the service implementation during the
  618. <code>connect</code> and <code>close</code> methods.
  619. Subclasses will need to call this method to set the state
  620. if the service was automatically disconnected. <p>
  621.  
  622. The implementation in this class merely sets the private field
  623. returned by the <code>isConnected</code> method.
  624. <P>
  625. <DD><DL>
  626. <DT><B>Parameters:</B><DD><CODE>connected</CODE> - true if the service is connected,
  627.                  false if it is not connected</DL>
  628. </DD>
  629. </DL>
  630. <HR>
  631.  
  632. <A NAME="close()"><!-- --></A><H3>
  633. close</H3>
  634. <PRE>
  635. public void <B>close</B>()
  636.           throws <A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
  637. <DL>
  638. <DD>Close this service and terminate its connection. A close
  639. ConnectionEvent is delivered to any ConnectionListeners. Any
  640. Messaging components (Folders, Messages, etc.) belonging to this
  641. service are invalid after this service is closed. Note that the service
  642. is closed even if this method terminates abnormally by throwing
  643. a MessagingException. <p>
  644.  
  645. This implementation uses <code>setConnected(false)</code> to set
  646. this service's connected state to <code>false</code>. It will then
  647.  send a close ConnectionEvent to any registered ConnectionListeners.
  648.  Subclasses overriding this method to do implementation specific
  649.  cleanup should call this method as a last step to insure event
  650.  notification, probably by including a call to <code>super.close()</code>
  651.  in a <code>finally</code> clause.
  652. <P>
  653. <DD><DL>
  654.  
  655. <DT><B>Throws:</B>
  656. <DD><CODE><A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE> - for errors while closing<DT><B>See Also:</B><DD><A HREF="../../javax/mail/event/ConnectionEvent.html" title="class in javax.mail.event"><CODE>ConnectionEvent</CODE></A></DL>
  657. </DD>
  658. </DL>
  659. <HR>
  660.  
  661. <A NAME="getURLName()"><!-- --></A><H3>
  662. getURLName</H3>
  663. <PRE>
  664. public <A HREF="../../javax/mail/URLName.html" title="class in javax.mail">URLName</A> <B>getURLName</B>()</PRE>
  665. <DL>
  666. <DD>Return a URLName representing this service.  The returned URLName
  667.  does <em>not</em> include the password field.  <p>
  668.  
  669.  Subclasses should only override this method if their
  670.  URLName does not follow the standard format. <p>
  671.  
  672.  The implementation in the Service class returns (usually a copy of)
  673.  the <code>url</code> field with the password and file information
  674.  stripped out.
  675. <P>
  676. <DD><DL>
  677.  
  678. <DT><B>Returns:</B><DD>the URLName representing this service<DT><B>See Also:</B><DD><A HREF="../../javax/mail/URLName.html" title="class in javax.mail"><CODE>URLName</CODE></A></DL>
  679. </DD>
  680. </DL>
  681. <HR>
  682.  
  683. <A NAME="setURLName(javax.mail.URLName)"><!-- --></A><H3>
  684. setURLName</H3>
  685. <PRE>
  686. protected void <B>setURLName</B>(<A HREF="../../javax/mail/URLName.html" title="class in javax.mail">URLName</A>&nbsp;url)</PRE>
  687. <DL>
  688. <DD>Set the URLName representing this service.
  689.  Normally used to update the <code>url</code> field
  690.  after a service has successfully connected. <p>
  691.  
  692.  Subclasses should only override this method if their
  693.  URL does not follow the standard format.  In particular,
  694.  subclasses should override this method if their URL
  695.  does not require all the possible fields supported by
  696.  <code>URLName</code>; a new <code>URLName</code> should
  697.  be constructed with any unneeded fields removed. <p>
  698.  
  699.  The implementation in the Service class simply sets the
  700.  <code>url</code> field.
  701. <P>
  702. <DD><DL>
  703. <DT><B>See Also:</B><DD><A HREF="../../javax/mail/URLName.html" title="class in javax.mail"><CODE>URLName</CODE></A></DL>
  704. </DD>
  705. </DL>
  706. <HR>
  707.  
  708. <A NAME="addConnectionListener(javax.mail.event.ConnectionListener)"><!-- --></A><H3>
  709. addConnectionListener</H3>
  710. <PRE>
  711. public void <B>addConnectionListener</B>(<A HREF="../../javax/mail/event/ConnectionListener.html" title="interface in javax.mail.event">ConnectionListener</A>&nbsp;l)</PRE>
  712. <DL>
  713. <DD>Add a listener for Connection events on this service. <p>
  714.  
  715.  The default implementation provided here adds this listener
  716.  to an internal list of ConnectionListeners.
  717. <P>
  718. <DD><DL>
  719. <DT><B>Parameters:</B><DD><CODE>l</CODE> - the Listener for Connection events<DT><B>See Also:</B><DD><A HREF="../../javax/mail/event/ConnectionEvent.html" title="class in javax.mail.event"><CODE>ConnectionEvent</CODE></A></DL>
  720. </DD>
  721. </DL>
  722. <HR>
  723.  
  724. <A NAME="removeConnectionListener(javax.mail.event.ConnectionListener)"><!-- --></A><H3>
  725. removeConnectionListener</H3>
  726. <PRE>
  727. public void <B>removeConnectionListener</B>(<A HREF="../../javax/mail/event/ConnectionListener.html" title="interface in javax.mail.event">ConnectionListener</A>&nbsp;l)</PRE>
  728. <DL>
  729. <DD>Remove a Connection event listener. <p>
  730.  
  731.  The default implementation provided here removes this listener
  732.  from the internal list of ConnectionListeners.
  733. <P>
  734. <DD><DL>
  735. <DT><B>Parameters:</B><DD><CODE>l</CODE> - the listener<DT><B>See Also:</B><DD><A HREF="../../javax/mail/Service.html#addConnectionListener(javax.mail.event.ConnectionListener)"><CODE>addConnectionListener(javax.mail.event.ConnectionListener)</CODE></A></DL>
  736. </DD>
  737. </DL>
  738. <HR>
  739.  
  740. <A NAME="notifyConnectionListeners(int)"><!-- --></A><H3>
  741. notifyConnectionListeners</H3>
  742. <PRE>
  743. protected void <B>notifyConnectionListeners</B>(int&nbsp;type)</PRE>
  744. <DL>
  745. <DD>Notify all ConnectionListeners. Service implementations are
  746.  expected to use this method to broadcast connection events. <p>
  747.  
  748.  The provided default implementation queues the event into
  749.  an internal event queue. An event dispatcher thread dequeues
  750.  events from the queue and dispatches them to the registered
  751.  ConnectionListeners. Note that the event dispatching occurs
  752.  in a separate thread, thus avoiding potential deadlock problems.
  753. <P>
  754. <DD><DL>
  755. </DL>
  756. </DD>
  757. </DL>
  758. <HR>
  759.  
  760. <A NAME="toString()"><!-- --></A><H3>
  761. toString</H3>
  762. <PRE>
  763. public <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>toString</B>()</PRE>
  764. <DL>
  765. <DD>Return <code>getURLName.toString()</code> if this service has a URLName,
  766.  otherwise it will return the default <code>toString</code>.
  767. <P>
  768. <DD><DL>
  769. <DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A></CODE> in class <CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></DL>
  770. </DD>
  771. <DD><DL>
  772. </DL>
  773. </DD>
  774. </DL>
  775. <HR>
  776.  
  777. <A NAME="queueEvent(javax.mail.event.MailEvent, java.util.Vector)"><!-- --></A><H3>
  778. queueEvent</H3>
  779. <PRE>
  780. protected void <B>queueEvent</B>(<A HREF="../../javax/mail/event/MailEvent.html" title="class in javax.mail.event">MailEvent</A>&nbsp;event,
  781.                           <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/util/Vector.html?is-external=true" title="class or interface in java.util">Vector</A>&nbsp;vector)</PRE>
  782. <DL>
  783. <DD>Add the event and vector of listeners to the queue to be delivered.
  784. <P>
  785. <DD><DL>
  786. </DL>
  787. </DD>
  788. </DL>
  789. <HR>
  790.  
  791. <A NAME="finalize()"><!-- --></A><H3>
  792. finalize</H3>
  793. <PRE>
  794. protected void <B>finalize</B>()
  795.                  throws <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Throwable.html?is-external=true" title="class or interface in java.lang">Throwable</A></PRE>
  796. <DL>
  797. <DD>Stop the event dispatcher thread so the queue can be garbage collected.
  798. <P>
  799. <DD><DL>
  800. <DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A></CODE> in class <CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></DL>
  801. </DD>
  802. <DD><DL>
  803.  
  804. <DT><B>Throws:</B>
  805. <DD><CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Throwable.html?is-external=true" title="class or interface in java.lang">Throwable</A></CODE></DL>
  806. </DD>
  807. </DL>
  808. <!-- ========= END OF CLASS DATA ========= -->
  809. <HR>
  810.  
  811.  
  812. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  813. <A NAME="navbar_bottom"><!-- --></A>
  814. <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
  815. <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
  816. <TR>
  817. <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
  818. <A NAME="navbar_bottom_firstrow"><!-- --></A>
  819. <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  820.   <TR ALIGN="center" VALIGN="top">
  821.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  822.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  823.   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  824.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Service.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  825.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  826.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  827.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  828.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  829.   </TR>
  830. </TABLE>
  831. </TD>
  832. <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
  833. </EM>
  834. </TD>
  835. </TR>
  836.  
  837. <TR>
  838. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  839. &nbsp;<A HREF="../../javax/mail/SendFailedException.html" title="class in javax.mail"><B>PREV CLASS</B></A>&nbsp;
  840. &nbsp;<A HREF="../../javax/mail/Session.html" title="class in javax.mail"><B>NEXT CLASS</B></A></FONT></TD>
  841. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  842.   <A HREF="../../index.html?javax/mail/Service.html" target="_top"><B>FRAMES</B></A>  &nbsp;
  843. &nbsp;<A HREF="Service.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
  844. &nbsp;<SCRIPT type="text/javascript">
  845.   <!--
  846.   if(window==top) {
  847.     document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
  848.   }
  849.   //-->
  850. </SCRIPT>
  851. <NOSCRIPT>
  852.   <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
  853. </NOSCRIPT>
  854.  
  855.  
  856. </FONT></TD>
  857. </TR>
  858. <TR>
  859. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  860.   SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
  861. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  862. DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
  863. </TR>
  864. </TABLE>
  865. <A NAME="skip-navbar_bottom"></A>
  866. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  867.  
  868. <HR>
  869. Copyright &#169; 2009 <a href="http://www.sun.com">Sun Microsystems, Inc.</a>. All Rights Reserved.
  870. </BODY>
  871. </HTML>
  872.