/* * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ package org.opendaylight.controller.md.sal.common.api.data; import java.util.EventListener; import org.opendaylight.yangtools.concepts.Path; /** * Listener of data change events on particular subtree. * *

* User-supplied implementations of this listener interface MUST register via * {@link AsyncDataBroker#registerDataChangeListener(LogicalDatastoreType, Path, AsyncDataChangeListener, AsyncDataBroker.DataChangeScope)} * in order to start receiving data change events, which capture state changes * in a subtree. * *

* Implementation Note: This interface is intended to be implemented * by users of MD-SAL. * * @param

* Type of path (subtree identifier), which represents location in * tree * @param * Type of data (payload), which represents data payload */ public interface AsyncDataChangeListener

, D> extends EventListener { /** * * Invoked when there is data change for the particular path, which was used to * register this listener. *

* This method may be also invoked during registration of the listener if * there is any preexisting data in the conceptual data tree for supplied path. * This initial event will contain all preexisting data as created. * *

* Note: This method may be invoked from a shared thread pool. *

  • Implementations SHOULD NOT perform CPU-intensive operations on the calling thread. *
  • Implementations MUST NOT block the calling thread - to do so could lead to deadlock * scenarios. * *
    * * @param change * Data Change Event being delivered. */ void onDataChanged(AsyncDataChangeEvent change); }