Java 类org.apache.zookeeper.proto.WatcherEvent 实例源码

项目:fuck_zookeeper    文件:NettyServerCnxn.java   
@Override
public void process(WatchedEvent event) {
    ReplyHeader h = new ReplyHeader(-1, -1L, 0);
    if (LOG.isTraceEnabled()) {
        ZooTrace.logTraceMessage(LOG, ZooTrace.EVENT_DELIVERY_TRACE_MASK,
                                 "Deliver event " + event + " to 0x"
                                 + Long.toHexString(this.sessionId)
                                 + " through " + this);
    }

    // Convert WatchedEvent to a type that can be sent over the wire
    WatcherEvent e = event.getWrapper();

    try {
        sendResponse(h, e, "notification");
    } catch (IOException e1) {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Problem sending to " + getRemoteSocketAddress(), e1);
        }
        close();
    }
}
项目:https-github.com-apache-zookeeper    文件:NettyServerCnxn.java   
@Override
public void process(WatchedEvent event) {
    ReplyHeader h = new ReplyHeader(-1, -1L, 0);
    if (LOG.isTraceEnabled()) {
        ZooTrace.logTraceMessage(LOG, ZooTrace.EVENT_DELIVERY_TRACE_MASK,
                                 "Deliver event " + event + " to 0x"
                                 + Long.toHexString(this.sessionId)
                                 + " through " + this);
    }

    // Convert WatchedEvent to a type that can be sent over the wire
    WatcherEvent e = event.getWrapper();

    try {
        sendResponse(h, e, "notification");
    } catch (IOException e1) {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Problem sending to " + getRemoteSocketAddress(), e1);
        }
        close();
    }
}
项目:ZooKeeper    文件:NettyServerCnxn.java   
@Override
public void process(WatchedEvent event) {
    ReplyHeader h = new ReplyHeader(-1, -1L, 0);
    if (LOG.isTraceEnabled()) {
        ZooTrace.logTraceMessage(LOG, ZooTrace.EVENT_DELIVERY_TRACE_MASK,
                                 "Deliver event " + event + " to 0x"
                                 + Long.toHexString(this.sessionId)
                                 + " through " + this);
    }

    // Convert WatchedEvent to a type that can be sent over the wire
    WatcherEvent e = event.getWrapper();

    try {
        sendResponse(h, e, "notification");
    } catch (IOException e1) {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Problem sending to " + getRemoteSocketAddress(), e1);
        }
        close();
    }
}
项目:StreamProcessingInfrastructure    文件:NettyServerCnxn.java   
@Override
public void process(WatchedEvent event) {
    ReplyHeader h = new ReplyHeader(-1, -1L, 0);
    if (LOG.isTraceEnabled()) {
        ZooTrace.logTraceMessage(LOG, ZooTrace.EVENT_DELIVERY_TRACE_MASK,
                                 "Deliver event " + event + " to 0x"
                                 + Long.toHexString(this.sessionId)
                                 + " through " + this);
    }

    // Convert WatchedEvent to a type that can be sent over the wire
    WatcherEvent e = event.getWrapper();

    try {
        sendResponse(h, e, "notification");
    } catch (IOException e1) {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Problem sending to " + getRemoteSocketAddress(), e1);
        }
        close();
    }
}
项目:bigstreams    文件:NettyServerCnxn.java   
@Override
public void process(WatchedEvent event) {
    ReplyHeader h = new ReplyHeader(-1, -1L, 0);
    if (LOG.isTraceEnabled()) {
        ZooTrace.logTraceMessage(LOG, ZooTrace.EVENT_DELIVERY_TRACE_MASK,
                                 "Deliver event " + event + " to 0x"
                                 + Long.toHexString(this.sessionId)
                                 + " through " + this);
    }

    // Convert WatchedEvent to a type that can be sent over the wire
    WatcherEvent e = event.getWrapper();

    try {
        sendResponse(h, e, "notification");
    } catch (IOException e1) {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Problem sending to " + getRemoteSocketAddress(), e1);
        }
        close();
    }
}
项目:bigstreams    文件:NettyServerCnxn.java   
@Override
public void process(WatchedEvent event) {
    ReplyHeader h = new ReplyHeader(-1, -1L, 0);
    if (LOG.isTraceEnabled()) {
        ZooTrace.logTraceMessage(LOG, ZooTrace.EVENT_DELIVERY_TRACE_MASK,
                                 "Deliver event " + event + " to 0x"
                                 + Long.toHexString(this.sessionId)
                                 + " through " + this);
    }

    // Convert WatchedEvent to a type that can be sent over the wire
    WatcherEvent e = event.getWrapper();

    try {
        sendResponse(h, e, "notification");
    } catch (IOException e1) {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Problem sending to " + getRemoteSocketAddress(), e1);
        }
        close();
    }
}
项目:zookeeper-src-learning    文件:NettyServerCnxn.java   
@Override
public void process(WatchedEvent event) {
    ReplyHeader h = new ReplyHeader(-1, -1L, 0);
    if (LOG.isTraceEnabled()) {
        ZooTrace.logTraceMessage(LOG, ZooTrace.EVENT_DELIVERY_TRACE_MASK,
                                 "Deliver event " + event + " to 0x"
                                 + Long.toHexString(this.sessionId)
                                 + " through " + this);
    }

    // Convert WatchedEvent to a type that can be sent over the wire
    WatcherEvent e = event.getWrapper();

    try {
        sendResponse(h, e, "notification");
    } catch (IOException e1) {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Problem sending to " + getRemoteSocketAddress(), e1);
        }
        close();
    }
}
项目:zookeeper    文件:NettyServerCnxn.java   
@Override
public void process(WatchedEvent event) {
    ReplyHeader h = new ReplyHeader(-1, -1L, 0);
    if (LOG.isTraceEnabled()) {
        ZooTrace.logTraceMessage(LOG, ZooTrace.EVENT_DELIVERY_TRACE_MASK,
                                 "Deliver event " + event + " to 0x"
                                 + Long.toHexString(this.sessionId)
                                 + " through " + this);
    }

    // Convert WatchedEvent to a type that can be sent over the wire
    WatcherEvent e = event.getWrapper();

    try {
        sendResponse(h, e, "notification");
    } catch (IOException e1) {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Problem sending to " + getRemoteSocketAddress(), e1);
        }
        close();
    }
}
项目:SecureKeeper    文件:NettyServerCnxn.java   
@Override
public void process(WatchedEvent event) {
    ReplyHeader h = new ReplyHeader(-1, -1L, 0);
    if (LOG.isTraceEnabled()) {
        ZooTrace.logTraceMessage(LOG, ZooTrace.EVENT_DELIVERY_TRACE_MASK,
                                 "Deliver event " + event + " to 0x"
                                 + Long.toHexString(this.sessionId)
                                 + " through " + this);
    }

    // Convert WatchedEvent to a type that can be sent over the wire
    WatcherEvent e = event.getWrapper();

    try {
        sendResponse(h, e, "notification");
    } catch (IOException e1) {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Problem sending to " + getRemoteSocketAddress(), e1);
        }
        close();
    }
}
项目:SecureKeeper    文件:NettyServerCnxn.java   
@Override
public void process(WatchedEvent event) {
    ReplyHeader h = new ReplyHeader(-1, -1L, 0);
    if (LOG.isTraceEnabled()) {
        ZooTrace.logTraceMessage(LOG, ZooTrace.EVENT_DELIVERY_TRACE_MASK,
                                 "Deliver event " + event + " to 0x"
                                 + Long.toHexString(this.sessionId)
                                 + " through " + this);
    }

    // Convert WatchedEvent to a type that can be sent over the wire
    WatcherEvent e = event.getWrapper();

    try {
        sendResponse(h, e, "notification");
    } catch (IOException e1) {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Problem sending to " + getRemoteSocketAddress(), e1);
        }
        close();
    }
}
项目:StreamBench    文件:NettyServerCnxn.java   
@Override
public void process(WatchedEvent event) {
    ReplyHeader h = new ReplyHeader(-1, -1L, 0);
    if (LOG.isTraceEnabled()) {
        ZooTrace.logTraceMessage(LOG, ZooTrace.EVENT_DELIVERY_TRACE_MASK,
                                 "Deliver event " + event + " to 0x"
                                 + Long.toHexString(this.sessionId)
                                 + " through " + this);
    }

    // Convert WatchedEvent to a type that can be sent over the wire
    WatcherEvent e = event.getWrapper();

    try {
        sendResponse(h, e, "notification");
    } catch (IOException e1) {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Problem sending to " + getRemoteSocketAddress(), e1);
        }
        close();
    }
}
项目:ACaZoo    文件:NettyServerCnxn.java   
@Override
public void process(WatchedEvent event) {
    ReplyHeader h = new ReplyHeader(-1, -1L, 0);
    if (LOG.isTraceEnabled()) {
        ZooTrace.logTraceMessage(LOG, ZooTrace.EVENT_DELIVERY_TRACE_MASK,
                                 "Deliver event " + event + " to 0x"
                                 + Long.toHexString(this.sessionId)
                                 + " through " + this);
    }

    // Convert WatchedEvent to a type that can be sent over the wire
    WatcherEvent e = event.getWrapper();

    try {
        sendResponse(h, e, "notification");
    } catch (IOException e1) {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Problem sending to " + getRemoteSocketAddress(), e1);
        }
        close();
    }
}
项目:LoadBalanced_zk    文件:NettyServerCnxn.java   
@Override
public void process(WatchedEvent event) {
    ReplyHeader h = new ReplyHeader(-1, -1L, 0);
    if (LOG.isTraceEnabled()) {
        ZooTrace.logTraceMessage(LOG, ZooTrace.EVENT_DELIVERY_TRACE_MASK,
                                 "Deliver event " + event + " to 0x"
                                 + Long.toHexString(this.sessionId)
                                 + " through " + this);
    }

    // Convert WatchedEvent to a type that can be sent over the wire
    WatcherEvent e = event.getWrapper();

    try {
        sendResponse(h, e, "notification");
    } catch (IOException e1) {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Problem sending to " + getRemoteSocketAddress(), e1);
        }
        close();
    }
}
项目:LoadBalanced_zk    文件:NettyServerCnxn.java   
@Override
public void process(WatchedEvent event) {
    ReplyHeader h = new ReplyHeader(-1, -1L, 0);
    if (LOG.isTraceEnabled()) {
        ZooTrace.logTraceMessage(LOG, ZooTrace.EVENT_DELIVERY_TRACE_MASK,
                                 "Deliver event " + event + " to 0x"
                                 + Long.toHexString(this.sessionId)
                                 + " through " + this);
    }

    // Convert WatchedEvent to a type that can be sent over the wire
    WatcherEvent e = event.getWrapper();

    try {
        sendResponse(h, e, "notification");
    } catch (IOException e1) {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Problem sending to " + getRemoteSocketAddress(), e1);
        }
        close();
    }
}
项目:zookeeper-pkg    文件:NettyServerCnxn.java   
@Override
public void process(WatchedEvent event) {
    ReplyHeader h = new ReplyHeader(-1, -1L, 0);
    if (LOG.isTraceEnabled()) {
        ZooTrace.logTraceMessage(LOG, ZooTrace.EVENT_DELIVERY_TRACE_MASK,
                                 "Deliver event " + event + " to 0x"
                                 + Long.toHexString(this.sessionId)
                                 + " through " + this);
    }

    // Convert WatchedEvent to a type that can be sent over the wire
    WatcherEvent e = event.getWrapper();

    try {
        sendResponse(h, e, "notification");
    } catch (IOException e1) {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Problem sending to " + getRemoteSocketAddress(), e1);
        }
        close();
    }
}
项目:fuck_zookeeper    文件:NIOServerCnxn.java   
@Override
synchronized public void process(WatchedEvent event) {
    ReplyHeader h = new ReplyHeader(-1, -1L, 0);
    if (LOG.isTraceEnabled()) {
        ZooTrace.logTraceMessage(LOG, ZooTrace.EVENT_DELIVERY_TRACE_MASK,
                                 "Deliver event " + event + " to 0x"
                                 + Long.toHexString(this.sessionId)
                                 + " through " + this);
    }

    // Convert WatchedEvent to a type that can be sent over the wire
    WatcherEvent e = event.getWrapper();

    sendResponse(h, e, "notification");
}
项目:fuck_zookeeper    文件:WatchedEventTest.java   
@Test
public void testCreatingWatchedEventFromInvalidWrapper() {
    // Make sure we can't convert from an invalid wrapper

   try {
       WatcherEvent wep = new WatcherEvent(-2342, -252352, "foo");
       WatchedEvent we = new WatchedEvent(wep);
       Assert.fail("Was able to create WatchedEvent from bad wrapper");
   } catch (RuntimeException re) {
       // we're good
   }
}
项目:fuck_zookeeper    文件:WatchedEventTest.java   
@Test
public void testConvertingToEventWrapper() {
    WatchedEvent we = new WatchedEvent(EventType.NodeCreated, KeeperState.Expired, "blah");
    WatcherEvent wew = we.getWrapper();

    Assert.assertEquals(EventType.NodeCreated.getIntValue(), wew.getType());
    Assert.assertEquals(KeeperState.Expired.getIntValue(), wew.getState());
    Assert.assertEquals("blah", wew.getPath());
}
项目:https-github.com-apache-zookeeper    文件:NIOServerCnxn.java   
@Override
public void process(WatchedEvent event) {
    ReplyHeader h = new ReplyHeader(-1, -1L, 0);
    if (LOG.isTraceEnabled()) {
        ZooTrace.logTraceMessage(LOG, ZooTrace.EVENT_DELIVERY_TRACE_MASK,
                                 "Deliver event " + event + " to 0x"
                                 + Long.toHexString(this.sessionId)
                                 + " through " + this);
    }

    // Convert WatchedEvent to a type that can be sent over the wire
    WatcherEvent e = event.getWrapper();

    sendResponse(h, e, "notification");
}
项目:https-github.com-apache-zookeeper    文件:WatchedEventTest.java   
@Test
public void testCreatingWatchedEventFromInvalidWrapper() {
    // Make sure we can't convert from an invalid wrapper

   try {
       WatcherEvent wep = new WatcherEvent(-2342, -252352, "foo");
       new WatchedEvent(wep);
       Assert.fail("Was able to create WatchedEvent from bad wrapper");
   } catch (RuntimeException re) {
       // we're good
   }
}
项目:https-github.com-apache-zookeeper    文件:WatchedEventTest.java   
@Test
public void testConvertingToEventWrapper() {
    WatchedEvent we = new WatchedEvent(EventType.NodeCreated, KeeperState.Expired, "blah");
    WatcherEvent wew = we.getWrapper();

    Assert.assertEquals(EventType.NodeCreated.getIntValue(), wew.getType());
    Assert.assertEquals(KeeperState.Expired.getIntValue(), wew.getState());
    Assert.assertEquals("blah", wew.getPath());
}
项目:ZooKeeper    文件:NIOServerCnxn.java   
@Override
synchronized public void process(WatchedEvent event) {
    ReplyHeader h = new ReplyHeader(-1, -1L, 0);
    if (LOG.isTraceEnabled()) {
        ZooTrace.logTraceMessage(LOG, ZooTrace.EVENT_DELIVERY_TRACE_MASK,
                                 "Deliver event " + event + " to 0x"
                                 + Long.toHexString(this.sessionId)
                                 + " through " + this);
    }

    // Convert WatchedEvent to a type that can be sent over the wire
    WatcherEvent e = event.getWrapper();

    sendResponse(h, e, "notification");
}
项目:ZooKeeper    文件:WatchedEventTest.java   
@Test
public void testCreatingWatchedEventFromInvalidWrapper() {
    // Make sure we can't convert from an invalid wrapper

   try {
       WatcherEvent wep = new WatcherEvent(-2342, -252352, "foo");
       WatchedEvent we = new WatchedEvent(wep);
       Assert.fail("Was able to create WatchedEvent from bad wrapper");
   } catch (RuntimeException re) {
       // we're good
   }
}
项目:ZooKeeper    文件:WatchedEventTest.java   
@Test
public void testConvertingToEventWrapper() {
    WatchedEvent we = new WatchedEvent(EventType.NodeCreated, KeeperState.Expired, "blah");
    WatcherEvent wew = we.getWrapper();

    Assert.assertEquals(EventType.NodeCreated.getIntValue(), wew.getType());
    Assert.assertEquals(KeeperState.Expired.getIntValue(), wew.getState());
    Assert.assertEquals("blah", wew.getPath());
}
项目:StreamProcessingInfrastructure    文件:NIOServerCnxn.java   
@Override
synchronized public void process(WatchedEvent event) {
    ReplyHeader h = new ReplyHeader(-1, -1L, 0);
    if (LOG.isTraceEnabled()) {
        ZooTrace.logTraceMessage(LOG, ZooTrace.EVENT_DELIVERY_TRACE_MASK,
                                 "Deliver event " + event + " to 0x"
                                 + Long.toHexString(this.sessionId)
                                 + " through " + this);
    }

    // Convert WatchedEvent to a type that can be sent over the wire
    WatcherEvent e = event.getWrapper();

    sendResponse(h, e, "notification");
}
项目:StreamProcessingInfrastructure    文件:WatchedEventTest.java   
@Test
public void testCreatingWatchedEventFromInvalidWrapper() {
    // Make sure we can't convert from an invalid wrapper

   try {
       WatcherEvent wep = new WatcherEvent(-2342, -252352, "foo");
       WatchedEvent we = new WatchedEvent(wep);
       Assert.fail("Was able to create WatchedEvent from bad wrapper");
   } catch (RuntimeException re) {
       // we're good
   }
}
项目:StreamProcessingInfrastructure    文件:WatchedEventTest.java   
@Test
public void testConvertingToEventWrapper() {
    WatchedEvent we = new WatchedEvent(EventType.NodeCreated, KeeperState.Expired, "blah");
    WatcherEvent wew = we.getWrapper();

    Assert.assertEquals(EventType.NodeCreated.getIntValue(), wew.getType());
    Assert.assertEquals(KeeperState.Expired.getIntValue(), wew.getState());
    Assert.assertEquals("blah", wew.getPath());
}
项目:bigstreams    文件:NIOServerCnxn.java   
@Override
synchronized public void process(WatchedEvent event) {
    ReplyHeader h = new ReplyHeader(-1, -1L, 0);
    if (LOG.isTraceEnabled()) {
        ZooTrace.logTraceMessage(LOG, ZooTrace.EVENT_DELIVERY_TRACE_MASK,
                                 "Deliver event " + event + " to 0x"
                                 + Long.toHexString(this.sessionId)
                                 + " through " + this);
    }

    // Convert WatchedEvent to a type that can be sent over the wire
    WatcherEvent e = event.getWrapper();

    sendResponse(h, e, "notification");
}
项目:bigstreams    文件:WatchedEventTest.java   
@Test
public void testCreatingWatchedEventFromInvalidWrapper() {
    // Make sure we can't convert from an invalid wrapper

   try {
       WatcherEvent wep = new WatcherEvent(-2342, -252352, "foo");
       WatchedEvent we = new WatchedEvent(wep);
       Assert.fail("Was able to create WatchedEvent from bad wrapper");
   } catch (RuntimeException re) {
       // we're good
   }
}
项目:bigstreams    文件:WatchedEventTest.java   
@Test
public void testConvertingToEventWrapper() {
    WatchedEvent we = new WatchedEvent(EventType.NodeCreated, KeeperState.Expired, "blah");
    WatcherEvent wew = we.getWrapper();

    Assert.assertEquals(EventType.NodeCreated.getIntValue(), wew.getType());
    Assert.assertEquals(KeeperState.Expired.getIntValue(), wew.getState());
    Assert.assertEquals("blah", wew.getPath());
}
项目:bigstreams    文件:NIOServerCnxn.java   
@Override
synchronized public void process(WatchedEvent event) {
    ReplyHeader h = new ReplyHeader(-1, -1L, 0);
    if (LOG.isTraceEnabled()) {
        ZooTrace.logTraceMessage(LOG, ZooTrace.EVENT_DELIVERY_TRACE_MASK,
                                 "Deliver event " + event + " to 0x"
                                 + Long.toHexString(this.sessionId)
                                 + " through " + this);
    }

    // Convert WatchedEvent to a type that can be sent over the wire
    WatcherEvent e = event.getWrapper();

    sendResponse(h, e, "notification");
}
项目:bigstreams    文件:WatchedEventTest.java   
@Test
public void testCreatingWatchedEventFromInvalidWrapper() {
    // Make sure we can't convert from an invalid wrapper

   try {
       WatcherEvent wep = new WatcherEvent(-2342, -252352, "foo");
       WatchedEvent we = new WatchedEvent(wep);
       Assert.fail("Was able to create WatchedEvent from bad wrapper");
   } catch (RuntimeException re) {
       // we're good
   }
}
项目:bigstreams    文件:WatchedEventTest.java   
@Test
public void testConvertingToEventWrapper() {
    WatchedEvent we = new WatchedEvent(EventType.NodeCreated, KeeperState.Expired, "blah");
    WatcherEvent wew = we.getWrapper();

    Assert.assertEquals(EventType.NodeCreated.getIntValue(), wew.getType());
    Assert.assertEquals(KeeperState.Expired.getIntValue(), wew.getState());
    Assert.assertEquals("blah", wew.getPath());
}
项目:zookeeper-src-learning    文件:NIOServerCnxn.java   
@Override
synchronized public void process(WatchedEvent event) {
    ReplyHeader h = new ReplyHeader(-1, -1L, 0);
    if (LOG.isTraceEnabled()) {
        ZooTrace.logTraceMessage(LOG, ZooTrace.EVENT_DELIVERY_TRACE_MASK,
                                 "Deliver event " + event + " to 0x"
                                 + Long.toHexString(this.sessionId)
                                 + " through " + this);
    }

    // Convert WatchedEvent to a type that can be sent over the wire
    WatcherEvent e = event.getWrapper();

    sendResponse(h, e, "notification");
}
项目:zookeeper    文件:NIOServerCnxn.java   
@Override
synchronized public void process(WatchedEvent event) {
    ReplyHeader h = new ReplyHeader(-1, -1L, 0);
    if (LOG.isTraceEnabled()) {
        ZooTrace.logTraceMessage(LOG, ZooTrace.EVENT_DELIVERY_TRACE_MASK,
                                 "Deliver event " + event + " to 0x"
                                 + Long.toHexString(this.sessionId)
                                 + " through " + this);
    }

    // Convert WatchedEvent to a type that can be sent over the wire
    WatcherEvent e = event.getWrapper();

    sendResponse(h, e, "notification");
}
项目:zookeeper    文件:WatchedEventTest.java   
@Test
public void testCreatingWatchedEventFromInvalidWrapper() {
    // Make sure we can't convert from an invalid wrapper

   try {
       WatcherEvent wep = new WatcherEvent(-2342, -252352, "foo");
       WatchedEvent we = new WatchedEvent(wep);
       Assert.fail("Was able to create WatchedEvent from bad wrapper");
   } catch (RuntimeException re) {
       // we're good
   }
}
项目:zookeeper    文件:WatchedEventTest.java   
@Test
public void testConvertingToEventWrapper() {
    WatchedEvent we = new WatchedEvent(EventType.NodeCreated, KeeperState.Expired, "blah");
    WatcherEvent wew = we.getWrapper();

    Assert.assertEquals(EventType.NodeCreated.getIntValue(), wew.getType());
    Assert.assertEquals(KeeperState.Expired.getIntValue(), wew.getState());
    Assert.assertEquals("blah", wew.getPath());
}
项目:SecureKeeper    文件:NIOServerCnxn.java   
@Override
public void process(WatchedEvent event) {
    ReplyHeader h = new ReplyHeader(-1, -1L, 0);
    if (LOG.isTraceEnabled()) {
        ZooTrace.logTraceMessage(LOG, ZooTrace.EVENT_DELIVERY_TRACE_MASK,
                                 "Deliver event " + event + " to 0x"
                                 + Long.toHexString(this.sessionId)
                                 + " through " + this);
    }

    // Convert WatchedEvent to a type that can be sent over the wire
    WatcherEvent e = event.getWrapper();

    sendResponse(h, e, "notification");
}
项目:SecureKeeper    文件:WatchedEventTest.java   
@Test
public void testCreatingWatchedEventFromInvalidWrapper() {
    // Make sure we can't convert from an invalid wrapper

   try {
       WatcherEvent wep = new WatcherEvent(-2342, -252352, "foo");
       new WatchedEvent(wep);
       Assert.fail("Was able to create WatchedEvent from bad wrapper");
   } catch (RuntimeException re) {
       // we're good
   }
}
项目:SecureKeeper    文件:WatchedEventTest.java   
@Test
public void testConvertingToEventWrapper() {
    WatchedEvent we = new WatchedEvent(EventType.NodeCreated, KeeperState.Expired, "blah");
    WatcherEvent wew = we.getWrapper();

    Assert.assertEquals(EventType.NodeCreated.getIntValue(), wew.getType());
    Assert.assertEquals(KeeperState.Expired.getIntValue(), wew.getState());
    Assert.assertEquals("blah", wew.getPath());
}