()
| 213 | * need to be able to reconnect the Store on demand. |
| 214 | */ |
| 215 | @Override |
| 216 | public synchronized boolean isConnected() { |
| 217 | if (!super.isConnected()) |
| 218 | // if we haven't been connected at all, don't bother with |
| 219 | // the NOOP. |
| 220 | return false; |
| 221 | try { |
| 222 | if (port == null) |
| 223 | port = getPort(null); |
| 224 | else if (!port.noop()) |
| 225 | throw new IOException("NOOP failed"); |
| 226 | return true; |
| 227 | } catch (IOException ioex) { |
| 228 | // no longer connected, close it down |
| 229 | try { |
| 230 | super.close(); // notifies listeners |
| 231 | } catch (MessagingException mex) { |
| 232 | // ignore it |
| 233 | } |
| 234 | return false; |
| 235 | } |
| 236 | } |
| 237 | |
| 238 | synchronized Protocol getPort(POP3Folder owner) throws IOException { |
| 239 | Protocol p; |
no test coverage detected