类 DebugContextManager

java.lang.Object
cn.nkpro.elcube.co.DebugContextManager
所有已实现的接口:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

@Component public class DebugContextManager extends Object implements org.springframework.context.ApplicationContextAware
此类的命名有些不合理,事实上它就是ApplicationContextManager

这个类管理着所有自定义对象的不同状态,激活与调试

甚至管理系统中运行中的调试Context

它根据上下文中的debug参数,来给运行时程序返回一个合理的Bean对象 同时它接收运行时程序需要调试、或者取消调试的命令

根据 startThreadLocal(String) 来启动当前线程为调试模式,从指定的调试上下文中获取运行实例Bean

根据 addDebugResource(String, Object) 向指定的调试上下文中覆盖一个需要调试的对象

根据 addActiveResource(String, NkScriptV, boolean) 向指定的调试上下文中覆盖一个需要激活的对象

调试时,日志在前端的输出也是由它来处理,通过重写System.out,来截取线程中的log信息

  • 构造器详细资料

    • DebugContextManager

      public DebugContextManager()
  • 方法详细资料

    • getDebugContextList

      public Collection<DebugContextManager.ContextDescribe> getDebugContextList()
      返回上下文列表
    • createContext

      public String createContext(String desc, String username)
      创建上下文
    • removeContext

      public void removeContext(String debugId)
      停止一个上下文
    • addDebugResource

      public void addDebugResource(String key, Object resource)
      向debug缓存中添加一个需要调试的资源,如: 前缀 $:脚本Vue对象 前缀 @:单据DocType配置
    • addActiveResource

      public void addActiveResource(String key, NkScriptV scriptDef, boolean rewrite)
    • removeDebugResource

      public void removeDebugResource(String key, Object resource)
    • isDebug

      public boolean isDebug()
    • getDebugResource

      public <T> T getDebugResource(String key)
      获取当前debug的缓存中获取单个资源
    • getDebugResources

      public <T> List<T> getDebugResources(String... keyPrefix)
    • getApplicationContext

      public org.springframework.context.ApplicationContext getApplicationContext()
      获取当前debug的上下文对象
    • setApplicationContext

      public void setApplicationContext(@NotNull @NotNull org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
      指定者:
      setApplicationContext 在接口中 org.springframework.context.ApplicationContextAware
      抛出:
      org.springframework.beans.BeansException