Tabnine Logo
JsonControlService.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.apache.edgent.runtime.jsoncontrol.JsonControlService
constructor

Best Java code snippets using org.apache.edgent.runtime.jsoncontrol.JsonControlService.<init> (Showing top 9 results out of 315)

origin: apache/incubator-edgent

public DirectProvider() {
  this.services = new ServiceContainer();
  
  getServices().addService(ControlService.class, new JsonControlService());
}
origin: org.apache.edgent/edgent-providers-direct

public DirectProvider() {
  this.services = new ServiceContainer();
  
  getServices().addService(ControlService.class, new JsonControlService());
}
origin: apache/incubator-edgent

@Test
//@Ignore("This test relies on an existing war in a given location ... need to refactor this")
public void testAppServiceJar() throws Exception {
  
  DirectProvider provider = new DirectProvider();
  
  JsonControlService control = new JsonControlService();
  provider.getServices().addService(ControlService.class, control);        
  AppService.createAndRegister(provider, provider);
  File testAppsJar = getServerJar();
  assertNotNull(testAppsJar);
  assertTrue(testAppsJar.exists());
  System.out.println("Using server jar at: " + testAppsJar.toString());
  URL testAppsJarURL = testAppsJar.toURI().toURL();
  JsonObject registerJar = newRegisterJarRequest(testAppsJarURL.toExternalForm());       
  JsonElement crr = control.controlRequest(registerJar);    
  assertTrue(crr.getAsBoolean());
  
  Thread.sleep(500);
  
  JsonObject submitAppTwo = newSubmitRequest("SecondJarApp");        
  crr = control.controlRequest(submitAppTwo);      
  assertTrue(crr.getAsBoolean());
  
  Thread.sleep(500);
}

origin: apache/incubator-edgent

@Test
public void test1ArgString() throws Exception {
  JsonControlService control = new JsonControlService();
origin: apache/incubator-edgent

@Test
public void test1ArgInt() throws Exception {
  JsonControlService control = new JsonControlService();
origin: apache/incubator-edgent

@Test
public void testAppService() throws Exception {
  
  DirectProvider provider = new DirectProvider();
  
  JsonControlService control = new JsonControlService();
  provider.getServices().addService(ControlService.class, control);        
  AppService.createAndRegister(provider, provider);
  
  IotTestApps.registerApplications(provider);       
  
  JsonObject submitAppOne = newSubmitRequest("AppOne");        
  JsonElement crr = control.controlRequest(submitAppOne);      
  assertTrue(crr.getAsBoolean());
}

origin: apache/incubator-edgent

@Test
public void test2ArgLongDouble() throws Exception {
  JsonControlService control = new JsonControlService();
origin: apache/incubator-edgent

@Test
public void testNoArg() throws Exception {
  JsonControlService control = new JsonControlService();
  MyBeanImpl cb1 = new MyBeanImpl();
  MyBeanImpl cb2 = new MyBeanImpl();
  assertFalse(cb1.isDoneIt());
  assertFalse(cb2.isDoneIt());
  control.registerControl("myb", "1", null, MyBean.class, cb1);
  control.registerControl("myb", "2", null, MyBean.class, cb2);
  assertFalse(cb1.isDoneIt());
  assertFalse(cb2.isDoneIt());
  JsonObject req = new JsonObject();
  req.addProperty(JsonControlService.TYPE_KEY, "myb");
  req.addProperty(JsonControlService.ALIAS_KEY, "1");
  req.addProperty(JsonControlService.OP_KEY, "doIt");
  control.controlRequest(req);
  assertTrue(cb1.isDoneIt());
  assertFalse(cb2.isDoneIt());
  req = new JsonObject();
  req.addProperty(JsonControlService.TYPE_KEY, "myb");
  req.addProperty(JsonControlService.ALIAS_KEY, "2");
  req.addProperty(JsonControlService.OP_KEY, "doIt");
  control.controlRequest(req);
  assertTrue(cb1.isDoneIt());
  assertTrue(cb2.isDoneIt());
}
origin: apache/incubator-edgent

@Test
public void test3ArgBooleanEnum() throws Exception {
  JsonControlService control = new JsonControlService();
org.apache.edgent.runtime.jsoncontrolJsonControlService<init>

Popular methods of JsonControlService

  • controlRequest
    Handle a JSON control request. The control action is executed directly using the calling thread.
  • controlOperation
    Handle a control operation. An operation maps to a void method.
  • executeMethod
  • findMethod
  • getArguments
  • getControl
  • getControlId
  • getControlMBean
  • registerControl
    All control service MBeans must be valid according to Controls#isControlServiceMBean(Class).

Popular in Java

  • Running tasks concurrently on multiple threads
  • onRequestPermissionsResult (Fragment)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • compareTo (BigDecimal)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • ImageIO (javax.imageio)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now