1 /* 2 * Copyright (c) OSGi Alliance (2000, 2013). All Rights Reserved. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package org.osgi.service.device; 18 19 import org.osgi.framework.ServiceReference; 20 21 /** 22 * <p> 23 * Interface for identifying device services. 24 * 25 * <p> 26 * A service must implement this interface or use the 27 * {@link Constants#DEVICE_CATEGORY} registration property to indicate that it 28 * is a device. Any services implementing this interface or registered with the 29 * {@code DEVICE_CATEGORY} property will be discovered by the device manager. 30 * 31 * <p> 32 * Device services implementing this interface give the device manager the 33 * opportunity to indicate to the device that no drivers were found that could 34 * (further) refine it. In this case, the device manager calls the 35 * {@link #noDriverFound()} method on the {@code Device} object. 36 * 37 * <p> 38 * Specialized device implementations will extend this interface by adding 39 * methods appropriate to their device category to it. 40 * 41 * @author $Id: a3f26e7ecae40c164624978e831b4dd27a857252 $ 42 * @see Driver 43 * @ThreadSafe 44 */ 45 public interface Device { 46 /** 47 * Return value from {@link Driver#match(ServiceReference)} indicating that 48 * the driver cannot refine the device presented to it by the device 49 * manager. 50 * 51 * The value is zero. 52 */ 53 public static final int MATCH_NONE = 0; 54 55 /** 56 * Indicates to this {@code Device} object that the device manager has 57 * failed to attach any drivers to it. 58 * 59 * <p> 60 * If this {@code Device} object can be configured differently, the driver 61 * that registered this {@code Device} object may unregister it and register 62 * a different Device service instead. 63 */ noDriverFound()64 public void noDriverFound(); 65 } 66