Java Code Examples for java.lang.StringBuilder#setLength()

The following examples show how to use java.lang.StringBuilder#setLength() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ApplicationWithComposite06Impl.java    From nalu with Apache License 2.0 6 votes vote down vote up
@Override
public void loadCompositeReferences() {
  StringBuilder sb01 = new StringBuilder();
  sb01.append("load composite references");
  ClientLogger.get().logDetailed(sb01.toString(), 2);
  this.compositeControllerReferences.add(new CompositeControllerReference("com.github.nalukit.nalu.processor.common.ui.controllerWithComposite06.ControllerWithComposite05", "testComposite01", "com.github.nalukit.nalu.processor.common.ui.controllerWithComposite06.composite.CompositeController03", "selector", false));
  sb01.setLength(0);
  sb01.append("register composite >>testComposite01<< for controller >>com.github.nalukit.nalu.processor.common.ui.controllerWithComposite06.ControllerWithComposite05<< in selector >>selector<<");
  ClientLogger.get().logDetailed(sb01.toString(), 3);
  this.compositeControllerReferences.add(new CompositeControllerReference("com.github.nalukit.nalu.processor.common.ui.controllerWithComposite06.ControllerWithComposite05", "testComposite02", "com.github.nalukit.nalu.processor.common.ui.controllerWithComposite06.composite.CompositeController04", "selector", false));
  sb01.setLength(0);
  sb01.append("register composite >>testComposite02<< for controller >>com.github.nalukit.nalu.processor.common.ui.controllerWithComposite06.ControllerWithComposite05<< in selector >>selector<<");
  ClientLogger.get().logDetailed(sb01.toString(), 3);
  this.compositeControllerReferences.add(new CompositeControllerReference("com.github.nalukit.nalu.processor.common.ui.controllerWithComposite06.ControllerWithComposite06", "testComposite01", "com.github.nalukit.nalu.processor.common.ui.controllerWithComposite06.composite.CompositeController03", "selector", false));
  sb01.setLength(0);
  sb01.append("register composite >>testComposite01<< for controller >>com.github.nalukit.nalu.processor.common.ui.controllerWithComposite06.ControllerWithComposite06<< in selector >>selector<<");
  ClientLogger.get().logDetailed(sb01.toString(), 3);
  this.compositeControllerReferences.add(new CompositeControllerReference("com.github.nalukit.nalu.processor.common.ui.controllerWithComposite06.ControllerWithComposite06", "testComposite02", "com.github.nalukit.nalu.processor.common.ui.controllerWithComposite06.composite.CompositeController04", "selector", false));
  sb01.setLength(0);
  sb01.append("register composite >>testComposite02<< for controller >>com.github.nalukit.nalu.processor.common.ui.controllerWithComposite06.ControllerWithComposite06<< in selector >>selector<<");
  ClientLogger.get().logDetailed(sb01.toString(), 3);
}
 
Example 2
Source File: generateDataset.java    From ecosys with Apache License 2.0 6 votes vote down vote up
public void batchPost(String target_host, String rest_endpoint, StringBuilder payload) {
  // String requestUrl = "http://" + host + ":9000/dumpfile?filename=/tmp/data.csv";
  String requestUrl = target_host + "/ddl?sep=,&tag=" + rest_endpoint + "&eol=%0A";
  String response = sendPostRequest(requestUrl, payload.toString());
  JSONObject res_json;
  try {
    res_json = new JSONObject(response);
    if (res_json.has("error") && res_json.optBoolean("error", true) == true) {
      logWarning("Response has error: " + response);
    } else {
      logInfo("Response: " + response);
    }
  } catch (JSONException e) {
     e.printStackTrace();
  }
  payload.setLength(0);
}
 
Example 3
Source File: ControllerC01CreatorImpl.java    From nalu with Apache License 2.0 6 votes vote down vote up
@Override
public void onFinishCreating(Object object) throws RoutingInterceptionException {
  ControllerC01 controller = (ControllerC01) object;
  StringBuilder sb01 = new StringBuilder();
  IComponent01 component = new Component01();
  sb01.setLength(0);
  sb01.append("component >>com.github.nalukit.nalu.processor.controllerCreator.controllerCreatorOkWithoutParameter.Component01<< --> created using new");
  ClientLogger.get().logDetailed(sb01.toString(), 4);
  component.setController(controller);
  sb01.setLength(0);
  sb01.append("component >>").append(component.getClass().getCanonicalName()).append("<< --> created and controller instance injected");
  ClientLogger.get().logDetailed(sb01.toString(), 4);
  controller.setComponent(component);
  sb01.setLength(0);
  sb01.append("controller >>").append(controller.getClass().getCanonicalName()).append("<< --> instance of >>").append(component.getClass().getCanonicalName()).append("<< injected");
  ClientLogger.get().logDetailed(sb01.toString(), 4);
  component.render();
  sb01.setLength(0);
  sb01.append("component >>").append(component.getClass().getCanonicalName()).append("<< --> rendered");
  ClientLogger.get().logDetailed(sb01.toString(), 4);
  component.bind();
  sb01.setLength(0);
  sb01.append("component >>").append(component.getClass().getCanonicalName()).append("<< --> bound");
  ClientLogger.get().logDetailed(sb01.toString(), 4);
  ClientLogger.get().logSimple("controller >>com.github.nalukit.nalu.processor.controllerCreator.controllerCreatorOkWithoutParameter.Component01<< created for route >>/mockShell/route01<<", 3);
}
 
Example 4
Source File: ControllerC02CreatorImpl.java    From nalu with Apache License 2.0 6 votes vote down vote up
@Override
public void onFinishCreating(Object object) throws RoutingInterceptionException {
  ControllerC02 controller = (ControllerC02) object;
  StringBuilder sb01 = new StringBuilder();
  IComponent02 component = new Component02();
  sb01.setLength(0);
  sb01.append("component >>com.github.nalukit.nalu.processor.controllerCreator.controllerCreatorOkWithOneParameter01.Component02<< --> created using new");
  ClientLogger.get().logDetailed(sb01.toString(), 4);
  component.setController(controller);
  sb01.setLength(0);
  sb01.append("component >>").append(component.getClass().getCanonicalName()).append("<< --> created and controller instance injected");
  ClientLogger.get().logDetailed(sb01.toString(), 4);
  controller.setComponent(component);
  sb01.setLength(0);
  sb01.append("controller >>").append(controller.getClass().getCanonicalName()).append("<< --> instance of >>").append(component.getClass().getCanonicalName()).append("<< injected");
  ClientLogger.get().logDetailed(sb01.toString(), 4);
  component.render();
  sb01.setLength(0);
  sb01.append("component >>").append(component.getClass().getCanonicalName()).append("<< --> rendered");
  ClientLogger.get().logDetailed(sb01.toString(), 4);
  component.bind();
  sb01.setLength(0);
  sb01.append("component >>").append(component.getClass().getCanonicalName()).append("<< --> bound");
  ClientLogger.get().logDetailed(sb01.toString(), 4);
  ClientLogger.get().logSimple("controller >>com.github.nalukit.nalu.processor.controllerCreator.controllerCreatorOkWithOneParameter01.Component02<< created for route >>/mockShell/route01/*<<", 3);
}
 
Example 5
Source File: ControllerC04CreatorImpl.java    From nalu with Apache License 2.0 6 votes vote down vote up
@Override
public void onFinishCreating(Object object) throws RoutingInterceptionException {
  ControllerC04 controller = (ControllerC04) object;
  StringBuilder sb01 = new StringBuilder();
  IComponent04 component = new Component04();
  sb01.setLength(0);
  sb01.append("component >>com.github.nalukit.nalu.processor.controllerCreator.controllerCreatorOkWithTwoParameter01.Component04<< --> created using new");
  ClientLogger.get().logDetailed(sb01.toString(), 4);
  component.setController(controller);
  sb01.setLength(0);
  sb01.append("component >>").append(component.getClass().getCanonicalName()).append("<< --> created and controller instance injected");
  ClientLogger.get().logDetailed(sb01.toString(), 4);
  controller.setComponent(component);
  sb01.setLength(0);
  sb01.append("controller >>").append(controller.getClass().getCanonicalName()).append("<< --> instance of >>").append(component.getClass().getCanonicalName()).append("<< injected");
  ClientLogger.get().logDetailed(sb01.toString(), 4);
  component.render();
  sb01.setLength(0);
  sb01.append("component >>").append(component.getClass().getCanonicalName()).append("<< --> rendered");
  ClientLogger.get().logDetailed(sb01.toString(), 4);
  component.bind();
  sb01.setLength(0);
  sb01.append("component >>").append(component.getClass().getCanonicalName()).append("<< --> bound");
  ClientLogger.get().logDetailed(sb01.toString(), 4);
  ClientLogger.get().logSimple("controller >>com.github.nalukit.nalu.processor.controllerCreator.controllerCreatorOkWithTwoParameter01.Component04<< created for route >>/mockShell/route01/*/*<<", 3);
}
 
Example 6
Source File: ControllerC04CreatorImpl.java    From nalu with Apache License 2.0 6 votes vote down vote up
@Override
public void setParameter(Object object, String... params) throws RoutingInterceptionException {
  ControllerC04 controller = (ControllerC04) object;
  StringBuilder sb01 = new StringBuilder();
  if (params != null) {
    if (params.length >= 1) {
      sb01.setLength(0);
      sb01.append("controller >>").append(controller.getClass().getCanonicalName()).append("<< --> using method >>setParameter01<< to set value >>").append(params[0]).append("<<");
      ClientLogger.get().logDetailed(sb01.toString(), 4);
      controller.setParameter01(params[0]);
    }
    if (params.length >= 2) {
      sb01.setLength(0);
      sb01.append("controller >>").append(controller.getClass().getCanonicalName()).append("<< --> using method >>setParameter02<< to set value >>").append(params[1]).append("<<");
      ClientLogger.get().logDetailed(sb01.toString(), 4);
      controller.setParameter02(params[1]);
    }
  }
}
 
Example 7
Source File: ControllerWithComposite03CreatorImpl.java    From nalu with Apache License 2.0 6 votes vote down vote up
@Override
public void onFinishCreating(Object object) throws RoutingInterceptionException {
  ControllerWithComposite03 controller = (ControllerWithComposite03) object;
  StringBuilder sb01 = new StringBuilder();
  IComponent03 component = new Component03();
  sb01.setLength(0);
  sb01.append("component >>com.github.nalukit.nalu.processor.common.ui.controllerWithComposite03.Component03<< --> created using new");
  ClientLogger.get().logDetailed(sb01.toString(), 4);
  component.setController(controller);
  sb01.setLength(0);
  sb01.append("component >>").append(component.getClass().getCanonicalName()).append("<< --> created and controller instance injected");
  ClientLogger.get().logDetailed(sb01.toString(), 4);
  controller.setComponent(component);
  sb01.setLength(0);
  sb01.append("controller >>").append(controller.getClass().getCanonicalName()).append("<< --> instance of >>").append(component.getClass().getCanonicalName()).append("<< injected");
  ClientLogger.get().logDetailed(sb01.toString(), 4);
  component.render();
  sb01.setLength(0);
  sb01.append("component >>").append(component.getClass().getCanonicalName()).append("<< --> rendered");
  ClientLogger.get().logDetailed(sb01.toString(), 4);
  component.bind();
  sb01.setLength(0);
  sb01.append("component >>").append(component.getClass().getCanonicalName()).append("<< --> bound");
  ClientLogger.get().logDetailed(sb01.toString(), 4);
  ClientLogger.get().logSimple("controller >>com.github.nalukit.nalu.processor.common.ui.controllerWithComposite03.Component03<< created for route >>/mockShell/route03/*<<", 3);
}
 
Example 8
Source File: StartRouteOKImpl.java    From nalu with Apache License 2.0 5 votes vote down vote up
@Override
public void loadDefaultRoutes() {
  StringBuilder sb01 = new StringBuilder();
  this.startRoute = "/mockShell/route01";
  sb01.append("found startRoute >>/mockShell/route01<<");
  ClientLogger.get().logDetailed(sb01.toString(), 2);
  sb01.setLength(0);
  ClientLogger.get().logDetailed(sb01.toString(), 2);
}
 
Example 9
Source File: ControllerC03CreatorImpl.java    From nalu with Apache License 2.0 5 votes vote down vote up
@Override
public ControllerInstance create() {
  StringBuilder sb01 = new StringBuilder();
  ControllerInstance controllerInstance = new ControllerInstance();
  controllerInstance.setControllerClassName("com.github.nalukit.nalu.processor.controllerCreator.controllerCreatorOkWithOneParameter01WithoutAcceptParameter.ControllerC03");
  AbstractComponentController<?, ?, ?> storedController = ControllerFactory.get().getControllerFormStore("com.github.nalukit.nalu.processor.controllerCreator.controllerCreatorOkWithOneParameter01WithoutAcceptParameter.ControllerC03");
  if (storedController == null) {
    sb01.append("controller >>com.github.nalukit.nalu.processor.controllerCreator.controllerCreatorOkWithOneParameter01WithoutAcceptParameter.ControllerC03<< --> will be created");
    ClientLogger.get().logSimple(sb01.toString(), 3);
    ControllerC03 controller = new ControllerC03();
    controllerInstance.setController(controller);
    controllerInstance.setCached(false);
    controller.setContext(context);
    controller.setEventBus(eventBus);
    controller.setRouter(router);
    controller.setCached(false);
    controller.setRelatedRoute("/mockShell/route01/*");
    controller.setRelatedSelector("selector01");
    sb01.setLength(0);
    sb01.append("controller >>").append(controller.getClass().getCanonicalName()).append("<< --> created and data injected");
    ClientLogger.get().logDetailed(sb01.toString(), 4);
  } else {
    sb01.append("controller >>").append(storedController.getClass().getCanonicalName()).append("<< --> found in cache -> REUSE!");
    ClientLogger.get().logDetailed(sb01.toString(), 4);
    controllerInstance.setController(storedController);
    controllerInstance.setCached(true);
    controllerInstance.getController().setCached(true);
  }
  return controllerInstance;
}
 
Example 10
Source File: ApplicationWithComposite08Impl.java    From nalu with Apache License 2.0 5 votes vote down vote up
@Override
public void loadCompositeReferences() {
  StringBuilder sb01 = new StringBuilder();
  sb01.append("load composite references");
  ClientLogger.get().logDetailed(sb01.toString(), 2);
  this.compositeControllerReferences.add(new CompositeControllerReference("com.github.nalukit.nalu.processor.common.ui.controllerWithComposite07.ControllerWithComposite05", "testComposite01", "com.github.nalukit.nalu.processor.common.ui.controllerWithComposite07.composite.CompositeController03", "selector", false));
  sb01.setLength(0);
  sb01.append("register composite >>testComposite01<< for controller >>com.github.nalukit.nalu.processor.common.ui.controllerWithComposite07.ControllerWithComposite05<< in selector >>selector<<");
  ClientLogger.get().logDetailed(sb01.toString(), 3);
  this.compositeControllerReferences.add(new CompositeControllerReference("com.github.nalukit.nalu.processor.common.ui.controllerWithComposite07.ControllerWithComposite05", "testComposite02", "com.github.nalukit.nalu.processor.common.ui.controllerWithComposite07.composite.CompositeController04", "selector", false));
  sb01.setLength(0);
  sb01.append("register composite >>testComposite02<< for controller >>com.github.nalukit.nalu.processor.common.ui.controllerWithComposite07.ControllerWithComposite05<< in selector >>selector<<");
  ClientLogger.get().logDetailed(sb01.toString(), 3);
  this.compositeControllerReferences.add(new CompositeControllerReference("com.github.nalukit.nalu.processor.common.ui.controllerWithComposite07.ControllerWithComposite05", "testComposite03", "com.github.nalukit.nalu.processor.common.ui.controllerWithComposite07.composite.CompositeController05", "selector", false));
  sb01.setLength(0);
  sb01.append("register composite >>testComposite03<< for controller >>com.github.nalukit.nalu.processor.common.ui.controllerWithComposite07.ControllerWithComposite05<< in selector >>selector<<");
  ClientLogger.get().logDetailed(sb01.toString(), 3);
  this.compositeControllerReferences.add(new CompositeControllerReference("com.github.nalukit.nalu.processor.common.ui.controllerWithComposite07.ControllerWithComposite06", "testComposite01", "com.github.nalukit.nalu.processor.common.ui.controllerWithComposite07.composite.CompositeController03", "selector", false));
  sb01.setLength(0);
  sb01.append("register composite >>testComposite01<< for controller >>com.github.nalukit.nalu.processor.common.ui.controllerWithComposite07.ControllerWithComposite06<< in selector >>selector<<");
  ClientLogger.get().logDetailed(sb01.toString(), 3);
  this.compositeControllerReferences.add(new CompositeControllerReference("com.github.nalukit.nalu.processor.common.ui.controllerWithComposite07.ControllerWithComposite06", "testComposite02", "com.github.nalukit.nalu.processor.common.ui.controllerWithComposite07.composite.CompositeController04", "selector", false));
  sb01.setLength(0);
  sb01.append("register composite >>testComposite02<< for controller >>com.github.nalukit.nalu.processor.common.ui.controllerWithComposite07.ControllerWithComposite06<< in selector >>selector<<");
  ClientLogger.get().logDetailed(sb01.toString(), 3);
  this.compositeControllerReferences.add(new CompositeControllerReference("com.github.nalukit.nalu.processor.common.ui.controllerWithComposite07.ControllerWithComposite06", "testComposite03", "com.github.nalukit.nalu.processor.common.ui.controllerWithComposite07.composite.CompositeController03", "selector", false));
  sb01.setLength(0);
  sb01.append("register composite >>testComposite03<< for controller >>com.github.nalukit.nalu.processor.common.ui.controllerWithComposite07.ControllerWithComposite06<< in selector >>selector<<");
  ClientLogger.get().logDetailed(sb01.toString(), 3);
}
 
Example 11
Source File: ErrorPopUpAnnotationOkImpl.java    From nalu with Apache License 2.0 5 votes vote down vote up
@Override
public void loadDefaultRoutes() {
  StringBuilder sb01 = new StringBuilder();
  this.startRoute = "/mockShell/route01";
  sb01.append("found startRoute >>/mockShell/route01<<");
  ClientLogger.get().logDetailed(sb01.toString(), 2);
  sb01.setLength(0);
  ClientLogger.get().logDetailed(sb01.toString(), 2);
}
 
Example 12
Source File: ApplicationWithComposite08Impl.java    From nalu with Apache License 2.0 5 votes vote down vote up
@Override
public void loadRoutes() {
  StringBuilder sb01 = new StringBuilder();
  sb01.append("load routes");
  ClientLogger.get().logDetailed(sb01.toString(), 2);
  super.routerConfiguration.getRouters().add(new RouteConfig("/mockShell/route05/*", Arrays.asList(new String[]{"parameter05"}), "selector05", "com.github.nalukit.nalu.processor.common.ui.controllerWithComposite07.ControllerWithComposite05"));
  sb01.setLength(0);
  sb01.append("register route >>/mockShell/route05/*<< with parameter >>parameter05<< for selector >>selector05<< for controller >>com.github.nalukit.nalu.processor.common.ui.controllerWithComposite07.ControllerWithComposite05<<");
  ClientLogger.get().logDetailed(sb01.toString(), 3);
  super.routerConfiguration.getRouters().add(new RouteConfig("/mockShell/route06/*", Arrays.asList(new String[]{"parameter06"}), "selector06", "com.github.nalukit.nalu.processor.common.ui.controllerWithComposite07.ControllerWithComposite06"));
  sb01.setLength(0);
  sb01.append("register route >>/mockShell/route06/*<< with parameter >>parameter06<< for selector >>selector06<< for controller >>com.github.nalukit.nalu.processor.common.ui.controllerWithComposite07.ControllerWithComposite06<<");
  ClientLogger.get().logDetailed(sb01.toString(), 3);
}
 
Example 13
Source File: ApplicationWithComposite04Impl.java    From nalu with Apache License 2.0 5 votes vote down vote up
@Override
public void loadShells() {
  StringBuilder sb01 = new StringBuilder();
  sb01.append("load shell references");
  ClientLogger.get().logDetailed(sb01.toString(), 2);
  super.shellConfiguration.getShells().add(new ShellConfig("/mockShell", "com.github.nalukit.nalu.processor.common.MockShell"));
  sb01.setLength(0);
  sb01.append("register shell >>/mockShell<< with class >>com.github.nalukit.nalu.processor.common.MockShell<<");
  ClientLogger.get().logDetailed(sb01.toString(), 3);
}
 
Example 14
Source File: ApplicationAnnotationOkWithLoaderAsInnerInterfaceImpl.java    From nalu with Apache License 2.0 5 votes vote down vote up
@Override
public void loadDefaultRoutes() {
  StringBuilder sb01 = new StringBuilder();
  this.startRoute = "/mockShell/route01";
  sb01.append("found startRoute >>/mockShell/route01<<");
  ClientLogger.get().logDetailed(sb01.toString(), 2);
  sb01.setLength(0);
  ClientLogger.get().logDetailed(sb01.toString(), 2);
}
 
Example 15
Source File: MyApplicationImpl.java    From nalu with Apache License 2.0 5 votes vote down vote up
@Override
public void loadShells() {
  StringBuilder sb01 = new StringBuilder();
  sb01.append("load shell references");
  ClientLogger.get().logDetailed(sb01.toString(), 2);
  super.shellConfiguration.getShells().add(new ShellConfig("/mockShell", "com.github.nalukit.nalu.processor.common.MockShell"));
  sb01.setLength(0);
  sb01.append("register shell >>/mockShell<< with class >>com.github.nalukit.nalu.processor.common.MockShell<<");
  ClientLogger.get().logDetailed(sb01.toString(), 3);
}
 
Example 16
Source File: ApplicationWithComposite05Impl.java    From nalu with Apache License 2.0 5 votes vote down vote up
@Override
public void loadCompositeReferences() {
  StringBuilder sb01 = new StringBuilder();
  sb01.append("load composite references");
  ClientLogger.get().logDetailed(sb01.toString(), 2);
  this.compositeControllerReferences.add(new CompositeControllerReference("com.github.nalukit.nalu.processor.common.ui.controllerWithComposite05.ControllerWithComposite05", "testComposite01", "com.github.nalukit.nalu.processor.common.ui.controllerWithComposite05.composite.CompositeController03", "selector", false));
  sb01.setLength(0);
  sb01.append("register composite >>testComposite01<< for controller >>com.github.nalukit.nalu.processor.common.ui.controllerWithComposite05.ControllerWithComposite05<< in selector >>selector<<");
  ClientLogger.get().logDetailed(sb01.toString(), 3);
  this.compositeControllerReferences.add(new CompositeControllerReference("com.github.nalukit.nalu.processor.common.ui.controllerWithComposite05.ControllerWithComposite05", "testComposite02", "com.github.nalukit.nalu.processor.common.ui.controllerWithComposite05.composite.CompositeController04", "selector", false));
  sb01.setLength(0);
  sb01.append("register composite >>testComposite02<< for controller >>com.github.nalukit.nalu.processor.common.ui.controllerWithComposite05.ControllerWithComposite05<< in selector >>selector<<");
  ClientLogger.get().logDetailed(sb01.toString(), 3);
}
 
Example 17
Source File: ApplicationAnnotationOkWithLoaderAsInnerInterfaceImpl.java    From nalu with Apache License 2.0 5 votes vote down vote up
@Override
public void loadShells() {
  StringBuilder sb01 = new StringBuilder();
  sb01.append("load shell references");
  ClientLogger.get().logDetailed(sb01.toString(), 2);
  super.shellConfiguration.getShells().add(new ShellConfig("/mockShell", "com.github.nalukit.nalu.processor.common.MockShell"));
  sb01.setLength(0);
  sb01.append("register shell >>/mockShell<< with class >>com.github.nalukit.nalu.processor.common.MockShell<<");
  ClientLogger.get().logDetailed(sb01.toString(), 3);
}
 
Example 18
Source File: ControllerWithComposite02CreatorImpl.java    From nalu with Apache License 2.0 5 votes vote down vote up
@Override
public ControllerInstance create() {
  StringBuilder sb01 = new StringBuilder();
  ControllerInstance controllerInstance = new ControllerInstance();
  controllerInstance.setControllerClassName("com.github.nalukit.nalu.processor.common.ui.controllerWithComposite02.ControllerWithComposite02");
  AbstractComponentController<?, ?, ?> storedController = ControllerFactory.get().getControllerFormStore("com.github.nalukit.nalu.processor.common.ui.controllerWithComposite02.ControllerWithComposite02");
  if (storedController == null) {
    sb01.append("controller >>com.github.nalukit.nalu.processor.common.ui.controllerWithComposite02.ControllerWithComposite02<< --> will be created");
    ClientLogger.get().logSimple(sb01.toString(), 3);
    ControllerWithComposite02 controller = new ControllerWithComposite02();
    controllerInstance.setController(controller);
    controllerInstance.setCached(false);
    controller.setContext(context);
    controller.setEventBus(eventBus);
    controller.setRouter(router);
    controller.setCached(false);
    controller.setRelatedRoute("/mockShell/route02/*");
    controller.setRelatedSelector("selector02");
    sb01.setLength(0);
    sb01.append("controller >>").append(controller.getClass().getCanonicalName()).append("<< --> created and data injected");
    ClientLogger.get().logDetailed(sb01.toString(), 4);
  } else {
    sb01.append("controller >>").append(storedController.getClass().getCanonicalName()).append("<< --> found in cache -> REUSE!");
    ClientLogger.get().logDetailed(sb01.toString(), 4);
    controllerInstance.setController(storedController);
    controllerInstance.setCached(true);
    controllerInstance.getController().setCached(true);
  }
  return controllerInstance;
}
 
Example 19
Source File: ControllerC02CreatorImpl.java    From nalu with Apache License 2.0 5 votes vote down vote up
@Override
public void setParameter(Object object, String... params) throws RoutingInterceptionException {
  ControllerC02 controller = (ControllerC02) object;
  StringBuilder sb01 = new StringBuilder();
  if (params != null) {
    if (params.length >= 1) {
      sb01.setLength(0);
      sb01.append("controller >>").append(controller.getClass().getCanonicalName()).append("<< --> using method >>setParameter01<< to set value >>").append(params[0]).append("<<");
      ClientLogger.get().logDetailed(sb01.toString(), 4);
      controller.setParameter01(params[0]);
    }
  }
}
 
Example 20
Source File: StartRouteOKImpl.java    From nalu with Apache License 2.0 5 votes vote down vote up
@Override
public void loadRoutes() {
  StringBuilder sb01 = new StringBuilder();
  sb01.append("load routes");
  ClientLogger.get().logDetailed(sb01.toString(), 2);
  super.routerConfiguration.getRouters().add(new RouteConfig("/mockShell/route01/*", Arrays.asList(new String[]{"parameter01"}), "selector01", "com.github.nalukit.nalu.processor.common.ui.component01.Controller01"));
  sb01.setLength(0);
  sb01.append("register route >>/mockShell/route01/*<< with parameter >>parameter01<< for selector >>selector01<< for controller >>com.github.nalukit.nalu.processor.common.ui.component01.Controller01<<");
  ClientLogger.get().logDetailed(sb01.toString(), 3);
}