Package org.osgi.service.upnp

Examples of org.osgi.service.upnp.UPnPAction.invoke()


        m_control.checkOrder(false);

        final UPnPAction action1 = m_control.createMock(UPnPAction.class);
        EasyMock.expect(action1.getOutputArgumentNames()).andReturn(new String[]{returnLocation}).anyTimes();
        EasyMock.expect(action1.invoke(null)).andReturn(p).anyTimes();

        final UPnPAction action2 = m_control.createMock(UPnPAction.class);
        EasyMock.expect(action2.getOutputArgumentNames()).andReturn(new String[]{returnType}).anyTimes();
        EasyMock.expect(action2.invoke(null)).andReturn(p).anyTimes();
View Full Code Here


        EasyMock.expect(action1.getOutputArgumentNames()).andReturn(new String[]{returnLocation}).anyTimes();
        EasyMock.expect(action1.invoke(null)).andReturn(p).anyTimes();

        final UPnPAction action2 = m_control.createMock(UPnPAction.class);
        EasyMock.expect(action2.getOutputArgumentNames()).andReturn(new String[]{returnType}).anyTimes();
        EasyMock.expect(action2.invoke(null)).andReturn(p).anyTimes();

        final UPnPService service = m_control.createMock(UPnPService.class);
        EasyMock.expect(service.getAction("GetLocation")).andReturn(action1).anyTimes();
        EasyMock.expect(service.getAction("GetServerType")).andReturn(action2).anyTimes();
View Full Code Here

    }

    private URL getLocation() {
        UPnPAction action = getAction(ACTION_GET_LOCATION);
        try {
            Dictionary dict = action.invoke(null);
            String location = (String)dict.get(action.getOutputArgumentNames()[0]);
            return new URL(location);
        }
        catch (Exception e) {}
        return null;
View Full Code Here

    }

    private String getType() {
        UPnPAction action = getAction(ACTION_GET_TYPE);
        try {
            Dictionary dict = action.invoke(null);
            return (String)dict.get(action.getOutputArgumentNames()[0]);
        }
        catch (Exception e) {}
        return "Unknown";
    }
View Full Code Here

    }

    private int getLoad() {
        UPnPAction action = getAction(ACTION_GET_LOAD);
        try {
            Dictionary dict = action.invoke(null);
            Integer val = (Integer)dict.get(action.getOutputArgumentNames()[0]);
            return val.intValue();
        }
        catch (Exception e) {
            //ignore, just report worst case
View Full Code Here

    }

    private URL getLocation() {
        UPnPAction action = getAction(ACTION_GET_LOCATION);
        try {
            Dictionary dict = action.invoke(null);
            String location = (String)dict.get(action.getOutputArgumentNames()[0]);
            return new URL(location);
        }
        catch (Exception e) {}
        return null;
View Full Code Here

    @SuppressWarnings("unused")
    private String getType() {
        UPnPAction action = getAction(ACTION_GET_TYPE);
        try {
            Dictionary dict = action.invoke(null);
            return (String)dict.get(action.getOutputArgumentNames()[0]);
        }
        catch (Exception e) {}
        return "Unknown";
    }
View Full Code Here

    @SuppressWarnings("unused")
    private int getLoad() {
        UPnPAction action = getAction(ACTION_GET_LOAD);
        try {
            Dictionary dict = action.invoke(null);
            Integer val = (Integer)dict.get(action.getOutputArgumentNames()[0]);
            return val.intValue();
        }
        catch (Exception e) {
            //ignore, just report worst case
View Full Code Here

        }
      }
    }
    Dictionary outArgs=null;
    try {
      outArgs=osgiAct.invoke(inArgs);
    } catch (UPnPException e) {
      //TODO Activator.logger.log()
      upnpAct.setStatus(e.getUPnPError_Code(),e.getMessage());
      invalidAction=true;
    } catch (Exception e){
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.