javax.mail.Store.isConnected()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(126)

本文整理了Java中javax.mail.Store.isConnected()方法的一些代码示例,展示了Store.isConnected()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Store.isConnected()方法的具体详情如下:
包路径:javax.mail.Store
类名称:Store
方法名:isConnected

Store.isConnected介绍

暂无

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

/**
 * @return Returns the connection status. true if the connection is still opened
 */
public boolean isConnected() {
 return ( this.store != null && this.store.isConnected() );
}

代码示例来源:origin: igniterealtime/Openfire

if (! store.isConnected()) {
  throw new UnauthorizedException("Could not authenticate user");

代码示例来源:origin: webx/citrus

/** 判断是否已经连接上。 */
@Override
public boolean isConnected() {
  return store != null && store.isConnected();
}

代码示例来源:origin: webx/citrus

/** 判断是否已经连接上。 */
@Override
public boolean isConnected() {
  return store != null && store.isConnected();
}

代码示例来源:origin: camunda/camunda-bpm-platform

private void checkConnected() {
assert Thread.holdsLock(this);
if (!super.isConnected())
  throw new IllegalStateException("Not connected");
}

代码示例来源:origin: com.sun.mail/javax.mail

private void checkConnected() {
assert Thread.holdsLock(this);
if (!super.isConnected())
  throw new IllegalStateException("Not connected");
}

代码示例来源:origin: camunda/camunda-bpm-platform

private void checkConnected() throws MessagingException {
  if (!super.isConnected())
    throw new MessagingException("Not connected");
  }
}

代码示例来源:origin: com.sun.mail/javax.mail

private void checkConnected() throws MessagingException {
  if (!super.isConnected())
    throw new MessagingException("Not connected");
  }
}

代码示例来源:origin: com.sun.mail/javax.mail

if (!super.isConnected()) {
return super.isConnected();

代码示例来源:origin: camunda/camunda-bpm-platform

if (!super.isConnected()) {
return super.isConnected();

代码示例来源:origin: camunda/camunda-bpm-platform

if (!super.isConnected())

代码示例来源:origin: spring-projects/spring-integration

private void connectStoreIfNecessary() throws MessagingException {
  if (this.store == null) {
    if (this.url != null) {
      this.store = this.session.getStore(this.url);
    }
    else if (this.protocol != null) {
      this.store = this.session.getStore(this.protocol);
    }
    else {
      this.store = this.session.getStore();
    }
  }
  if (!this.store.isConnected()) {
    if (this.logger.isDebugEnabled()) {
      this.logger.debug("connecting to store [" + this.store.getURLName() + "]");
    }
    this.store.connect();
  }
}

代码示例来源:origin: com.sun.mail/javax.mail

if (!super.isConnected())

代码示例来源:origin: spring-projects/spring-integration

@Test
public void testStoreConnect() throws Exception {
  AbstractMailReceiver receiver = new AbstractMailReceiver() {
    @Override
    protected Message[] searchForNewMessages() throws MessagingException {
      return null;
    }
  };
  Properties props = new Properties();
  Session session = Session.getInstance(props);
  receiver.setSession(session);
  receiver.setProtocol("imap");
  Store store = session.getStore("imap");
  store = spy(store);
  new DirectFieldAccessor(receiver).setPropertyValue("store", store);
  when(store.isConnected()).thenReturn(false);
  Folder folder = mock(Folder.class);
  when(folder.exists()).thenReturn(true);
  when(folder.isOpen()).thenReturn(false);
  doReturn(folder).when(store).getFolder((URLName) null);
  doNothing().when(store).connect();
  receiver.openFolder();
  receiver.openFolder();
  verify(store, times(2)).connect();
}

代码示例来源:origin: camunda/camunda-bpm-platform

if (!super.isConnected()) // Already closed.
  return;

代码示例来源:origin: camunda/camunda-bpm-platform

if (!super.isConnected()) {
  logger.fine("IMAPStore cleanup, not connected");
  return;

代码示例来源:origin: com.sun.mail/javax.mail

if (!super.isConnected()) {
  logger.fine("IMAPStore cleanup, not connected");
  return;

代码示例来源:origin: spring-projects/spring-integration

storeField.setAccessible(true);
Store store = mock(Store.class);
given(store.isConnected()).willReturn(false);
given(store.getFolder(Mockito.any(URLName.class))).willReturn(folder);
storeField.set(receiver, store);

代码示例来源:origin: spring-projects/spring-integration

storeField.setAccessible(true);
Store store = mock(Store.class);
given(store.isConnected()).willReturn(true);
given(store.getFolder(Mockito.any(URLName.class))).willReturn(folder);
storeField.set(receiver, store);

代码示例来源:origin: spring-projects/spring-integration

storeField.setAccessible(true);
Store store = mock(Store.class);
given(store.isConnected()).willReturn(true);
given(store.getFolder(Mockito.any(URLName.class))).willReturn(folder);
storeField.set(receiver, store);

相关文章