Search in sources :

Example 6 with PinpointSocketException

use of com.navercorp.pinpoint.rpc.PinpointSocketException in project pinpoint by naver.

the class DefaultPinpointClient method returnFailureFuture.

private Future<ResponseMessage> returnFailureFuture() {
    DefaultFuture<ResponseMessage> future = new DefaultFuture<ResponseMessage>();
    future.setFailure(new PinpointSocketException("pinpointClientHandler is null"));
    return future;
}
Also used : PinpointSocketException(com.navercorp.pinpoint.rpc.PinpointSocketException) ResponseMessage(com.navercorp.pinpoint.rpc.ResponseMessage) DefaultFuture(com.navercorp.pinpoint.rpc.DefaultFuture)

Example 7 with PinpointSocketException

use of com.navercorp.pinpoint.rpc.PinpointSocketException in project pinpoint by naver.

the class RequestManager method close.

public void close() {
    logger.debug("close()");
    final PinpointSocketException closed = new PinpointSocketException("socket closed");
    // Could you handle race conditions of "close" more precisely?
    //        final Timer timer = this.timer;
    //        if (timer != null) {
    //            Set<Timeout> stop = timer.stop();
    //            for (Timeout timeout : stop) {
    //                DefaultFuture future = (DefaultFuture)timeout.getTask();
    //                future.setFailure(closed);
    //            }
    //        }
    int requestFailCount = 0;
    for (Map.Entry<Integer, DefaultFuture<ResponseMessage>> entry : requestMap.entrySet()) {
        if (entry.getValue().setFailure(closed)) {
            requestFailCount++;
        }
    }
    this.requestMap.clear();
    if (requestFailCount > 0) {
        logger.info("requestManager failCount:{}", requestFailCount);
    }
}
Also used : AtomicInteger(java.util.concurrent.atomic.AtomicInteger) PinpointSocketException(com.navercorp.pinpoint.rpc.PinpointSocketException) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) ConcurrentMap(java.util.concurrent.ConcurrentMap) Map(java.util.Map) DefaultFuture(com.navercorp.pinpoint.rpc.DefaultFuture)

Aggregations

PinpointSocketException (com.navercorp.pinpoint.rpc.PinpointSocketException)7 DefaultFuture (com.navercorp.pinpoint.rpc.DefaultFuture)3 ResponseMessage (com.navercorp.pinpoint.rpc.ResponseMessage)2 ChannelWriteFailListenableFuture (com.navercorp.pinpoint.rpc.ChannelWriteFailListenableFuture)1 FailureEventHandler (com.navercorp.pinpoint.rpc.FailureEventHandler)1 Future (com.navercorp.pinpoint.rpc.Future)1 PinpointClient (com.navercorp.pinpoint.rpc.client.PinpointClient)1 IOException (java.io.IOException)1 ByteBuffer (java.nio.ByteBuffer)1 Map (java.util.Map)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 ConcurrentMap (java.util.concurrent.ConcurrentMap)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 TBase (org.apache.thrift.TBase)1 TException (org.apache.thrift.TException)1 Timeout (org.jboss.netty.util.Timeout)1