예제 #1
0
  private void updatePort(Widget widget) {
    if (widget.getRequiredPorts() != null) {
      for (Port port : widget.getRequiredPorts()) {

        Port existingPort = portService.getPortByName(port.getName());

        if (existingPort == null) {
          portService.createPort(port);
          port.getWidgets().add(widget);
        }
      }
    }
  }
 @Override
 public void init() throws Exception {
   super.init();
   cumulonimbusDir =
       new File(
           C1Services.getInstance().getRuntimeInfo().getHomeDirectory(),
           CumulonimbusApp.BASE_DIR_NAME);
   if (!cumulonimbusDir.exists()) {
     if (!cumulonimbusDir.mkdirs()) {
       throw new IOException(
           "Cumulonimbus home directory "
               + cumulonimbusDir.getPath()
               + " does not exists and cannot be created!");
     }
   }
   Properties properties = loadConfiguration(cumulonimbusDir);
   PortService portService = PortService.init(properties);
   ResourceRegistryService resourceRegistry = ResourceRegistryService.getInstance();
   ServiceRegistryService.init(
       cumulonimbusDir, portService.getNewListener(), resourceRegistry.getNewListener());
 }