Package it.freedomotic.core

Examples of it.freedomotic.core.Resolver


        if (!mostSimilar.isEmpty()) {
            Command c = mostSimilar.get(0).getCommand();
            System.out.println("execute speech command: " + c.getName());

            Resolver resolver = new Resolver();
            resolver.addContext("event.",
                    getPayload());

            try {
                Command resolvedCommand = resolver.resolve(c);
                busService.send(resolvedCommand);
            } catch (CloneNotSupportedException ex) {
                Logger.getLogger(SpeechEvent.class.getName()).log(Level.SEVERE, null, ex);
            } catch (VariableResolutionException ex) {
                Logger.getLogger(SpeechEvent.class.getName()).log(Level.SEVERE, null, ex);
View Full Code Here


        //along with the parameters getted from the relative behavior (if exists)
        LOG.log(Level.FINE,
                "Environment object ''{0}'' tries to ''{1}'' itself using hardware command ''{2}''",
                new Object[]{pojo.getName(), action, command.getName()});

        Resolver resolver = new Resolver();
        //adding a resolution context for object that owns this hardware level command. 'owner.' is the prefix of this context
        resolver.addContext("owner.",
                getExposedProperties());
        resolver.addContext("owner.",
                getExposedBehaviors());

        try {
            final Command resolvedCommand = resolver.resolve(command); //eg: turn on an X10 device
            //            XStream s = FreedomXStream.getXstream();
            //            System.out.println(s.toXML(resolvedCommand));

            Command result = busService.send(resolvedCommand); //blocking wait until timeout
View Full Code Here

TOP

Related Classes of it.freedomotic.core.Resolver

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.