Package org.I0Itec.zkclient.exception

Examples of org.I0Itec.zkclient.exception.ZkInterruptedException


          /**
           * restore interrupted status of current thread
           */
          Thread.currentThread().interrupt();
        } catch (InterruptedException e1) {
          throw new ZkInterruptedException(e1);
        }
      }
    } finally {
      getEventLock().unlock();
      LOG.info("Closed zkclient");
View Full Code Here


    _processor.run();
  }

  @Test(timeout = 10000)
  public void testInterruptedException_Queue_Zk() throws Exception {
    when(_queue.peek()).thenThrow(new ZkInterruptedException(new InterruptedException()));
    _processor.run();
  }
View Full Code Here

  @Test(timeout = 10000)
  public void testInterruptedException_Operation_ZK() throws Exception {
    NodeOperation nodeOperation = mock(NodeOperation.class);
    when(_queue.peek()).thenReturn(nodeOperation);
    when(nodeOperation.execute(_context)).thenThrow(new ZkInterruptedException(new InterruptedException()));
    _processor.run();
  }
View Full Code Here

  }

  @Test(timeout = 10000)
  public void testInterruptedException_Queue_Zk() throws Exception {
    when(_protocol.getLiveNodes()).thenReturn(Arrays.asList("node1"));
    ZkInterruptedException zkInterruptedException = mock(ZkInterruptedException.class);
    when(_queue.peek()).thenThrow(zkInterruptedException);
    OperatorThread operatorThread = new OperatorThread(_context, 50);
    operatorThread.start();
    operatorThread.join();
  }
View Full Code Here

  }

  @Test(timeout = 1000000)
  public void testInterruptedException_Operation_Zk() throws Exception {
    when(_protocol.getLiveNodes()).thenReturn(Arrays.asList("node1"));
    ZkInterruptedException zkInterruptedException = mock(ZkInterruptedException.class);
    final MasterOperation masterOperation = mockOperation(ExecutionInstruction.EXECUTE);
    when(masterOperation.execute(_context, EMPTY_LIST)).thenThrow(zkInterruptedException);
    when(_queue.peek()).thenReturn(masterOperation);
    OperatorThread operatorThread = new OperatorThread(_context, 50);
    operatorThread.start();
View Full Code Here

                    return false;
                }
            }
            return true;
        } catch (InterruptedException e) {
            throw new ZkInterruptedException(e);
        } finally {
            getEventLock().unlock();
        }
    }
View Full Code Here

                stillWaiting = getEventLock().getStateChangedCondition().awaitUntil(timeout);
            }
            LOG.debug("State is " + _currentState);
            return true;
        } catch (InterruptedException e) {
            throw new ZkInterruptedException(e);
        } finally {
            getEventLock().unlock();
        }
    }
View Full Code Here

    private void acquireEventLock() {
        try {
            getEventLock().lockInterruptibly();
        } catch (InterruptedException e) {
            throw new ZkInterruptedException(e);
        }
    }
View Full Code Here

                Thread.yield();
                waitUntilConnected();
            } catch (KeeperException e) {
                throw ZkException.create(e);
            } catch (InterruptedException e) {
                throw new ZkInterruptedException(e);
            } catch (Exception e) {
                throw ExceptionUtil.convertToRuntimeException(e);
            }
        }
    }
View Full Code Here

            getEventLock().lockInterruptibly();
            return _connection.getCreateTime(path);
        } catch (KeeperException e) {
            throw ZkException.create(e);
        } catch (InterruptedException e) {
            throw new ZkInterruptedException(e);
        } finally {
            getEventLock().unlock();
        }
    }
View Full Code Here

TOP

Related Classes of org.I0Itec.zkclient.exception.ZkInterruptedException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.