Package net.xeoh.plugins.base.options.getplugin

Examples of net.xeoh.plugins.base.options.getplugin.OptionCapabilities


        }

        this.logger.fine("Getting device with selector " + deviceSelector);

        // Obtain the proper tracking device here
        EyeTrackingDeviceProvider deviceProvider = this.pluginManager.getPlugin(EyeTrackingDeviceProvider.class, new OptionCapabilities(deviceSelector));

        // No device is bad ... at this stage ...
        if (deviceProvider == null) {
            this.logger.warning("No tracking device found for " + deviceSelector + "!");
            return;
        }

        this.logger.info("Device found, opening connection to " + trackerConnection);

        // Now open the device
        this.eyeTrackingDevice = deviceProvider.openDevice(trackerConnection);

        // If opening the device didn't work and we have autodetection, use the mouse
        if (this.eyeTrackingDevice == null && autoDetection) {

            this.logger.info("Device did not open. Trying mouse.");

            deviceSelector = "eyetrackingdevice:mouse";

            // Obtain the fallback device here
            deviceProvider = this.pluginManager.getPlugin(EyeTrackingDeviceProvider.class, new OptionCapabilities(deviceSelector));

            // No device is bad ... at this stage ...
            if (deviceProvider == null) {
                this.logger.warning("Still no tracking device found for " + deviceSelector + ". This is really bad.");
                return;
View Full Code Here


        // Check our options. In case we have a plugin selector, only use the selector
        if (ou.contains(OptionPluginSelector.class)) {
            pluginSelector = ou.get(OptionPluginSelector.class).getSelector();
        } else {
            // Capabilites we require
            final String capabilites[] = ou.get(OptionCapabilities.class, new OptionCapabilities()).getCapabilities();

            // Get caps as list
            final Collection<String> caps = Arrays.asList(capabilites);

            // Create our own selector
View Full Code Here

     * @param caps The other, optional, capabilities to consider.
     * @see OptionCapabilities 
     * @return A collection of plugins for which the collector return true.
     */
    public <P extends Plugin> P getPlugin(Class<P> plugin, String cap1, String... caps) {
        return this.object.getPlugin(plugin, new OptionCapabilities($(cap1).add(caps).unsafearray()));
    }
View Full Code Here

            this.pm.addPluginsFrom(new URI("classpath://*"));
        } catch (URISyntaxException e) {
            e.printStackTrace();
        }

        plugin = this.pm.getPlugin(RemoteAPI.class, new OptionCapabilities("ASOIDASJdasjkdhasdiasoDASOJd"));
        Assert.assertNull("This plugins must not exist", plugin);
        plugin = this.pm.getPlugin(RemoteAPI.class, new OptionCapabilities("XMLRPC"));
        Assert.assertNotNull("Now plugin must be there", plugin);
    }
View Full Code Here

                        if (d.isOptional) {
                            this.logger.finest("Skipping dependency as optional " + d.pluginClass);
                            continue;
                        }

                        if (this.pluginManager.getPlugin(d.pluginClass, new OptionCapabilities(d.capabilites)) == null) {
                            resolvedAll = false;
                        }

                    }
View Full Code Here

     * @return
     */
    @SuppressWarnings("unchecked")
    Plugin getEntityForType(Class<?> type, String...capabilities) {
        // We need that anyways.
        Plugin plugin = this.pluginManager.getPlugin((Class<Plugin>) getTrueDependencyInterfaceType(type), new OptionCapabilities(capabilities));
       
        // First check if the requested type is an anctual interface or not. If it is, we simply treat
        // it as a plugin, if it is not (i.e., a ordinary class), we treat it as a util wrapper.
        if(type.isInterface()) {
            return plugin;
View Full Code Here

public class OptionsTest {
    /**
     * @param args
     */
    public static void main(String[] args) {
        test(new OptionCapabilities("yo", "no"));
    }
View Full Code Here

        // Check our options. In case we have a plugin selector, only use the selector
        if (ou.contains(OptionPluginSelector.class)) {
            pluginSelector = ou.get(OptionPluginSelector.class).getSelector();
        } else {
            // Capabilites we require
            final String capabilites[] = ou.get(OptionCapabilities.class, new OptionCapabilities()).getCapabilities();

            // Get caps as list
            final Collection<String> caps = Arrays.asList(capabilites);

            // Create our own selector
View Full Code Here

     * @param caps The other, optional, capabilities to consider.
     * @see OptionCapabilities 
     * @return A collection of plugins for which the collector return true.
     */
    public <P extends Plugin> P getPlugin(Class<P> plugin, String cap1, String... caps) {
        return this.object.getPlugin(plugin, new OptionCapabilities($(cap1).add(caps).unsafearray()));
    }
View Full Code Here

                        if (d.isOptional) {
                            this.logger.finest("Skipping dependency as optional " + d.pluginClass);
                            continue;
                        }

                        if (this.pluginManager.getPlugin(d.pluginClass, new OptionCapabilities(d.capabilites)) == null) {
                            resolvedAll = false;
                        }

                    }
View Full Code Here

TOP

Related Classes of net.xeoh.plugins.base.options.getplugin.OptionCapabilities

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.