• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java EndpointState类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.qpid.proton.engine.EndpointState的典型用法代码示例。如果您正苦于以下问题:Java EndpointState类的具体用法?Java EndpointState怎么用?Java EndpointState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



EndpointState类属于org.apache.qpid.proton.engine包,在下文中一共展示了EndpointState类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: bind

import org.apache.qpid.proton.engine.EndpointState; //导入依赖的package包/类
@Override
public void bind(Connection conn)
{
    // TODO - check if already bound

    _connectionEndpoint = (ConnectionImpl) conn;
    put(Event.Type.CONNECTION_BOUND, conn);
    _connectionEndpoint.setTransport(this);
    _connectionEndpoint.incref();

    if(getRemoteState() != EndpointState.UNINITIALIZED)
    {
        _connectionEndpoint.handleOpen(_open);
        if(getRemoteState() == EndpointState.CLOSED)
        {
            _connectionEndpoint.setRemoteState(EndpointState.CLOSED);
        }

        _frameParser.flush();
    }
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:22,代码来源:TransportImpl.java


示例2: handleEnd

import org.apache.qpid.proton.engine.EndpointState; //导入依赖的package包/类
@Override
public void handleEnd(End end, Binary payload, Integer channel)
{
    TransportSession transportSession = _remoteSessions.get(channel);
    if(transportSession == null)
    {
        // TODO - fail due to attach on non-begun session
    }
    else
    {
        _remoteSessions.remove(channel);
        transportSession.receivedEnd();
        transportSession.unsetRemoteChannel();
        SessionImpl session = transportSession.getSession();
        session.setRemoteState(EndpointState.CLOSED);
        ErrorCondition errorCondition = end.getError();
        if(errorCondition != null)
        {
            session.getRemoteCondition().copyFrom(errorCondition);
        }

        _connectionEndpoint.put(Event.Type.SESSION_REMOTE_CLOSE, session);
    }
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:25,代码来源:TransportImpl.java


示例3: handleClose

import org.apache.qpid.proton.engine.EndpointState; //导入依赖的package包/类
@Override
public void handleClose(Close close, Binary payload, Integer channel)
{
    _closeReceived = true;
    _remoteIdleTimeout = 0;
    setRemoteState(EndpointState.CLOSED);
    if(_connectionEndpoint != null)
    {
        _connectionEndpoint.setRemoteState(EndpointState.CLOSED);
        if(close.getError() != null)
        {
            _connectionEndpoint.getRemoteCondition().copyFrom(close.getError());
        }

        _connectionEndpoint.put(Event.Type.CONNECTION_REMOTE_CLOSE, _connectionEndpoint);
    }

}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:19,代码来源:TransportImpl.java


示例4: send

import org.apache.qpid.proton.engine.EndpointState; //导入依赖的package包/类
@Override
public int send(final byte[] bytes, int offset, int length)
{
    if (getLocalState() == EndpointState.CLOSED)
    {
        throw new IllegalStateException("send not allowed after the sender is closed.");
    }
    DeliveryImpl current = current();
    if (current == null || current.getLink() != this)
    {
        throw new IllegalArgumentException();//TODO.
    }
    int sent = current.send(bytes, offset, length);
    if (sent > 0) {
        getSession().incrementOutgoingBytes(sent);
    }
    return sent;
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:19,代码来源:SenderImpl.java


示例5: test

import org.apache.qpid.proton.engine.EndpointState; //导入依赖的package包/类
@Test
public void test()
{
    Connection connection1 = Proton.connection();
    Connection connection2 = Proton.connection();;
    Transport transport1 = Proton.transport();
    transport1.bind(connection1);

    Transport transport2 = Proton.transport();
    transport2.bind(connection2);

    assertEquals(EndpointState.UNINITIALIZED, connection1.getLocalState());
    assertEquals(EndpointState.UNINITIALIZED, connection1.getRemoteState());

    connection1.open();
    connection2.open();
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:18,代码来源:SimpleTest.java


示例6: processEventSessionRemoteState

import org.apache.qpid.proton.engine.EndpointState; //导入依赖的package包/类
private void processEventSessionRemoteState(Event event) {
    final String methodName = "processEventSessionRemoteState";
    logger.entry(this, methodName, event);

    if (event.getSession().getRemoteState() == EndpointState.ACTIVE) {
        if (event.getSession().getLocalState() == EndpointState.ACTIVE) {
            final EngineConnection engineConnection =
                    (EngineConnection) event.getConnection().getContext();
            if (!engineConnection.closed) {
                // First session has opened on the connection
                OpenRequest req = engineConnection.openRequest;
                engineConnection.openRequest = null;
                engineConnection.requestor.tell(new OpenResponse(req, engineConnection), this);
            }
        } else {
            // The remote end is trying to establish a new session with us, which is not allowed. I don't think this is a usual case,
            // but could occur with a badly written remote end (i.e. sends an initial AMQP open immediately followed by a begin)
            final Connection protonConnection = event.getConnection();
            protonConnection.setCondition(new ErrorCondition(Symbol.getSymbol("mqlight:session-remote-open-rejected"),
                                                             "MQ Light client is unable to accept an open session request"));
            protonConnection.close();
        }
    }

    logger.exit(this, methodName);
}
 
开发者ID:mqlight,项目名称:java-mqlight,代码行数:27,代码来源:Engine.java


示例7: detach

import org.apache.qpid.proton.engine.EndpointState; //导入依赖的package包/类
@Override
public void detach(AsyncResult request) {
   // If already closed signal success or else the caller might never get notified.
   if (getEndpoint().getLocalState() == EndpointState.CLOSED || getEndpoint().getRemoteState() == EndpointState.CLOSED) {

      if (getEndpoint().getLocalState() != EndpointState.CLOSED) {
         doDetach();
         getEndpoint().free();
      }

      request.onSuccess();
   } else {
      this.closeRequest = request;
      doDetach();
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:17,代码来源:AmqpAbstractResource.java


示例8: close

import org.apache.qpid.proton.engine.EndpointState; //导入依赖的package包/类
@Override
public void close(AsyncResult request) {
   // If already closed signal success or else the caller might never get notified.
   if (getEndpoint().getLocalState() == EndpointState.CLOSED || getEndpoint().getRemoteState() == EndpointState.CLOSED) {

      if (getEndpoint().getLocalState() != EndpointState.CLOSED) {
         doClose();
         getEndpoint().free();
      }

      request.onSuccess();
   } else {
      this.closeRequest = request;
      doClose();
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:17,代码来源:AmqpAbstractResource.java


示例9: tick

import org.apache.qpid.proton.engine.EndpointState; //导入依赖的package包/类
public long tick(boolean firstTick) {
   lock.lock();
   try {
      if (!firstTick) {
         try {
            if (connection.getLocalState() != EndpointState.CLOSED) {
               long rescheduleAt = transport.tick(TimeUnit.NANOSECONDS.toMillis(System.nanoTime()));
               if (transport.isClosed()) {
                  throw new IllegalStateException("Channel was inactive for to long");
               }
               return rescheduleAt;
            }
         } catch (Exception e) {
            log.warn(e.getMessage(), e);
            transport.close();
            connection.setCondition(new ErrorCondition());
         }
         return 0;
      }
      return transport.tick(TimeUnit.NANOSECONDS.toMillis(System.nanoTime()));
   } finally {
      lock.unlock();
      flushBytes();
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:26,代码来源:ProtonHandler.java


示例10: processStateChange

import org.apache.qpid.proton.engine.EndpointState; //导入依赖的package包/类
@Override
public void processStateChange() throws IOException {
    EndpointState remoteState = endpoint.getRemoteState();

    if (remoteState == EndpointState.ACTIVE) {
        if (isAwaitingOpen()) {
            LOG.debug("Link {} is now open: ", this);
            opened();
        }

        // Should not receive an ACTIVE event if not awaiting the open state.
    } else if (remoteState == EndpointState.CLOSED) {
        if (isAwaitingClose()) {
            LOG.debug("Link {} is now closed: ", this);
            closed();
        } else if (isAwaitingOpen()) {
            // Error on Open, create exception and signal failure.
            LOG.warn("Open of link {} failed: ", this);
            Exception remoteError = this.getRemoteError();
            failed(remoteError);
        } else {
            // TODO - Handle remote asynchronous close.
        }
    }
}
 
开发者ID:fusesource,项目名称:hawtjms,代码行数:26,代码来源:AbstractAmqpResource.java


示例11: performConnectionOpen

import org.apache.qpid.proton.engine.EndpointState; //导入依赖的package包/类
private void performConnectionOpen(Connection connection, InputStream in, OutputStream out) throws IOException, LoginException {
    connection.setHostname(saslHostname);
    connection.setContainer(container);
    connection.open();
    writeToNetwork(connection, out);
    readFromNetwork(connection, in, () -> connection.getRemoteState() == EndpointState.UNINITIALIZED);
}
 
开发者ID:EnMasseProject,项目名称:enmasse,代码行数:8,代码来源:SaslDelegatingLogin.java


示例12: onConnectionRemoteOpen

import org.apache.qpid.proton.engine.EndpointState; //导入依赖的package包/类
@Override
public void onConnectionRemoteOpen(Event evt) {
    Connection conn = evt.getConnection();
    if (conn.getLocalState() == EndpointState.UNINITIALIZED) {
        conn.open();
    }
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:8,代码来源:Handshaker.java


示例13: onSessionRemoteOpen

import org.apache.qpid.proton.engine.EndpointState; //导入依赖的package包/类
@Override
public void onSessionRemoteOpen(Event evt) {
    Session ssn = evt.getSession();
    if (ssn.getLocalState() == EndpointState.UNINITIALIZED) {
        ssn.open();
    }
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:8,代码来源:Handshaker.java


示例14: onLinkRemoteOpen

import org.apache.qpid.proton.engine.EndpointState; //导入依赖的package包/类
@Override
public void onLinkRemoteOpen(Event evt) {
    Link link = evt.getLink();
    if (link.getLocalState() == EndpointState.UNINITIALIZED) {
        link.setSource(link.getRemoteSource());
        link.setTarget(link.getRemoteTarget());
        link.open();
    }
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:10,代码来源:Handshaker.java


示例15: onConnectionRemoteClose

import org.apache.qpid.proton.engine.EndpointState; //导入依赖的package包/类
@Override
public void onConnectionRemoteClose(Event evt) {
    Connection conn = evt.getConnection();
    if (conn.getLocalState() != EndpointState.CLOSED) {
        conn.close();
    }
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:8,代码来源:Handshaker.java


示例16: onSessionRemoteClose

import org.apache.qpid.proton.engine.EndpointState; //导入依赖的package包/类
@Override
public void onSessionRemoteClose(Event evt) {
    Session ssn = evt.getSession();
    if (ssn.getLocalState() != EndpointState.CLOSED) {
        ssn.close();
    }
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:8,代码来源:Handshaker.java


示例17: onLinkRemoteClose

import org.apache.qpid.proton.engine.EndpointState; //导入依赖的package包/类
@Override
public void onLinkRemoteClose(Event evt) {
    Link link = evt.getLink();
    if (link.getLocalState() != EndpointState.CLOSED) {
        link.close();
    }
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:8,代码来源:Handshaker.java


示例18: onConnectionLocalOpen

import org.apache.qpid.proton.engine.EndpointState; //导入依赖的package包/类
@Override
public void onConnectionLocalOpen(Event evt) {
    Connection conn = evt.getConnection();
    if (conn.getRemoteState() == EndpointState.UNINITIALIZED) {
        // Give the connection a [random] container-id
        conn.setContainer(UUID.randomUUID().toString());
        try {
            new Connector(conn);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:14,代码来源:Driver.java


示例19: next

import org.apache.qpid.proton.engine.EndpointState; //导入依赖的package包/类
@Override
public Session next(EnumSet<EndpointState> local, EnumSet<EndpointState> remote)
{
    LinkNode.Query<SessionImpl> query = new EndpointImplQuery<SessionImpl>(local, remote);

    LinkNode<SessionImpl> sessionNode = _node.next(query);

    return sessionNode == null ? null : sessionNode.getValue();
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:10,代码来源:SessionImpl.java


示例20: oldApiCheckStateBeforeInput

import org.apache.qpid.proton.engine.EndpointState; //导入依赖的package包/类
/**
 * This method is public as it is used by Python layer.
 * @see org.apache.qpid.proton.engine.Transport#input(byte[], int, int)
 */
public TransportResult oldApiCheckStateBeforeInput(int inputLength)
{
    _lastTransportResult.checkIsOk();
    if(inputLength == 0)
    {
        if(_connectionEndpoint == null || _connectionEndpoint.getRemoteState() != EndpointState.CLOSED)
        {
            return TransportResultFactory.error(new TransportException("Unexpected EOS when remote connection not closed: connection aborted"));
        }
    }
    return TransportResultFactory.ok();
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:17,代码来源:TransportImpl.java



注:本文中的org.apache.qpid.proton.engine.EndpointState类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SelfPopulatingCache类代码示例发布时间:2022-05-22
下一篇:
Java FairSchedulerLeafQueueInfo类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap