程序包 cool.scx.core

类 ScxContext

java.lang.Object
cool.scx.core.ScxContext

public final class ScxContext extends Object
用来存储 整个项目的上下文
版本:
1.11.8
作者:
scx567888
  • 构造器详细资料

    • ScxContext

      public ScxContext()
  • 方法详细资料

    • scx

      public static Scx scx()
      获取全局的 Scx
      返回:
      scx
    • featureConfig

      public static ScxFeatureConfig featureConfig()
      a
      返回:
      a
    • config

      public static ScxConfig config()
      a
      返回:
      a
    • dataSource

      public static DataSource dataSource()
      获取 dao
      返回:
      d
    • httpServer

      public static io.vertx.core.http.HttpServer httpServer()
      a
      返回:
      a
    • eventBus

      public static io.vertx.core.eventbus.EventBus eventBus()
      a
      返回:
      a
    • webSocketRouter

      public static WebSocketRouter webSocketRouter()
      a
      返回:
      a
    • environment

      public static ScxEnvironment environment()

      appRoot.

      返回:
      a File object
    • appKey

      public static String appKey()

      appKey.

      返回:
      a String object
    • scxModules

      public static ScxModule[] scxModules()
      所有模块
      返回:
      a List object.
    • options

      public static ScxOptions options()
      a
      返回:
      a
    • beanFactory

      public static org.springframework.beans.factory.BeanFactory beanFactory()
      返回当前运行的 scx 实例的 beanFactory
      返回:
      a
    • router

      public static ScxHttpRouter router()
      a
      返回:
      a
    • vertx

      public static io.vertx.core.Vertx vertx()
      返回当前运行的 scx 实例的 vertx
      返回:
      全局的事件总线
    • scheduler

      public static ScxScheduler scheduler()
      返回当前运行的 scx 实例的 scheduler
      返回:
      a
    • scxMvc

      public static ScxMvc scxMvc()
      返回当前运行的 scx 实例的 scxMappingConfiguration
      返回:
      a
    • getFeatureState

      public static boolean getFeatureState(ScxCoreFeature scxFeature)
      简化方法
      参数:
      scxFeature - a
      返回:
      a
    • sqlRunner

      public static SQLRunner sqlRunner()
      简化方法
      返回:
      a
    • autoTransaction

      public static void autoTransaction(cool.scx.functional.ScxRunnable<?> handler)
      避免冗长的 调用
      参数:
      handler - handler
    • autoTransaction

      public static <T> T autoTransaction(Callable<T> handler)
      避免冗长的 调用
      类型参数:
      T - a
      参数:
      handler - a
      返回:
      a
    • getBean

      public static <T> T getBean(Class<T> requiredType)
      简化方法
      类型参数:
      T - r
      参数:
      requiredType - r
      返回:
      r
    • findScxModule

      public static <T extends ScxModule> T findScxModule(Class<T> clazz)
      简化方法
      类型参数:
      T - a T class
      参数:
      clazz - a Class object
      返回:
      a 模块
    • getPathByAppRoot

      public static Path getPathByAppRoot(String path)
      简化方法
      参数:
      path - a
      返回:
      a
    • getTempPath

      public static Path getTempPath()
      获取临时路径
      返回:
      a
    • getTempPath

      public static Path getTempPath(String... paths)
      获取临时路径
      参数:
      paths - a
      返回:
      a
    • jdbcContext

      public static JDBCContext jdbcContext()