Examples of Observer


Examples of lib.patterns.observer.Observer

    subscribers.remove(observer);
  }

  public void notifyObservers() {
    for (Iterator it = subscribers.iterator(); it.hasNext();) {
      Observer observer = (Observer) it.next();
      try {
        observer.notify(this);
      } catch (RemoteException e) {
        e.printStackTrace();
      } catch (ObjectNotValidException e) {
        e.printStackTrace();
      } catch (ObjectNotFoundException e) {

Examples of lib.patterns.observer.Observer

    subscribers.remove(observer);
  }

  public void notifyObservers() {
    for (Iterator it = subscribers.iterator(); it.hasNext();) {
      Observer observer = (Observer) it.next();
      try {
        observer.notify(this);
      } catch (RemoteException e) {
        e.printStackTrace();
      } catch (ObjectNotValidException e) {
        e.printStackTrace();
      } catch (ObjectNotFoundException e) {

Examples of nu3a.util.Observer

   * Notifica a los observadores registrados de que se ha producido algun
   * cambio en la textura.
   */
  public void notifyObservers() {
    for (int i = 0; i < obs.size(); i++) {
      Observer o = (Observer) obs.elementAt(i);
      o.update();
    }
  }

Examples of org.apache.hadoop.fs.slive.ObserveableOp.Observer

      info.amountLeft = amLeft;
      Operation op = factory.getOperation(type);
      // wrap operation in finalizer so that amount left gets decrements when
      // its done
      if (op != null) {
        Observer fn = new Observer() {
          public void notifyFinished(Operation op) {
            OperationInfo opInfo = operations.get(type);
            if (opInfo != null) {
              --opInfo.amountLeft;
            }

Examples of org.apache.jackrabbit.oak.spi.commit.Observer

        final Dictionary<String, Object> props = new Hashtable<String, Object>();
        props.put(Constants.SERVICE_VENDOR, "The Apache Software Foundation");
        props.put(Constants.SERVICE_DESCRIPTION, "Apache Sling JCR Observation Listener for Oak");

        final Observer observer = new BackgroundObserver(this, executor);
        serviceRegistration = bundleContext.registerService(Observer.class.getName(), observer, props);
    }

Examples of org.apache.jackrabbit.oak.spi.commit.Observer

    @Test
    public void afterCommitHook() throws CommitFailedException {
        // this test only works with a KernelNodeStore
        assumeTrue(store instanceof KernelNodeStore);
        final NodeState[] states = new NodeState[2]; // { before, after }
        ((KernelNodeStore) store).setObserver(new Observer() {
            @Override
            public void contentChanged(NodeState before, NodeState after) {
                states[0] = before;
                states[1] = after;
            }

Examples of org.apache.jackrabbit.oak.spi.commit.Observer

        ChangeDispatcher dispatcher = new ChangeDispatcher(store.getRoot());
        AtomicBoolean running = new AtomicBoolean(true);
        final CommitQueue queue = new CommitQueue(store, dispatcher);
        final List<Exception> exceptions = Collections.synchronizedList(new ArrayList<Exception>());

        Closeable observer = dispatcher.addObserver(new Observer() {
            private Revision before = new Revision(0, 0, store.getClusterId());

            @Override
            public void contentChanged(@Nonnull NodeState root, @Nullable CommitInfo info) {
                MongoNodeState after = (MongoNodeState) root;

Examples of org.apache.jackrabbit.oak.spi.commit.Observer

        final AtomicReference<NodeState> observedRoot =
                new AtomicReference<NodeState>(null);
        final CountDownLatch latch = new CountDownLatch(2);

        ((Observable) store).addObserver(new Observer() {
            @Override
            public void contentChanged(
                    @Nonnull NodeState root, @Nullable CommitInfo info) {
                if (root.getChildNode("test").hasChildNode("newNode")) {
                    observedRoot.set(checkNotNull(root));

Examples of org.apache.jackrabbit.oak.spi.commit.Observer

        final AtomicReference<NodeState> observedRoot =
                new AtomicReference<NodeState>(null);
        final CountDownLatch latch = new CountDownLatch(2);

        ((Observable) store).addObserver(new Observer() {
            @Override
            public void contentChanged(
                    @Nonnull NodeState root, @Nullable CommitInfo info) {
                if (root.getChildNode("test").hasChildNode("newNode")) {
                    observedRoot.set(checkNotNull(root));

Examples of org.apache.jackrabbit.oak.spi.commit.Observer

        //Issue is not reproducible with MemoryNodeBuilder and
        //MemoryNodeState as they cannot determine change in childNode without
        //entering
        NodeStore nodeStore = new SegmentNodeStore();
        final IndexTracker tracker = new IndexTracker();
        ((Observable)nodeStore).addObserver(new Observer() {
            @Override
            public void contentChanged(@Nonnull NodeState root, @Nullable CommitInfo info) {
                tracker.update(root);
            }
        });
TOP
Copyright © 2018 www.massapi.com. 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.