org.apache.catalina.LifecycleException.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(8.4k)|赞(0)|评价(0)|浏览(61)

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

LifecycleException.<init>介绍

[英]Construct a new LifecycleException with no other information.
[中]在没有其他信息的情况下构造新的LifecycleException。

代码示例

代码示例来源:origin: org.springframework.boot/spring-boot

@Override
protected void initInternal() throws LifecycleException {
  if (this.delegate instanceof LifecycleBase) {
    try {
      ReflectionUtils.invokeMethod(this.initInternal, this.delegate);
    }
    catch (Exception ex) {
      throw new LifecycleException(ex);
    }
  }
}

代码示例来源:origin: redisson/redisson

@Override
protected RedissonClient buildClient() throws LifecycleException {
  InitialContext context = null;
  try {
    context = new InitialContext();
    Context envCtx = (Context) context.lookup("java:comp/env");
    return (RedissonClient) envCtx.lookup(jndiName);
  } catch (NamingException e) {
    throw new LifecycleException("Unable to locate Redisson instance by name: " + jndiName, e);
  } finally {
    if (context != null) {
      try {
        context.close();
      } catch (NamingException e) {
        throw new LifecycleException("Unable to close JNDI context", e);
      }
    }
  }
}

代码示例来源:origin: redisson/redisson

@Override
protected RedissonClient buildClient() throws LifecycleException {
  InitialContext context = null;
  try {
    context = new InitialContext();
    Context envCtx = (Context) context.lookup("java:comp/env");
    return (RedissonClient) envCtx.lookup(jndiName);
  } catch (NamingException e) {
    throw new LifecycleException("Unable to locate Redisson instance by name: " + jndiName, e);
  } finally {
    if (context != null) {
      try {
        context.close();
      } catch (NamingException e) {
        throw new LifecycleException("Unable to close JNDI context", e);
      }
    }
  }
}

代码示例来源:origin: redisson/redisson

@Override
protected RedissonClient buildClient() throws LifecycleException {
  InitialContext context = null;
  try {
    context = new InitialContext();
    Context envCtx = (Context) context.lookup("java:comp/env");
    return (RedissonClient) envCtx.lookup(jndiName);
  } catch (NamingException e) {
    throw new LifecycleException("Unable to locate Redisson instance by name: " + jndiName, e);
  } finally {
    if (context != null) {
      try {
        context.close();
      } catch (NamingException e) {
        throw new LifecycleException("Unable to close JNDI context", e);
      }
    }
  }
}

代码示例来源:origin: redisson/redisson

@Override
protected RedissonClient buildClient() throws LifecycleException {
  InitialContext context = null;
  try {
    context = new InitialContext();
    Context envCtx = (Context) context.lookup("java:comp/env");
    return (RedissonClient) envCtx.lookup(jndiName);
  } catch (NamingException e) {
    throw new LifecycleException("Unable to locate Redisson instance by name: " + jndiName, e);
  } finally {
    if (context != null) {
      try {
        context.close();
      } catch (NamingException e) {
        throw new LifecycleException("Unable to close JNDI context", e);
      }
    }
  }
}

代码示例来源:origin: redisson/redisson

protected RedissonClient buildClient() throws LifecycleException {
  Config config = null;
  try {
    config = Config.fromJSON(new File(configPath), getClass().getClassLoader());
  } catch (IOException e) {
    // trying next format
    try {
      config = Config.fromYAML(new File(configPath), getClass().getClassLoader());
    } catch (IOException e1) {
      log.error("Can't parse json config " + configPath, e);
      throw new LifecycleException("Can't parse yaml config " + configPath, e1);
    }
  }
  
  try {
    return Redisson.create(config);
  } catch (Exception e) {
    throw new LifecycleException(e);
  }
}

代码示例来源:origin: redisson/redisson

@Override
public void stop() throws LifecycleException {
  try {
    shutdownRedisson();
  } catch (Exception e) {
    throw new LifecycleException(e);
  }
  
  lifecycle.fireLifecycleEvent(STOP_EVENT, null);
}

代码示例来源:origin: redisson/redisson

protected RedissonClient buildClient() throws LifecycleException {
  Config config = null;
  try {
    config = Config.fromJSON(new File(configPath), getClass().getClassLoader());
  } catch (IOException e) {
    // trying next format
    try {
      config = Config.fromYAML(new File(configPath), getClass().getClassLoader());
    } catch (IOException e1) {
      log.error("Can't parse json config " + configPath, e);
      throw new LifecycleException("Can't parse yaml config " + configPath, e1);
    }
  }
  
  try {
    return Redisson.create(config);
  } catch (Exception e) {
    throw new LifecycleException(e);
  }
}

代码示例来源:origin: redisson/redisson

protected RedissonClient buildClient() throws LifecycleException {
  Config config = null;
  try {
    config = Config.fromJSON(new File(configPath), getClass().getClassLoader());
  } catch (IOException e) {
    // trying next format
    try {
      config = Config.fromYAML(new File(configPath), getClass().getClassLoader());
    } catch (IOException e1) {
      log.error("Can't parse json config " + configPath, e);
      throw new LifecycleException("Can't parse yaml config " + configPath, e1);
    }
  }
  
  try {
    return Redisson.create(config);
  } catch (Exception e) {
    throw new LifecycleException(e);
  }
}

代码示例来源:origin: redisson/redisson

protected RedissonClient buildClient() throws LifecycleException {
  Config config = null;
  try {
    config = Config.fromJSON(new File(configPath), getClass().getClassLoader());
  } catch (IOException e) {
    // trying next format
    try {
      config = Config.fromYAML(new File(configPath), getClass().getClassLoader());
    } catch (IOException e1) {
      log.error("Can't parse json config " + configPath, e);
      throw new LifecycleException("Can't parse yaml config " + configPath, e1);
    }
  }
  
  try {
    try {
    Config c = new Config(config);
    Codec codec = c.getCodec().getClass().getConstructor(ClassLoader.class)
            .newInstance(Thread.currentThread().getContextClassLoader());
    config.setCodec(codec);
    } catch (Exception e) {
      throw new IllegalStateException("Unable to initialize codec with ClassLoader parameter", e);
    }
    
    return Redisson.create(config);
  } catch (Exception e) {
    throw new LifecycleException(e);
  }
}

代码示例来源:origin: redisson/redisson

@Override
protected void stopInternal() throws LifecycleException {
  super.stopInternal();
  
  setState(LifecycleState.STOPPING);
  
  try {
    shutdownRedisson();
  } catch (Exception e) {
    throw new LifecycleException(e);
  }
  
}

代码示例来源:origin: redisson/redisson

@Override
protected void stopInternal() throws LifecycleException {
  super.stopInternal();
  
  setState(LifecycleState.STOPPING);
  
  try {
    shutdownRedisson();
  } catch (Exception e) {
    throw new LifecycleException(e);
  }
  
}

代码示例来源:origin: redisson/redisson

@Override
protected void stopInternal() throws LifecycleException {
  super.stopInternal();
  
  setState(LifecycleState.STOPPING);
  
  try {
    shutdownRedisson();
  } catch (Exception e) {
    throw new LifecycleException(e);
  }
  
}

代码示例来源:origin: apache/geode

load();
} catch (ClassNotFoundException e) {
 throw new LifecycleException("Exception starting manager", e);
} catch (IOException e) {
 throw new LifecycleException("Exception starting manager", e);

代码示例来源:origin: apache/geode

load();
} catch (ClassNotFoundException e) {
 throw new LifecycleException("Exception starting manager", e);
} catch (IOException e) {
 throw new LifecycleException("Exception starting manager", e);

代码示例来源:origin: apache/geode

load();
} catch (ClassNotFoundException e) {
 throw new LifecycleException("Exception starting manager", e);
} catch (IOException e) {
 throw new LifecycleException("Exception starting manager", e);

代码示例来源:origin: magro/memcached-session-manager

/**
 * {@inheritDoc}
 */
@Override
public void stop() throws LifecycleException {
  if (log.isDebugEnabled()) {
    log.debug("Stopping");
  }
  // Validate and update our current component state
  if (!_started) {
    throw new LifecycleException
      (sm.getString("standardManager.notStarted"));
  }
  _lifecycle.fireLifecycleEvent(STOP_EVENT, null);
  _started = false;
  // Require a new random number generator if we are restarted
  random = null;
  if ( initialized ) {
    if ( _msm.isSticky() ) {
      _log.info( "Removing sessions from local session map." );
      for( final Session session : sessions.values() ) {
        swapOut( (StandardSession) session );
      }
    }
    _msm.shutdown();
    destroy();
  }
}

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

@Override
protected void startInternal() throws LifecycleException {
  throw new LifecycleException(
      sm.getString("failedContext.start", getName()));
}

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

@Override
protected synchronized void startInternal() throws LifecycleException {
  if (!allowValid || !denyValid) {
    throw new LifecycleException(
        sm.getString("requestFilterValve.configInvalid"));
  }
  super.startInternal();
}

代码示例来源:origin: apereo/java-cas-client

public void start() throws LifecycleException {
  super.start();
  try {
    CommonUtils.assertNotNull(this.proxyCallbackUrl, "the proxy callback url cannot  be null");
    CommonUtils.assertTrue(this.proxyCallbackUrl.startsWith("/"), "proxy callback url must start with \"/\"");
    PROXY_GRANTING_TICKET_STORAGE = ReflectUtils.newInstance(proxyGrantingTicketStorageClass);
  } catch (final Exception e) {
    throw new LifecycleException(e);
  }
  logger.info("Startup completed.");
}

相关文章

微信公众号

最新文章

更多