Examples of CacheModel


Examples of org.g4studio.core.orm.xibatis.sqlmap.engine.cache.CacheModel

   * @param id
   *            - the ID
   * @return - the cache model
   */
  public CacheModel getCacheModel(String id) {
    CacheModel model = (CacheModel) cacheModels.get(id);
    if (model == null) {
      throw new SqlMapException("There is no cache model named " + id + " in this SqlMap.");
    }
    return model;
  }
View Full Code Here

Examples of org.g4studio.core.orm.xibatis.sqlmap.engine.cache.CacheModel

   *
   * @param id
   *            - the ID
   */
  public void flushDataCache(String id) {
    CacheModel model = getCacheModel(id);
    if (model != null) {
      model.flush();
    }
  }
View Full Code Here

Examples of org.g4studio.core.orm.xibatis.sqlmap.engine.cache.CacheModel

  private CacheModel cacheModel;

  CacheModelConfig(SqlMapConfiguration config, String id, CacheController controller, boolean readOnly,
      boolean serialize) {
    this.errorContext = config.getErrorContext();
    this.cacheModel = new CacheModel();
    SqlMapClientImpl client = config.getClient();
    errorContext.setActivity("building a cache model");
    cacheModel.setReadOnly(readOnly);
    cacheModel.setSerialize(serialize);
    errorContext.setObjectId(id + " cache model");
View Full Code Here

Examples of org.g4studio.core.orm.xibatis.sqlmap.engine.cache.CacheModel

    }
    errorContext.setMoreInfo(null);
    errorContext.setObjectId(null);
    statement.setSqlMapClient(client);
    if (cacheModelName != null && cacheModelName.length() > 0 && client.getDelegate().isCacheModelsEnabled()) {
      CacheModel cacheModel = client.getDelegate().getCacheModel(cacheModelName);
      mappedStatement = new CachingStatement(statement, cacheModel);
    } else {
      mappedStatement = statement;
    }
    rootStatement = statement;
View Full Code Here

Examples of org.g4studio.core.orm.xibatis.sqlmap.engine.cache.CacheModel

  private void wireUpCacheModels() {
    // Wire Up Cache Models
    Iterator cacheNames = client.getDelegate().getCacheModelNames();
    while (cacheNames.hasNext()) {
      String cacheName = (String) cacheNames.next();
      CacheModel cacheModel = client.getDelegate().getCacheModel(cacheName);
      Iterator statementNames = cacheModel.getFlushTriggerStatementNames();
      while (statementNames.hasNext()) {
        String statementName = (String) statementNames.next();
        MappedStatement statement = client.getDelegate().getMappedStatement(statementName);
        if (statement != null) {
          statement.addExecuteListener(cacheModel);
View Full Code Here

Examples of org.jrest4guice.persistence.ibatis.annotations.Cachemodel

  }

  private static void processCacheModel(Class<?> clazz,
      StringBuffer cacheModelSb) {
    if (clazz.isAnnotationPresent(Cachemodel.class)) {
      Cachemodel annotation = clazz.getAnnotation(Cachemodel.class);
      String id = annotation.id();
      // 检查当前parameterMap是否已经在其它dao中声明并解析过了
      if (cacheModelIds.contains(id))
        return;
      cacheModelIds.add(id);

      String[] flushOnExecute = annotation.flushOnExecute();

      cacheModelSb.append("  <cacheModel id=\"" + id
          + "\" type=\"" + annotation.type()
          + "\">");

      cacheModelSb.append("\n    <flushInterval hours=\""
          + annotation.flushInterval() + "\"/>");
      for (String statement : flushOnExecute) {
        cacheModelSb.append("\n    <flushOnExecute statement=\""
            + statement + "\"/>");
      }
     
      Property[] properties = annotation.property();
      for(Property property :properties){
        cacheModelSb.append("\n    <property"+
            " name=\""+ property.name() + "\""+
            " value=\""+ property.value() + "\""+
            "/>");
View Full Code Here

Examples of org.springmodules.cache.CacheModel

    };
    source.setCacheModels(cacheModels);
  }

  private CacheModel putNewCacheModelInMap(String key) {
    CacheModel model = new CacheModel() {
      private static final long serialVersionUID = 4608839803287089680L;
    };
    cacheModels.put(key, model);
    return model;
  }
View Full Code Here

Examples of org.springmodules.cache.CacheModel

   *          the definition of the intercepted method
   * @return the model bound to the intercepted method
   */
  protected final CacheModel getCacheModel(Method method) {
    String methodName = method.getName();
    CacheModel model = (CacheModel) cacheModels.get(methodName);

    if (model == null) {
      // look up most specific name match
      String bestNameMatch = null;

View Full Code Here

Examples of org.springmodules.cache.CacheModel

    models = m;
  }

  public CacheModel model(Method m) {
    String key = m.getName();
    CacheModel model = model(key);
    if (model != null) return model;
    return mostSpecificModel(key);
  }
View Full Code Here

Examples of org.springmodules.cache.CacheModel

    if (model != null) return model;
    return mostSpecificModel(key);
  }

  private CacheModel mostSpecificModel(String method) {
    CacheModel model = null;
    String bestMatch = null;
    for (Iterator i = models.keySet().iterator(); i.hasNext();) {
      String mapped = (String)i.next();
      if (!mostSpecificMethodFound(method, bestMatch, mapped)) continue;
      model = model(mapped);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.