001    /*
002     * Copyright (c) OSGi Alliance (2000, 2008). All Rights Reserved.
003     *
004     * Licensed under the Apache License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     *      http://www.apache.org/licenses/LICENSE-2.0
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package org.osgi.service.device;
017    
018    /**
019     * <p>
020     * Interface for identifying device services.
021     * 
022     * <p>
023     * A service must implement this interface or use the
024     * {@link Constants#DEVICE_CATEGORY} registration property to indicate that it
025     * is a device. Any services implementing this interface or registered with the
026     * <code>DEVICE_CATEGORY</code> property will be discovered by the device
027     * manager.
028     * 
029     * <p>
030     * Device services implementing this interface give the device manager the
031     * opportunity to indicate to the device that no drivers were found that could
032     * (further) refine it. In this case, the device manager calls the
033     * {@link #noDriverFound} method on the <code>Device</code> object.
034     * 
035     * <p>
036     * Specialized device implementations will extend this interface by adding
037     * methods appropriate to their device category to it.
038     * 
039     * @version $Revision: 5654 $
040     * @see Driver
041     * @ThreadSafe
042     */
043    public interface Device {
044            /**
045             * Return value from {@link Driver#match} indicating that the driver cannot
046             * refine the device presented to it by the device manager.
047             * 
048             * The value is zero.
049             */
050            public static final int MATCH_NONE      = 0;
051    
052            /**
053             * Indicates to this <code>Device</code> object that the device manager has
054             * failed to attach any drivers to it.
055             * 
056             * <p>
057             * If this <code>Device</code> object can be configured differently, the
058             * driver that registered this <code>Device</code> object may unregister it
059             * and register a different Device service instead.
060             */
061            public void noDriverFound();
062    }