当前位置: 首页>>代码示例>>Java>>正文


Java EndpointState.CLOSED属性代码示例

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


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

示例1: bind

@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,代码行数:21,代码来源:TransportImpl.java

示例2: send

@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,代码行数:18,代码来源:SenderImpl.java

示例3: detach

@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,代码行数:16,代码来源:AmqpAbstractResource.java

示例4: close

@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,代码行数:16,代码来源:AmqpAbstractResource.java

示例5: tick

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,代码行数:25,代码来源:ProtonHandler.java

示例6: processStateChange

@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,代码行数:25,代码来源:AbstractAmqpResource.java

示例7: onConnectionRemoteClose

@Override
public void onConnectionRemoteClose(Event evt) {
    Connection conn = evt.getConnection();
    if (conn.getLocalState() != EndpointState.CLOSED) {
        conn.close();
    }
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:7,代码来源:Handshaker.java

示例8: onSessionRemoteClose

@Override
public void onSessionRemoteClose(Event evt) {
    Session ssn = evt.getSession();
    if (ssn.getLocalState() != EndpointState.CLOSED) {
        ssn.close();
    }
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:7,代码来源:Handshaker.java

示例9: onLinkRemoteClose

@Override
public void onLinkRemoteClose(Event evt) {
    Link link = evt.getLink();
    if (link.getLocalState() != EndpointState.CLOSED) {
        link.close();
    }
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:7,代码来源:Handshaker.java

示例10: oldApiCheckStateBeforeInput

/**
 * 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,代码行数:16,代码来源:TransportImpl.java

示例11: processEnd

private void processEnd()
{
    if(_connectionEndpoint != null && _isOpenSent)
    {
        EndpointImpl endpoint = _connectionEndpoint.getTransportHead();
        while(endpoint != null)
        {
            SessionImpl session;
            TransportSession transportSession;

            if((endpoint instanceof SessionImpl)) {
                if ((session = (SessionImpl)endpoint).getLocalState() == EndpointState.CLOSED
                    && (transportSession = session.getTransportSession()).isLocalChannelSet()
                    && !_isCloseSent)
                {
                    if (hasSendableMessages(session)) {
                        endpoint = endpoint.transportNext();
                        continue;
                    }

                    int channel = freeLocalChannel(transportSession);
                    End end = new End();
                    ErrorCondition localError = endpoint.getCondition();
                    if( localError.getCondition() !=null )
                    {
                        end.setError(localError);
                    }

                    writeFrame(channel, end, null, null);
                }

                endpoint.clearModified();
            }

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

示例12: processClose

private void processClose()
{
    if ((_condition != null ||
         (_connectionEndpoint != null &&
          _connectionEndpoint.getLocalState() == EndpointState.CLOSED)) &&
        !_isCloseSent) {
        if(!hasSendableMessages(null))
        {
            Close close = new Close();

            ErrorCondition localError;

            if (_connectionEndpoint == null) {
                localError = _condition;
            } else {
                localError =  _connectionEndpoint.getCondition();
            }

            if(localError.getCondition() != null)
            {
                close.setError(localError);
            }

            _isCloseSent = true;

            writeFrame(0, close, null, null);

            if (_connectionEndpoint != null) {
                _connectionEndpoint.clearModified();
            }
        }
    }
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:33,代码来源:TransportImpl.java

示例13: close

@Override
public void close()
{
    if (getLocalState() != EndpointState.CLOSED)
    {
        _localState = EndpointState.CLOSED;
        localClose();
        modified();
    }
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:10,代码来源:EndpointImpl.java

示例14: processStateChange

@Override
public void processStateChange() {
    // TODO - We might want to check on our producer to see if it becomes closed
    //        which might indicate that the broker purged the temporary destination.

    EndpointState remoteState = endpoint.getRemoteState();
    if (remoteState == EndpointState.ACTIVE) {
        LOG.trace("Temporary Destination: {} is now open", this.info);
        opened();
    } else if (remoteState == EndpointState.CLOSED) {
        LOG.trace("Temporary Destination: {} is now closed", this.info);
        closed();
    }
}
 
开发者ID:fusesource,项目名称:hawtjms,代码行数:14,代码来源:AmqpTemporaryDestination.java

示例15: close

@Override
public void close(AsyncResult<Void> request) {
    // If already closed signal success or else the caller might never get notified.
    if (endpoint.getLocalState() == EndpointState.CLOSED &&
        endpoint.getRemoteState() == EndpointState.CLOSED) {
        request.onSuccess();
    }

    this.closeRequest = request;
    doClose();
    this.endpoint.close();
}
 
开发者ID:fusesource,项目名称:hawtjms,代码行数:12,代码来源:AbstractAmqpResource.java


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