This repository has been archived by the owner on May 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 780
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hook the ChannelItemProvider into the ItemRegistry (#4580)
* Hook the ChannelItemProvider into the ItemRegistry ...so it gets informed before (resp. after) items are added (resp. removed) by other providers. fixes #4565 Signed-off-by: Simon Kaufmann <simon.kfm@googlemail.com>
- Loading branch information
1 parent
a382bf9
commit 9d6b17c
Showing
6 changed files
with
123 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...g.eclipse.smarthome.core/src/main/java/org/eclipse/smarthome/core/items/RegistryHook.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* Copyright (c) 2014-2017 by the respective copyright holders. | ||
* 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.eclipse.smarthome.core.items; | ||
|
||
import org.eclipse.smarthome.core.common.registry.Identifiable; | ||
|
||
/** | ||
* A listener to be informed before entities are added respectively after they are removed. | ||
* | ||
* @author Simon Kaufmann - initial contribution and API. | ||
*/ | ||
public interface RegistryHook<E extends Identifiable<?>> { | ||
|
||
/** | ||
* Notifies the listener that a single element is going to be added by another provider. | ||
* | ||
* @param element the element to be added | ||
*/ | ||
void beforeAdding(E element); | ||
|
||
/** | ||
* Notifies the listener that a single element was removed by another provider. | ||
* | ||
* @param element the element that was removed | ||
*/ | ||
void afterRemoving(E element); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters