/*
 * Copyright (c) 2015 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.cluster.datastore.entityownership;

import static org.opendaylight.controller.cluster.datastore.entityownership.EntityOwnersModel.ENTITY_OWNERS_PATH;
import static org.opendaylight.controller.cluster.datastore.entityownership.EntityOwnersModel.ENTITY_QNAME;
import org.opendaylight.controller.cluster.datastore.ShardDataTree;
import org.opendaylight.controller.md.sal.dom.api.DOMDataTreeChangeListener;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.clustering.entity.owners.rev150804.entity.owners.EntityType;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.LeafNode;

public abstract class AbstractEntityOwnerChangeListener  implements DOMDataTreeChangeListener {

    void init(ShardDataTree shardDataTree) {
        shardDataTree.registerTreeChangeListener(YangInstanceIdentifier.builder(ENTITY_OWNERS_PATH).
                node(EntityType.QNAME).node(EntityType.QNAME).node(ENTITY_QNAME).node(ENTITY_QNAME).node(EntityOwnersModel.ENTITY_OWNER_QNAME).build(), this);
    }

    protected static String extractOwner(LeafNode<?> ownerLeaf) {
        Object value = ownerLeaf.getValue();
        return value != null ? value.toString() : null;
    }

}

@@ -488,16 +488,130 @@
 S_PATH;%0A
+import static org.opendaylight.controller.cluster.datastore.entityownership.EntityOwnersModel.ENTITY_OWNER_QNAME;%0A
 import s
@@ -1200,17 +1200,16 @@
 istener 
- 
 implemen
@@ -1243,103 +1243,67 @@
 r %7B%0A
-%0A
     
-void init(ShardDataTree shardDataTree) %7B%0A        shardDataTree.registerTreeChangeListener(
+private static final YangInstanceIdentifier EOS_PATH = 
 Yang
@@ -1348,17 +1348,16 @@
 RS_PATH)
-.
 %0A       
@@ -1361,20 +1361,17 @@
         
-    
+.
 node(Ent
@@ -1449,32 +1449,27 @@
 AME)
-.node(EntityOwnersModel.
+%0A            .node(
 ENTI
@@ -1491,16 +1491,121 @@
 .build()
+;%0A%0A    void init(ShardDataTree shardDataTree) %7B%0A        shardDataTree.registerTreeChangeListener(EOS_PATH
 , this);

Use a static YangInstanceIdentifier in AbstractEntityOwnerChangeListener