gpt4 book ai didi

net.ymate.platform.core.YMP.getConfig()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 04:16:40 25 4
gpt4 key购买 nike

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

YMP.getConfig介绍

暂无

代码示例

代码示例来源:origin: suninformation/ymate-platform-v2

@Override
public void registerHandler(Class<? extends Annotation> annoClass, IBeanHandler handler) {
  if (!__beanHandlerMap.containsKey(annoClass)) {
    __beanHandlerMap.put(annoClass, handler);
    //
    if (__owner.getConfig().isDevelopMode() && _LOG.isInfoEnabled()) {
      _LOG.info("Handler class [" + annoClass.getSimpleName() + ":" + handler.getClass().getName() + "] registered.");
    }
  } else if (__owner.getConfig().isDevelopMode() && _LOG.isWarnEnabled()) {
    _LOG.warn("Handler class [" + annoClass.getSimpleName() + ":" + handler.getClass().getName() + "] duplicate registration is not allowed");
  }
}

代码示例来源:origin: suninformation/ymate-platform-v2

@Override
public void registerInjector(Class<? extends Annotation> annoClass, IBeanInjector injector) {
  if (!__beanInjectorMap.containsKey(annoClass)) {
    __beanInjectorMap.put(annoClass, injector);
    //
    if (__owner.getConfig().isDevelopMode() && _LOG.isInfoEnabled()) {
      _LOG.info("Injector class [" + annoClass.getSimpleName() + ":" + injector.getClass().getName() + "] registered.");
    }
  } else if (__owner.getConfig().isDevelopMode() && _LOG.isWarnEnabled()) {
    _LOG.warn("Injector class [" + annoClass.getSimpleName() + ":" + injector.getClass().getName() + "] duplicate registration is not allowed");
  }
}

代码示例来源:origin: suninformation/ymate-platform-v2

private static String __doGetConfigValue(YMP owner, String confName, String defaultName) {
  return owner.getConfig().getParam(confName, defaultName);
}

代码示例来源:origin: suninformation/ymate-platform-v2

@Override
  public Object handle(Class<?> targetClass) throws Exception {
    if (targetClass.isInterface() && "package-info".equalsIgnoreCase(targetClass.getSimpleName())) {
      __owner.getConfig().getInterceptSettings().registerInterceptPackage(targetClass);
    }
    return null;
  }
}

代码示例来源:origin: suninformation/ymate-platform-v2

/**
 * 注册自定义注解类处理器,重复注册将覆盖前者
 *
 * @param annoClass 自定义注解类型
 * @param handler   注解对象处理器
 */
public void registerHandler(Class<? extends Annotation> annoClass, IBeanHandler handler) {
  if (annoClass.equals(Event.class) || annoClass.equals(EventRegister.class)
      || annoClass.equals(Injector.class) || annoClass.equals(Interceptor.class)
      || annoClass.equals(Module.class) || annoClass.equals(Packages.class)
      || annoClass.equals(Proxy.class) || annoClass.equals(Serializer.class)) {
    if (getConfig().isDevelopMode() && _LOG.isWarnEnabled()) {
      _LOG.warn("Handler [" + annoClass.getSimpleName() + "] duplicate registration is not allowed");
    }
    return;
  }
  __beanFactory.registerHandler(annoClass, handler);
}

代码示例来源:origin: suninformation/ymate-platform-v2

/**
 * 注册模块实例(此方法仅在YMP框架核心管理器未初始化前有效)
 *
 * @param moduleClass 目标模块类
 */
public void registerModule(Class<? extends IModule> moduleClass) {
  if (!__inited && moduleClass != null) {
    if (!__modules.contains(moduleClass)) {
      __moduleFactory.registerBean(BeanMeta.create(moduleClass, true));
      __modules.add(moduleClass);
    } else if (getConfig().isDevelopMode() && _LOG.isWarnEnabled()) {
      _LOG.warn("Module [" + moduleClass + "] duplicate registration is not allowed");
    }
  }
}

代码示例来源:origin: suninformation/ymate-platform-v2

@Override
  @SuppressWarnings("unchecked")
  public Object handle(Class<?> targetClass) throws Exception {
    if (!targetClass.isInterface()) {
      // 首先判断当前预加载的模块是否存在于被排除列表中,若存在则忽略它
      if (!__owner.getConfig().getExcludedModules().contains(targetClass.getName())) {
        if (ClassUtils.isInterfaceOf(targetClass, IModule.class)) {
          __owner.registerModule((Class<? extends IModule>) targetClass);
        }
      }
    }
    return null;
  }
}

代码示例来源:origin: suninformation/ymate-platform-v2

@Override
public void init(WebMVC owner) throws Exception {
  __owner = owner;
  //
  __errorDefaultViewFormat = StringUtils.trimToEmpty(owner.getOwner().getConfig().getParam(IWebMvcModuleCfg.PARAMS_ERROR_DEFAULT_VIEW_FORMAT)).toLowerCase();
  __analysisDisabled = BlurObject.bind(owner.getOwner().getConfig().getParam(IWebMvcModuleCfg.PARAMS_EXCEPTION_ANALYSIS_DISABLED)).toBooleanValue();
}

代码示例来源:origin: suninformation/ymate-platform-v2

public DefaultServModuleCfg(YMP owner) throws Exception {
  IConfigReader _moduleCfg = MapSafeConfigReader.bind(owner.getConfig().getModuleConfigs(IServ.MODULE_NAME));
  //
  String[] _serverNames = StringUtils.split(_moduleCfg.getString("server.name_list", IServ.Const.DEFAULT_NAME), "|");
  __serverCfgs = new HashMap<String, IServerCfg>(_serverNames.length);
  for (String _name : _serverNames) {
    __serverCfgs.put(_name, new DefaultServerCfg(_moduleCfg.getMap("server." + _name + "."), _name));
  }
  //
  String[] _clientNames = StringUtils.split(_moduleCfg.getString("client.name_list", IServ.Const.DEFAULT_NAME), "|");
  __clientCfgs = new HashMap<String, IClientCfg>(_clientNames.length);
  for (String _name : _clientNames) {
    __clientCfgs.put(_name, new DefaultClientCfg(_moduleCfg.getMap("client." + _name + "."), _name));
  }
}

代码示例来源:origin: suninformation/ymate-platform-v2

private static String __doGetConfigValue(String confName, String defaultName) {
  return getOwner().getOwner().getConfig().getParam(confName, defaultName);
}

代码示例来源:origin: suninformation/ymate-platform-v2

@Override
public void onStarted(IPluginContext context, IPlugin plugin) {
  if (__pluginFactory != null) {
    if (__pluginFactory.getOwner().getConfig().isDevelopMode() && _LOG.isInfoEnabled()) {
      _LOG.info("--> " + context.getPluginMeta().toString() + " started.");
    }
    __owner.getEvents().fireEvent(new PluginEvent(plugin, PluginEvent.EVENT.PLUGIN_STARTED));
  }
}

代码示例来源:origin: suninformation/ymate-platform-v2

@Override
public void onShutdown(IPluginContext context, IPlugin plugin) {
  if (__pluginFactory != null) {
    if (__pluginFactory.getOwner().getConfig().isDevelopMode() && _LOG.isInfoEnabled()) {
      _LOG.info("--> " + context.getPluginMeta().toString() + " shutdown.");
    }
    __owner.getEvents().fireEvent(new PluginEvent(plugin, PluginEvent.EVENT.PLUGIN_SHUTDOWN));
  }
}

代码示例来源:origin: suninformation/ymate-platform-v2

private JSONObject __doGetProtocol(IWebMvc owner) {
  JSONObject _protocol = WebContext.getRequestContext().getAttribute(JSONRequestProcessor.class.getName());
  if (_protocol == null) {
    try {
      _protocol = JSON.parseObject(StringUtils.defaultIfBlank(IOUtils.toString(WebContext.getRequest().getInputStream(), owner.getModuleCfg().getDefaultCharsetEncoding()), "{}"));
    } catch (Exception e) {
      _protocol = JSON.parseObject("{}");
      //
      if (WebContext.getContext().getOwner().getOwner().getConfig().isDevelopMode() && _LOG.isWarnEnabled()) {
        _LOG.warn("Invalid protocol", RuntimeUtils.unwrapThrow(e));
      }
    }
    WebContext.getRequestContext().addAttribute(JSONRequestProcessor.class.getName(), _protocol);
  }
  return _protocol;
}

代码示例来源:origin: suninformation/ymate-platform-v2

@Override
public void onInited(IPluginContext context, IPlugin plugin) {
  if (__pluginFactory != null) {
    if (__pluginFactory.getOwner().getConfig().isDevelopMode() && _LOG.isInfoEnabled()) {
      _LOG.info("--> " + context.getPluginMeta().toString() + " initialized.");
    }
    __owner.getEvents().fireEvent(new PluginEvent(plugin, PluginEvent.EVENT.PLUGIN_INITED));
  }
}

代码示例来源:origin: suninformation/ymate-platform-v2

@Override
  public void onDestroy(IPluginContext context, IPlugin plugin) {
    if (__pluginFactory != null) {
      if (__pluginFactory.getOwner().getConfig().isDevelopMode() && _LOG.isInfoEnabled()) {
        _LOG.info("--> " + context.getPluginMeta().toString() + " destroyed.");
      }
      __owner.getEvents().fireEvent(new PluginEvent(plugin, PluginEvent.EVENT.PLUGIN_DESTROYED));
    }
  }
}

代码示例来源:origin: suninformation/ymate-platform-v2

protected String __doGetPasswordDecryptIfNeed() throws Exception {
  if (StringUtils.isNotBlank(__cfgMeta.getPassword()) && __cfgMeta.isPasswordEncrypted()) {
    if (__cfgMeta.getPasswordClass() != null) {
      return __cfgMeta.getPasswordClass().newInstance().decrypt(__cfgMeta.getPassword());
    }
    return __owner.getOwner().getConfig().getDefaultPasswordClass().newInstance().decrypt(__cfgMeta.getPassword());
  }
  return __cfgMeta.getPassword();
}

代码示例来源:origin: suninformation/ymate-platform-v2

public ConfigInfo(YMP owner) {
  IConfig _config = owner.getConfig();
  //
  this.useBaseEntity = BlurObject.bind(_config.getParam(IDatabaseModuleCfg.PARAMS_JDBC_USE_BASE_ENTITY)).toBooleanValue();
  this.useClassSuffix = BlurObject.bind(_config.getParam(IDatabaseModuleCfg.PARAMS_JDBC_USE_CLASS_SUFFIX)).toBooleanValue();
  this.useChainMode = BlurObject.bind(_config.getParam(IDatabaseModuleCfg.PARAMS_JDBC_USE_CHAIN_MODE)).toBooleanValue();
  this.useStateSupport = BlurObject.bind(_config.getParam(IDatabaseModuleCfg.PARAMS_JDBC_USE_STATE_SUPPORT)).toBooleanValue();
  this.packageName = _config.getParam(IDatabaseModuleCfg.PARAMS_JDBC_PACKAGE_NAME, "packages");
  this.outputPath = RuntimeUtils.replaceEnvVariable(owner.getConfig().getParam(IDatabaseModuleCfg.PARAMS_JDBC_OUTPUT_PATH, "${root}"));
  this.dbName = _config.getParam(IDatabaseModuleCfg.PARAMS_JDBC_DB_NAME);
  this.dbUserName = _config.getParam(IDatabaseModuleCfg.PARAMS_JDBC_DB_USERNAME);
  this.tablePrefixes = Arrays.asList(StringUtils.split(_config.getParam(IDatabaseModuleCfg.PARAMS_JDBC_TABLE_PREFIX, StringUtils.EMPTY), '|'));
  this.removePrefix = new BlurObject(_config.getParam(IDatabaseModuleCfg.PARAMS_JDBC_REMOVE_TABLE_PREFIX)).toBooleanValue();
  this.tableExcludeList = Arrays.asList(StringUtils.split(_config.getParam(IDatabaseModuleCfg.PARAMS_JDBC_TABLE_EXCLUDE_LIST, StringUtils.EMPTY).toLowerCase(), "|"));
  this.tableList = Arrays.asList(StringUtils.split(_config.getParam(IDatabaseModuleCfg.PARAMS_JDBC_TABLE_LIST, StringUtils.EMPTY), "|"));
  //
  this.namedFilter = ClassUtils.impl(_config.getParam(IDatabaseModuleCfg.PARAMS_JDBC_NAMED_FILTER_CLASS), IEntityNamedFilter.class, this.getClass());
  this.readonlyFields = Arrays.asList(StringUtils.split(_config.getParam(IDatabaseModuleCfg.PARAMS_JDBC_READONLY_FIELD_LIST, StringUtils.EMPTY).toLowerCase(), '|'));
}

代码示例来源:origin: suninformation/ymate-platform-v2

private XMLProtocol __doGetProtocol(IWebMvc owner) {
  XMLProtocol _protocol = WebContext.getRequestContext().getAttribute(XMLRequestProcessor.class.getName());
  if (_protocol == null) {
    try {
      _protocol = new XMLProtocol(WebContext.getRequest().getInputStream(), owner.getModuleCfg().getDefaultCharsetEncoding());
    } catch (Exception e) {
      _protocol = new XMLProtocol();
      //
      if (WebContext.getContext().getOwner().getOwner().getConfig().isDevelopMode() && _LOG.isWarnEnabled()) {
        _LOG.warn("Invalid protocol", RuntimeUtils.unwrapThrow(e));
      }
    }
    WebContext.getRequestContext().addAttribute(XMLRequestProcessor.class.getName(), _protocol);
  }
  return _protocol;
}

代码示例来源:origin: suninformation/ymate-platform-v2

public MultilevelCacheWrapper(ICaches owner, String cacheName, Ehcache ehcache, IRedis redis, ICacheEventListener listener) {
  __masterCache = new EhCacheWrapper(owner, ehcache, listener);
  __slaveCache = new RedisCacheWrapper(owner, redis, cacheName, null);
  //
  __slaveCacheAutosync = BlurObject.bind(owner.getOwner().getConfig().getParam(ICacheModuleCfg.PARAMS_CACHE_MULTILEVEL_SLAVE_AUTOSYNC)).toBooleanValue();
}

代码示例来源:origin: suninformation/ymate-platform-v2

public RedisCacheWrapper(ICaches owner, IRedis redis, String cacheName, final ICacheEventListener listener) {
  __owner = owner;
  __redis = redis;
  __cacheName = cacheName;
  __listener = listener;
  __storageWithSet = BlurObject.bind(__owner.getOwner().getConfig().getParam(ICacheModuleCfg.PARAMS_CACHE_STORAGE_WITH_SET)).toBooleanValue();
  __disabledSubscribeExpired = BlurObject.bind(__owner.getOwner().getConfig().getParam(ICacheModuleCfg.PARAMS_CACHE_DISABLED_SUBSCRIBE_EXPIRED)).toBooleanValue();
  //
  if (__listener != null && !__disabledSubscribeExpired) {
    __redis.subscribe(this, "__keyevent@" + __redis.getModuleCfg().getDefaultDataSourceCfg().getMasterServerMeta().getDatabase() + "__:expired");
  }
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com