org.apache.catalina.Service.setServer()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(95)

本文整理了Java中org.apache.catalina.Service.setServer()方法的一些代码示例,展示了Service.setServer()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Service.setServer()方法的具体详情如下:
包路径:org.apache.catalina.Service
类名称:Service
方法名:setServer

Service.setServer介绍

[英]Set the Server with which we are associated (if any).
[中]设置与我们关联的Server(如果有)。

代码示例

代码示例来源:origin: jboss.web/jbossweb

/**
 * Add a new Service to the set of defined Services.
 *
 * @param service The Service to be added
 */
public void addService(Service service) {
  service.setServer(this);
  synchronized (services) {
    Service results[] = new Service[services.length + 1];
    System.arraycopy(services, 0, results, 0, services.length);
    results[services.length] = service;
    services = results;
    if (initialized) {
      try {
        service.initialize();
      } catch (LifecycleException e) {
        log.error(e);
      }
    }
    if (started && (service instanceof Lifecycle)) {
      try {
        ((Lifecycle) service).start();
      } catch (LifecycleException e) {
        ;
      }
    }
    // Report this property change to interested listeners
    support.firePropertyChange("service", null, service);
  }
}

代码示例来源:origin: tomcat/catalina

/**
 * Add a new Service to the set of defined Services.
 *
 * @param service The Service to be added
 */
public void addService(Service service) {
  service.setServer(this);
  synchronized (services) {
    Service results[] = new Service[services.length + 1];
    System.arraycopy(services, 0, results, 0, services.length);
    results[services.length] = service;
    services = results;
    if (initialized) {
      try {
        service.initialize();
      } catch (LifecycleException e) {
        log.error(e);
      }
    }
    if (started && (service instanceof Lifecycle)) {
      try {
        ((Lifecycle) service).start();
      } catch (LifecycleException e) {
        ;
      }
    }
    // Report this property change to interested listeners
    support.firePropertyChange("service", null, service);
  }
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

/**
 * Add a new Service to the set of defined Services.
 *
 * @param service The Service to be added
 */
@Override
public void addService(Service service) {
  service.setServer(this);
  synchronized (services) {
    Service results[] = new Service[services.length + 1];
    System.arraycopy(services, 0, results, 0, services.length);
    results[services.length] = service;
    services = results;
    if (getState().isAvailable()) {
      try {
        service.start();
      } catch (LifecycleException e) {
        // Ignore
      }
    }
    // Report this property change to interested listeners
    support.firePropertyChange("service", null, service);
  }
}

代码示例来源:origin: org.glassfish.main.web/web-core

service.setServer(this);

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

/**
 * Add a new Service to the set of defined Services.
 *
 * @param service The Service to be added
 */
@Override
public void addService(Service service) {
  service.setServer(this);
  synchronized (servicesLock) {
    Service results[] = new Service[services.length + 1];
    System.arraycopy(services, 0, results, 0, services.length);
    results[services.length] = service;
    services = results;
    if (getState().isAvailable()) {
      try {
        service.start();
      } catch (LifecycleException e) {
        // Ignore
      }
    }
    // Report this property change to interested listeners
    support.firePropertyChange("service", null, service);
  }
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

/**
 * Add a new Service to the set of defined Services.
 *
 * @param service The Service to be added
 */
@Override
public void addService(Service service) {
  service.setServer(this);
  synchronized (servicesLock) {
    Service results[] = new Service[services.length + 1];
    System.arraycopy(services, 0, results, 0, services.length);
    results[services.length] = service;
    services = results;
    if (getState().isAvailable()) {
      try {
        service.start();
      } catch (LifecycleException e) {
        // Ignore
      }
    }
    // Report this property change to interested listeners
    support.firePropertyChange("service", null, service);
  }
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7

/**
 * Add a new Service to the set of defined Services.
 *
 * @param service The Service to be added
 */
@Override
public void addService(Service service) {
  service.setServer(this);
  synchronized (services) {
    Service results[] = new Service[services.length + 1];
    System.arraycopy(services, 0, results, 0, services.length);
    results[services.length] = service;
    services = results;
    if (getState().isAvailable()) {
      try {
        service.start();
      } catch (LifecycleException e) {
        // Ignore
      }
    }
    // Report this property change to interested listeners
    support.firePropertyChange("service", null, service);
  }
}

代码示例来源:origin: codefollower/Tomcat-Research

/**
 * Add a new Service to the set of defined Services.
 *
 * @param service The Service to be added
 */
@Override
public void addService(Service service) {
  service.setServer(this);
  synchronized (servicesLock) {
    Service results[] = new Service[services.length + 1];
    System.arraycopy(services, 0, results, 0, services.length);
    results[services.length] = service;
    services = results;
    if (getState().isAvailable()) {
      try {
        service.start();
      } catch (LifecycleException e) {
        // Ignore
      }
    }
    // Report this property change to interested listeners
    support.firePropertyChange("service", null, service);
  }
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina

/**
 * Add a new Service to the set of defined Services.
 *
 * @param service The Service to be added
 */
@Override
public void addService(Service service) {
  service.setServer(this);
  synchronized (services) {
    Service results[] = new Service[services.length + 1];
    System.arraycopy(services, 0, results, 0, services.length);
    results[services.length] = service;
    services = results;
    if (getState().isAvailable()) {
      try {
        service.start();
      } catch (LifecycleException e) {
        // Ignore
      }
    }
    // Report this property change to interested listeners
    support.firePropertyChange("service", null, service);
  }
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

/**
 * Add a new Service to the set of defined Services.
 *
 * @param service The Service to be added
 */
@Override
public void addService(Service service) {
  service.setServer(this);
  synchronized (services) {
    Service results[] = new Service[services.length + 1];
    System.arraycopy(services, 0, results, 0, services.length);
    results[services.length] = service;
    services = results;
    if (getState().isAvailable()) {
      try {
        service.start();
      } catch (LifecycleException e) {
        // Ignore
      }
    }
    // Report this property change to interested listeners
    support.firePropertyChange("service", null, service);
  }
}

代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina

/**
 * Add a new Service to the set of defined Services.
 *
 * @param service The Service to be added
 */
@Override
public void addService(Service service) {
  service.setServer(this);
  synchronized (services) {
    Service results[] = new Service[services.length + 1];
    System.arraycopy(services, 0, results, 0, services.length);
    results[services.length] = service;
    services = results;
    if (getState().isAvailable()) {
      try {
        service.start();
      } catch (LifecycleException e) {
        // Ignore
      }
    }
    // Report this property change to interested listeners
    support.firePropertyChange("service", null, service);
  }
}

代码示例来源:origin: org.jboss.web/jbossweb

/**
 * Add a new Service to the set of defined Services.
 *
 * @param service The Service to be added
 */
public void addService(Service service) {
  service.setServer(this);
  synchronized (services) {
    Service results[] = new Service[services.length + 1];
    System.arraycopy(services, 0, results, 0, services.length);
    results[services.length] = service;
    services = results;
    if (initialized) {
      try {
        service.initialize();
      } catch (LifecycleException e) {
        CatalinaLogger.CORE_LOGGER.errorInitializingService(e);
      }
    }
    if (started && (service instanceof Lifecycle)) {
      try {
        ((Lifecycle) service).start();
      } catch (LifecycleException e) {
        CatalinaLogger.CORE_LOGGER.errorStartingService(e);
      }
    }
    // Report this property change to interested listeners
    support.firePropertyChange("service", null, service);
  }
}

代码示例来源:origin: org.jboss.jbossas/jboss-as-tomcat

addLifecycleListeners(service, serviceMetaData.getListeners());
service.setName(serviceMetaData.getName());
service.setServer(catalinaServer);
catalinaServer.addService(service);

相关文章