示例#1
0
 public static String getEntityEcaReaderName(String delegatorName) {
   DelegatorInfo delegatorInfo = EntityConfigUtil.getDelegatorInfo(delegatorName);
   if (delegatorInfo == null) {
     Debug.logError(
         "BAD ERROR: Could not find delegator config with name: " + delegatorName, module);
     return null;
   }
   return delegatorInfo.entityEcaReader;
 }
示例#2
0
  public static ModelReader getModelReader(String delegatorName) throws GenericEntityException {
    DelegatorInfo delegatorInfo = EntityConfigUtil.getDelegatorInfo(delegatorName);

    if (delegatorInfo == null) {
      throw new GenericEntityConfException(
          "Could not find a delegator with the name " + delegatorName);
    }

    String tempModelName = delegatorInfo.entityModelReader;
    ModelReader reader = readers.get(tempModelName);

    if (reader == null) {
      reader = new ModelReader(tempModelName);
      // preload caches...
      reader.getEntityCache();
      reader = readers.putIfAbsentAndGet(tempModelName, reader);
    }
    return reader;
  }