Package org.jnode.driver

Examples of org.jnode.driver.Driver


        this.api = api;
        this.parentContext = parentContext;

        log.info("api=" + api + " device=" + device);
        if ((device != null) && (api instanceof Driver)) {
            Driver driver = (Driver) api;
            try {
                boolean registered = false;

                try {
                    StubDeviceManager.INSTANCE.getDevice(device.getId());
                    registered = true;
                } catch (DeviceNotFoundException e) {
                    registered = false;
                }

                device.setDriver(driver);

                if (!registered) {
                    StubDeviceManager.INSTANCE.register(device);
                }
            } catch (DriverException e) {
                log.error("Error while starting device " + driver.getDevice(),
                    e);
            } catch (DeviceAlreadyRegisteredException e) {
                log.error("Error while starting device " + driver.getDevice(),
                    e);
            }
        }

        log.info(api.getClass().getName() + " initialized");
View Full Code Here


        } catch (IOException e) {
            log.error("can't flush " + api.getClass().getName(), e);
        }

        if (api instanceof Driver) {
            Driver driver = (Driver) api;
            Device device = driver.getDevice();

            if (device != null) {
                try {
                    StubDeviceManager.INSTANCE.stop(device);
                    StubDeviceManager.INSTANCE.unregister(device);
                } catch (DriverException e) {
                    log.error("Error while stopping device "
                        + driver.getDevice(), e);
                } catch (DeviceNotFoundException e) {
                    log.error("Error while stopping device "
                        + driver.getDevice(), e);
                }
            }
        }

        if (parentContext != null) {
View Full Code Here

TOP

Related Classes of org.jnode.driver.Driver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.