Examples of PlatformManager


Examples of org.gudy.azureus2.platform.PlatformManager

    }
 
  public boolean
  canTraceRoute()
  {
    PlatformManager  pm = PlatformManagerFactory.getPlatformManager();

    return( pm.hasCapability( PlatformManagerCapabilities.TraceRouteAvailability ));
  }
View Full Code Here

Examples of org.gudy.azureus2.platform.PlatformManager

    final int            max_millis,
    final NetworkAdminRouteListener  listener )
 
    throws NetworkAdminException
  {
    PlatformManager  pm = PlatformManagerFactory.getPlatformManager();
     
    if ( !canTraceRoute()){
     
      throw( new NetworkAdminException( "No trace-route capability on platform" ));
    }
   
    final List  nodes = new ArrayList();
   
    try{
      pm.traceRoute(
        interface_address,
        target,
        new PlatformManagerPingCallback()
        {
          private long  start_time = SystemTime.getCurrentTime();
View Full Code Here

Examples of org.gudy.azureus2.platform.PlatformManager

  }
 
  public boolean
  canPing()
  {
    PlatformManager  pm = PlatformManagerFactory.getPlatformManager();

    return( pm.hasCapability( PlatformManagerCapabilities.PingAvailability ));
  }
View Full Code Here

Examples of org.gudy.azureus2.platform.PlatformManager

    final int            max_millis,
    final NetworkAdminRouteListener  listener )
 
    throws NetworkAdminException
  {
    PlatformManager  pm = PlatformManagerFactory.getPlatformManager();
     
    if ( !canPing()){
     
      throw( new NetworkAdminException( "No ping capability on platform" ));
    }
   
    final NetworkAdminNode[] nodes = { null };
   
    try{
      pm.ping(
        interface_address,
        target,
        new PlatformManagerPingCallback()
        {
          private long  start_time = SystemTime.getCurrentTime();
View Full Code Here

Examples of org.gudy.azureus2.platform.PlatformManager

  protected static List platformLoginCompleteListeners = Collections.EMPTY_LIST;

  private static CopyOnWriteList<String> externalLinks = new CopyOnWriteList<String>();
 
  public static void login(long contentNetworkID, long maxDelayMS) {
    PlatformManager pm = PlatformManagerFactory.getPlatformManager();
   
    String sourceRef = null;
    if (contentNetworkID != ConstantsVuze.DEFAULT_CONTENT_NETWORK_ID) {
      ContentNetwork cn = ContentNetworkManagerFactory.getSingleton().getContentNetwork(contentNetworkID);
      sourceRef = (String) cn.getPersistentProperty(ContentNetwork.PP_SOURCE_REF);
View Full Code Here

Examples of org.gudy.azureus2.platform.PlatformManager

  public static void
  checkAssociations()
  { 
    try{
 
        PlatformManager  platform  = PlatformManagerFactory.getPlatformManager();
       
        if ( platform.hasCapability(PlatformManagerCapabilities.RegisterFileAssociations) ){
       
          if ( COConfigurationManager.getBooleanParameter( "config.interface.checkassoc")){
           
            if ( !platform.isApplicationRegistered()){
           
              new AssociationCheckerplatform );
            }
          }
        }
View Full Code Here

Examples of org.vertx.java.platform.PlatformManager

    log.info("Attempting to uninstall module " + modName);
    createPM().uninstallModule(modName, this.<Void>createLoggingHandler("Successfully uninstalled module"));
  }

  private PlatformManager createPM() {
    PlatformManager pm = PlatformLocator.factory.createPlatformManager();
    registerExitHandler(pm);
    return pm;
  }
View Full Code Here

Examples of org.vertx.java.platform.PlatformManager

    registerExitHandler(pm);
    return pm;
  }

  private PlatformManager createPM(int port, String host) {
    PlatformManager pm =  PlatformLocator.factory.createPlatformManager(port, host);
    registerExitHandler(pm);
    return pm;
  }
View Full Code Here

Examples of org.vertx.java.platform.PlatformManager

    });
  }

  private void runVerticle(boolean zip, boolean module, String main, Args args) {
    boolean clustered = args.map.get("-cluster") != null;
    PlatformManager mgr;
    if (clustered) {
      log.info("Starting clustering...");
      int clusterPort = args.getInt("-cluster-port");
      if (clusterPort == -1) {
        // Default to zero - this means choose an ephemeral port
        clusterPort = 0;
      }
      String clusterHost = args.map.get("-cluster-host");
      if (clusterHost == null) {
        clusterHost = getDefaultAddress();
        if (clusterHost == null) {
          log.error("Unable to find a default network interface for clustering. Please specify one using -cluster-host");
          return;
        } else {
          log.info("No cluster-host specified so using address " + clusterHost);
        }
      }
      mgr = createPM(clusterPort, clusterHost);
    } else {
      mgr = createPM();
    }

    String sinstances = args.map.get("-instances");
    int instances;
    if (sinstances != null) {
      try {
        instances = Integer.parseInt(sinstances);

        if (instances != -1 && instances < 1) {
          log.error("Invalid number of instances");
          displaySyntax();
          return;
        }
      } catch (NumberFormatException e) {
        displaySyntax();
        return;
      }
    } else {
      instances = 1;
    }

    String configFile = args.map.get("-conf");
    JsonObject conf;

    if (configFile != null) {
      try (Scanner scanner = new Scanner(new File(configFile)).useDelimiter("\\A")){
        String sconf = scanner.next();
        try {
          conf = new JsonObject(sconf);
        } catch (DecodeException e) {
          log.error("Configuration file does not contain a valid JSON object");
          return;
        }
      } catch (FileNotFoundException e) {
        log.error("Config file " + configFile + " does not exist");
        return;
      }
    } else {
      conf = null;
    }

    Handler<AsyncResult<String>> doneHandler = new Handler<AsyncResult<String>>() {
      public void handle(AsyncResult<String> res) {
        if (res.failed()) {
          // Failed to deploy
          unblock();
        }
      }
    };
    if (zip) {
      mgr.deployModuleFromZip(main, conf, instances, createLoggingHandler("Successfully deployed module from zip", doneHandler));
    } else if (module) {
      mgr.deployModule(main, conf, instances, createLoggingHandler("Successfully deployed module", doneHandler));
    } else {
      boolean worker = args.map.get("-worker") != null;

      String cp = args.map.get("-cp");
      if (cp == null) {
        cp = ".";
      }

      // Convert to URL[]

      String[] parts;

      if (cp.contains(CP_SEPARATOR)) {
        parts = cp.split(CP_SEPARATOR);
      } else {
        parts = new String[] { cp };
      }
      int index = 0;
      final URL[] urls = new URL[parts.length];
      for (String part: parts) {
        try {
          URL url = new File(part).toURI().toURL();
          urls[index++] = url;
        } catch (MalformedURLException e) {
          throw new IllegalArgumentException("Invalid path " + part + " in cp " + cp) ;
        }
      }
      String includes = args.map.get("-includes");
      if (worker) {
        mgr.deployWorkerVerticle(false, main, conf, urls, instances, includes,
                                 createLoggingHandler("Successfully deployed worker verticle", doneHandler));
      } else {
        mgr.deployVerticle(main, conf, urls, instances, includes, createLoggingHandler("Successfully deployed verticle", doneHandler));
      }
    }

    addShutdownHook(mgr);
    block();
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.