Package com.caucho.server.resin

Examples of com.caucho.server.resin.Resin


    ThreadPool.getThreadPool().setIdleMin(4);
    ThreadPool.getThreadPool().setPriorityIdleMin(4);

    ResinELContext elContext = _args.getELContext();
   
    Resin resin = Resin.createWatchdog(_system);
   
    if (_args.getDataDirectory() != null)
      resin.setDataDirectory(_args.getDataDirectory());
   
    resin.preConfigureInit();
   
    // XXX: needs to be config

    InjectManager cdiManager = InjectManager.create();

    Config.setProperty("resinHome", elContext.getResinHome());
    Config.setProperty("resin", elContext.getResinVar());
    Config.setProperty("server", elContext.getServerVar());
    Config.setProperty("java", elContext.getJavaVar());
    Config.setProperty("system", System.getProperties());
    Config.setProperty("getenv", System.getenv());

    ResinConfigLibrary.configure(cdiManager);

    _watchdogPort = _args.getWatchdogPort();
   
    readConfig(_args);
   
    WatchdogChild server = null;
   
    String serverId = _args.getServerId();

    if (_args.isDynamicServer()) {
      serverId = _args.getDynamicServerId();
    }
     
    server = _watchdogMap.get(_args.getServerId());

    if (server == null)
      throw new IllegalStateException(L().l("'{0}' is an unknown server",
                                            serverId));
   
    JniBoot boot = new JniBoot();
    Path logDirectory = getLogDirectory();

    if (boot.isValid()) {
      if (! isLogDirectoryExists) {
        logDirectory.mkdirs();

        boot.chown(logDirectory, server.getUserName(), server.getGroupName());
      }
    }

    server.getConfig().logInit(logStream);

    resin.preConfigureInit();
    resin.setConfigFile(_args.getResinConf().getNativePath());

    thread = Thread.currentThread();
    thread.setContextClassLoader(resin.getClassLoader());

    CloudSystem cloudSystem = TopologyService.getCurrent().getSystem();
   
    CloudCluster cluster = cloudSystem.createCluster("watchdog");
    CloudPod pod = cluster.createPod();
    pod.createStaticServer("default", "localhost", -1, false);

    _server = resin.createServer();
   
    thread.setContextClassLoader(_server.getClassLoader());
   
   
    NetworkListenSystem listenService
View Full Code Here


                 + ", " + System.getProperty("java.vm.vendor"));
                 */

        log.info("");

        Resin resin = Resin.getCurrent();

        if (resin != null) {
          log.info("resin.home = " + resin.getResinHome().getNativePath());
          log.info("resin.root = " + resin.getRootDirectory().getNativePath());
          if (resin.getResinConf() != null)
            log.info("resin.conf = " + resin.getResinConf().getNativePath());

          log.info("");

          String serverType;

          if (resin.isWatchdog())
            serverType = "watchdog";
          else
            serverType = "server";

          log.info(serverType + "    = "
View Full Code Here

      _proxyCache = null;
    } finally {
      DynamicClassLoader.setOldLoader(thread, oldLoader);

      Resin resin = _resin;

      if (resin != null)
        resin.destroy();
    }
  }
View Full Code Here

    /**
     * @deprecated backwards compat.
     */
    public Path getRoot()
    {
      Resin resin =  Resin.getLocal();

      return resin == null ? Vfs.getPwd() : resin.getRootDirectory();
    }
View Full Code Here

  private ResinMXBean _resinAdmin;

  public CloudClusterAdmin(CloudCluster cluster)
  {
    _cluster = cluster;
    Resin resin = Resin.getCurrent();
   
    if (resin != null)
      _resinAdmin = resin.getAdmin();
  }
View Full Code Here

  @Configurable
  public void setShutdownWaitMax(Period wait)
  {
    _shutdownWaitTime = wait.getPeriod();

    Resin resin = Resin.getLocal();
    if (resin != null &&
        resin.getShutdownWaitMax() < _shutdownWaitTime) {
      log.warning(L.l("web-app shutdown-wait-max '{0}' is longer than resin shutdown-wait-max '{1}'.",
                      _shutdownWaitTime,
                      resin.getShutdownWaitMax()));
    }
  }
View Full Code Here

    if (! _lifecycle.isActive())
      throw new IllegalStateException(L.l("Can't allocate connection because the connection pool is closed."));

    log.warning(this + " pool overflow");

    Resin resin = Resin.getCurrent();

    if (resin != null) {
      resin.dumpThreads();
    }

    if (startCreateOverflow()) {
      try {
        return createConnection(mcf, subject, info, oldPoolItem);
View Full Code Here

     
      Database database = new Database();
      database.ensureMemoryCapacity(1024 * 1024);
      database.init();

      Resin resin = Resin.getCurrent();
      String serverId = "";

      if (resin != null)
  serverId = resin.getUniqueServerName();

      if ("".equals(serverId))
  serverId = "default";

      String name = "temp_file_" + serverId;
View Full Code Here

                 + ", " + System.getProperty("java.vm.info")
                 + ", " + System.getProperty("java.vm.vendor"));

        log.info("");

        Resin resin = Resin.getCurrent();

        if (resin != null) {
          log.info("resin.home = " + resin.getResinHome().getNativePath());
          log.info("resin.root = " + resin.getRootDirectory().getNativePath());
          if (resin.getResinConf() != null)
            log.info("resin.conf = " + resin.getResinConf().getNativePath());

          log.info("");

          String serverType;

          if (resin.isWatchdog())
            serverType = "watchdog";
          else
            serverType = "server";

          log.info(serverType + "     = "
View Full Code Here

      _hostContainer = null;
      _cache = null;
    } finally {
      DynamicClassLoader.setOldLoader(thread, oldLoader);

      Resin resin = _resin;

      if (resin != null)
        resin.startShutdown(L.l("Resin shutdown from Server.destroy()"));
    }
  }
View Full Code Here

TOP

Related Classes of com.caucho.server.resin.Resin

Copyright © 2018 www.massapicom. 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.