本文整理了Java中javax.mail.Transport.isConnected()
方法的一些代码示例,展示了Transport.isConnected()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Transport.isConnected()
方法的具体详情如下:
包路径:javax.mail.Transport
类名称:Transport
方法名:isConnected
暂无
代码示例来源:origin: aws/aws-sdk-java
/**
* Asserts a valid connection to the email service.
*/
private void checkConnection() {
if (emailService == null || !super.isConnected()) {
throw new IllegalStateException("Not connected");
}
}
代码示例来源:origin: spring-projects/spring-framework
if (transport == null || !transport.isConnected()) {
if (transport != null) {
try {
代码示例来源:origin: org.springframework/spring-context-support
if (transport == null || !transport.isConnected()) {
if (transport != null) {
try {
代码示例来源:origin: webx/citrus
/** 判断是否已经连接上。 */
@Override
public boolean isConnected() {
return transport != null && transport.isConnected();
}
代码示例来源:origin: webx/citrus
/** 判断是否已经连接上。 */
@Override
public boolean isConnected() {
return transport != null && transport.isConnected();
}
代码示例来源:origin: camunda/camunda-bpm-platform
/**
* Check if we're in the connected state. Don't bother checking
* whether the server is still alive, that will be detected later.
*
* @exception IllegalStateException if not connected
*
* @since JavaMail 1.4.1
*/
protected void checkConnected() {
if (!super.isConnected())
throw new IllegalStateException("Not connected");
}
代码示例来源:origin: com.sun.mail/javax.mail
/**
* Check if we're in the connected state. Don't bother checking
* whether the server is still alive, that will be detected later.
*
* @exception IllegalStateException if not connected
*
* @since JavaMail 1.4.1
*/
protected void checkConnected() {
if (!super.isConnected())
throw new IllegalStateException("Not connected");
}
代码示例来源:origin: com.sun.mail/javax.mail
private void closeConnection() throws MessagingException {
try {
if (serverSocket != null)
serverSocket.close();
} catch (IOException ioex) { // shouldn't happen
throw new MessagingException("Server Close Failed", ioex);
} finally {
serverSocket = null;
serverOutput = null;
serverInput = null;
lineInputStream = null;
if (super.isConnected()) // only notify if already connected
super.close();
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
private void closeConnection() throws MessagingException {
try {
if (serverSocket != null)
serverSocket.close();
} catch (IOException ioex) { // shouldn't happen
throw new MessagingException("Server Close Failed", ioex);
} finally {
serverSocket = null;
serverOutput = null;
serverInput = null;
lineInputStream = null;
if (super.isConnected()) // only notify if already connected
super.close();
}
}
代码示例来源:origin: com.sun.mail/javax.mail
/**
* Close the Transport and terminate the connection to the server.
*/
@Override
public synchronized void close() throws MessagingException {
if (!super.isConnected()) // Already closed.
return;
try {
if (serverSocket != null) {
sendCommand("QUIT");
if (quitWait) {
int resp = readServerResponse();
if (resp != 221 && resp != -1 &&
logger.isLoggable(Level.FINE))
logger.fine("QUIT failed with " + resp);
}
}
} finally {
closeConnection();
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
/**
* Close the Transport and terminate the connection to the server.
*/
public synchronized void close() throws MessagingException {
if (!super.isConnected()) // Already closed.
return;
try {
if (serverSocket != null) {
sendCommand("QUIT");
if (quitWait) {
int resp = readServerResponse();
if (resp != 221 && resp != -1 &&
logger.isLoggable(Level.FINE))
logger.fine("QUIT failed with " + resp);
}
}
} finally {
closeConnection();
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
if (!super.isConnected())
代码示例来源:origin: com.sun.mail/javax.mail
if (!super.isConnected())
代码示例来源:origin: com.alibaba.citrus/citrus-webx-all
/** 判断是否已经连接上。 */
@Override
public boolean isConnected() {
return transport != null && transport.isConnected();
}
代码示例来源:origin: com.meltmedia.cadmium/cadmium-email
public boolean isConnected()
{
boolean connected = false;
if( transport != null ) {
connected = transport.isConnected();
}
return connected;
}
代码示例来源:origin: javax.mail/com.springsource.javax.mail
/**
* Check if we're in the connected state. Don't bother checking
* whether the server is still alive, that will be detected later.
*
* @exception IllegalStateException if not connected
*
* @since JavaMail 1.4.1
*/
protected void checkConnected() {
if (!super.isConnected())
throw new IllegalStateException("Not connected");
}
代码示例来源:origin: com.sun.mail/jakarta.mail
/**
* Check if we're in the connected state. Don't bother checking
* whether the server is still alive, that will be detected later.
*
* @exception IllegalStateException if not connected
*
* @since JavaMail 1.4.1
*/
protected void checkConnected() {
if (!super.isConnected())
throw new IllegalStateException("Not connected");
}
代码示例来源:origin: com.sun.mail/smtp
/**
* Check if we're in the connected state. Don't bother checking
* whether the server is still alive, that will be detected later.
*
* @exception IllegalStateException if not connected
*
* @since JavaMail 1.4.1
*/
protected void checkConnected() {
if (!super.isConnected())
throw new IllegalStateException("Not connected");
}
代码示例来源:origin: com.sun.mail/android-mail
/**
* Check if we're in the connected state. Don't bother checking
* whether the server is still alive, that will be detected later.
*
* @exception IllegalStateException if not connected
*
* @since JavaMail 1.4.1
*/
protected void checkConnected() {
if (!super.isConnected())
throw new IllegalStateException("Not connected");
}
代码示例来源:origin: org.camunda.bpm.extension/camunda-bpm-mail-core
public Transport getTransport() throws IOException, MessagingException {
Transport transport = getSession().getTransport();
if (!transport.isConnected()) {
LOGGER.debug("connect transport");
transport.connect(configuration.getUserName(), configuration.getPassword());
}
return transport;
}
内容来源于网络,如有侵权,请联系作者删除!