Tabnine Logo
Bootstrap
Code IndexAdd Tabnine to your IDE (free)

How to use
Bootstrap
in
vip.justlive.oxygen.core

Best Java code snippets using vip.justlive.oxygen.core.Bootstrap (Showing top 8 results out of 315)

origin: justlive1/oxygen

/**
 * 启动Bootstrap
 */
public static void start() {
 if (STATE.compareAndSet(false, true)) {
  log.info("starting bootstrap ...");
  initConfig();
  addSystemPlugin();
  initPlugins();
  registerShutdownHook();
  log.info("bootstrap has started ! have fun");
 }
}
origin: justlive1/oxygen

/**
 * 关闭Bootstrap
 */
public static synchronized void close() {
 doClose();
 Runtime.getRuntime().removeShutdownHook(SHUTDOWN_HOOK);
}
origin: justlive1/oxygen

@Override
public void onStartup(ServletContext context) {
 Bootstrap.start();
 Dynamic dynamic = context
   .addServlet(DispatcherServlet.class.getSimpleName(), DispatcherServlet.class);
 dynamic.setLoadOnStartup(0);
 dynamic.addMapping(Constants.ROOT_PATH);
 dynamic.setAsyncSupported(true);
}
origin: justlive1/oxygen

private void doService(HttpServletRequest req, HttpServletResponse resp, HttpMethod httpMethod) {
 String requestPath = req.getServletPath();
 if (log.isDebugEnabled()) {
  log.debug("DispatcherServlet accept request for [{}] on method [{}]", requestPath,
    httpMethod);
 }
 Request.set(req);
 Response.set(resp);
 if (requestPath.length() > 1) {
  if (requestPath.endsWith(Constants.ROOT_PATH)) {
   requestPath = requestPath.substring(0, requestPath.length() - 1);
  }
 }
 try {
  Action action = WebPlugin.findActionByPath(requestPath, httpMethod);
  if (action == null) {
   handlerNotFound(req, resp);
   return;
  }
  Bootstrap.invokeBeforePlugins();
  handlerAction(action, req, resp);
  Bootstrap.invokeAfterPlugins();
 } catch (StaticException e) {
  handlerStatic(req, resp, e.getSource());
 } finally {
  Bootstrap.invokeFinalPlugins();
  Request.clear();
  Response.clear();
 }
}
origin: justlive1/oxygen

/**
 * 初始化配置
 * <br>
 * 使用默认地址进行加载,然后使用覆盖路径再次加载
 */
public static void initConfig() {
 initConfig(Constants.CONFIG_PATHS);
}
origin: justlive1/oxygen

private void handlerError(HttpServletRequest req, HttpServletResponse resp, Exception e) {
 log.error("DispatcherServlet occurs an error for path [{}]", req.getServletPath(), e);
 Bootstrap.invokeOnExceptionPlugins();
 Request.current().setException(e);
 WebPlugin.ERROR_HANDLERS.get(Constants.SERVER_ERROR).handle(req, resp);
}
origin: justlive1/earth-frost

/**
 * 初始化executor
 */
public static void initExecutor() {
 Bootstrap.start();
 // monitor
 BeanStore.putBean(TimeoutMonitorImpl.class.getName(), new TimeoutMonitorImpl());
 // registry
 Registry registry = new RedisRegistry();
 registry.register();
}
origin: justlive1/earth-frost

 @PostConstruct
 public void initCenter() {
  Bootstrap.start();
  RedissonClient redissonClient = BeanStore.getBean(RedissonClient.class);
  JobRepository jobRepository = BeanStore.getBean(JobRepository.class);
  // schedule
  BeanStore.putBean(RedisJobScheduleImpl.class.getName(), new RedisJobScheduleImpl());
  // dispatcher
  BeanStore.putBean(RedisDispatcher.class.getName(),
    new RedisDispatcher(redissonClient, jobRepository));
  redissonClient.getExecutorService(JobConfig.EVENT)
    .registerWorkers(ConfigFactory.load(SystemProperties.class).getWorkers());
  BeanStore.putBean(EventListener.class.getName(), new EventListener(notifier));
 }
}
vip.justlive.oxygen.coreBootstrap

Javadoc

引导类
用于加载程序启动需要的配置

Most used methods

  • start
    启动Bootstrap
  • addSystemPlugin
    添加系统插件类
  • doClose
    关闭Bootstrap
  • initConfig
    初始化配置
  • initPlugins
    初始化插件
  • invokeAfterPlugins
    执行插件后置逻辑
  • invokeBeforePlugins
    执行插件前置逻辑
  • invokeFinalPlugins
    执行插件最终逻辑
  • invokeOnExceptionPlugins
    执行插件异常逻辑
  • registerShutdownHook
    注册shutdown钩子

Popular in Java

  • Updating database using SQL prepared statement
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getExternalFilesDir (Context)
  • addToBackStack (FragmentTransaction)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Reference (javax.naming)
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now