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

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

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

Service.initialize介绍

[英]Invoke a pre-startup initialization. This is used to allow connectors to bind to restricted ports under Unix operating environments.
[中]调用启动前初始化。这用于允许连接器在Unix操作环境下绑定到受限端口。

代码示例

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

/**
 * Invoke a pre-startup initialization. This is used to allow connectors
 * to bind to restricted ports under Unix operating environments.
 */
public void initialize()
  throws LifecycleException 
{
  if (initialized) {
    log.log(Level.INFO, LogFacade.STANDARD_SERVER_INITIALIZE_INITIALIZED);
    return;
  }
  // START GlassFish 2439
  lifecycle.fireLifecycleEvent(INIT_EVENT, null);
  // END GlassFish 2439
  initialized = true;
  if( oname==null ) {
    try {
      oname=new ObjectName( "Catalina:type=Server");
    } catch (Exception e) {
      String msg = MessageFormat.format(rb.getString(LogFacade.ERROR_REGISTERING), e.toString());
      log.log(Level.SEVERE, msg, e);
    }
  }
  
  // Initialize our defined Services
  for (int i = 0; i < services.length; i++) {
    services[i].initialize();
  }
}

代码示例来源: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: 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: org.glassfish.main.web/web-core

service.initialize();
} catch (LifecycleException e) {
  String msg = MessageFormat.format(rb.getString(

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

service=new StandardService();
service.setContainer( this );
service.initialize();

代码示例来源: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: tomcat/catalina

services[i].initialize();

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

services[i].initialize();

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

service=new StandardService();
  service.setContainer( this );
  service.initialize();
} catch( Throwable t ) {
  log.error(t);

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

service=new StandardService();
  service.setContainer( this );
  service.initialize();
} catch( Throwable t ) {
  log.error(t);

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

services[i].initialize();

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

service=new StandardService();
  service.setContainer( this );
  service.initialize();
} catch( Throwable t ) {
  CatalinaLogger.CORE_LOGGER.failedServiceCreation(t);

相关文章