本文整理汇总了Java中org.ofbiz.entity.config.model.DelegatorElement类的典型用法代码示例。如果您正苦于以下问题:Java DelegatorElement类的具体用法?Java DelegatorElement怎么用?Java DelegatorElement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DelegatorElement类属于org.ofbiz.entity.config.model包,在下文中一共展示了DelegatorElement类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getModelReader
import org.ofbiz.entity.config.model.DelegatorElement; //导入依赖的package包/类
public static ModelReader getModelReader(String delegatorName) throws GenericEntityException {
DelegatorElement delegatorInfo = EntityConfig.getInstance().getDelegator(delegatorName);
if (delegatorInfo == null) {
throw new GenericEntityConfException("Could not find a delegator with the name " + delegatorName);
}
String tempModelName = delegatorInfo.getEntityModelReader();
ModelReader reader = readers.get(tempModelName);
if (reader == null) {
reader = new ModelReader(tempModelName);
// preload caches...
reader.getEntityCache();
reader = readers.putIfAbsentAndGet(tempModelName, reader);
}
return reader;
}
示例2: getEntityGroupName
import org.ofbiz.entity.config.model.DelegatorElement; //导入依赖的package包/类
/** Gets a group name based on a definition from the specified XML Entity Group descriptor file.
* @param entityName The entityName of the Entity Group definition to use.
* @return A group name
*/
public String getEntityGroupName(String entityName, String delegatorBaseName) {
Map<String, String> gc = getGroupCache();
if (gc != null) {
String groupName = gc.get(entityName);
if (groupName == null) {
DelegatorElement delegatorInfo = null;
try {
delegatorInfo = EntityConfig.getInstance().getDelegator(delegatorBaseName);
} catch (GenericEntityConfException e) {
Debug.logWarning(e, "Exception thrown while getting delegator config: ", module);
}
if (delegatorInfo == null) {
throw new RuntimeException("Could not find DelegatorInfo for delegatorBaseName [" + delegatorBaseName + "]");
}
groupName = delegatorInfo.getDefaultGroupName();
}
return groupName;
} else {
return null;
}
}
示例3: ArtifactInfoFactory
import org.ofbiz.entity.config.model.DelegatorElement; //导入依赖的package包/类
protected ArtifactInfoFactory(String delegatorName) throws GeneralException {
this.delegatorName = delegatorName;
this.entityModelReader = ModelReader.getModelReader(delegatorName);
DelegatorElement delegatorInfo = EntityConfig.getInstance().getDelegator(delegatorName);
String modelName;
if (delegatorInfo != null) {
modelName = delegatorInfo.getEntityModelReader();
} else {
modelName = "main";
}
// since we do not associate a dispatcher to this DispatchContext, it is important to set a name of an existing entity model reader:
// in this way it will be possible to retrieve the service models from the cache
this.dispatchContext = new DispatchContext(modelName, this.getClass().getClassLoader(), null);
this.prepareAll();
}
示例4: getModelReader
import org.ofbiz.entity.config.model.DelegatorElement; //导入依赖的package包/类
public static ModelReader getModelReader(String delegatorName) throws GenericEntityException {
DelegatorElement delegatorInfo = EntityConfigUtil.getDelegator(delegatorName);
if (delegatorInfo == null) {
throw new GenericEntityConfException("Could not find a delegator with the name " + delegatorName);
}
String tempModelName = delegatorInfo.getEntityModelReader();
ModelReader reader = readers.get(tempModelName);
if (reader == null) {
reader = new ModelReader(tempModelName);
// preload caches...
reader.getEntityCache();
reader = readers.putIfAbsentAndGet(tempModelName, reader);
}
return reader;
}
示例5: getEntityGroupName
import org.ofbiz.entity.config.model.DelegatorElement; //导入依赖的package包/类
/** Gets a group name based on a definition from the specified XML Entity Group descriptor file.
* @param entityName The entityName of the Entity Group definition to use.
* @return A group name
*/
public String getEntityGroupName(String entityName, String delegatorBaseName) {
Map<String, String> gc = getGroupCache();
if (gc != null) {
String groupName = gc.get(entityName);
if (groupName == null) {
DelegatorElement delegatorInfo = null;
try {
delegatorInfo = EntityConfigUtil.getDelegator(delegatorBaseName);
} catch (GenericEntityConfException e) {
Debug.logWarning(e, "Exception thrown while getting delegator config: ", module);
}
if (delegatorInfo == null) {
throw new RuntimeException("Could not find DelegatorInfo for delegatorBaseName [" + delegatorBaseName + "]");
}
groupName = delegatorInfo.getDefaultGroupName();
}
return groupName;
} else {
return null;
}
}
示例6: ArtifactInfoFactory
import org.ofbiz.entity.config.model.DelegatorElement; //导入依赖的package包/类
protected ArtifactInfoFactory(String delegatorName) throws GeneralException {
this.delegatorName = delegatorName;
this.entityModelReader = ModelReader.getModelReader(delegatorName);
DelegatorElement delegatorInfo = EntityConfigUtil.getDelegator(delegatorName);
String modelName;
if (delegatorInfo != null) {
modelName = delegatorInfo.getEntityModelReader();
} else {
modelName = "main";
}
// since we do not associate a dispatcher to this DispatchContext, it is important to set a name of an existing entity model reader:
// in this way it will be possible to retrieve the service models from the cache
this.dispatchContext = new DispatchContext(modelName, this.getClass().getClassLoader(), null);
this.prepareAll();
}
示例7: getModelGroupReader
import org.ofbiz.entity.config.model.DelegatorElement; //导入依赖的package包/类
public static ModelGroupReader getModelGroupReader(String delegatorName) throws GenericEntityConfException {
DelegatorElement delegatorInfo = EntityConfig.getInstance().getDelegator(delegatorName);
if (delegatorInfo == null) {
throw new GenericEntityConfException("Could not find a delegator with the name " + delegatorName);
}
String tempModelName = delegatorInfo.getEntityGroupReader();
ModelGroupReader reader = readers.get(tempModelName);
if (reader == null) {
reader = readers.putIfAbsentAndGet(tempModelName, new ModelGroupReader(tempModelName));
}
return reader;
}
示例8: DispatchContext
import org.ofbiz.entity.config.model.DelegatorElement; //导入依赖的package包/类
/**
* Creates new DispatchContext as an immutable object.
* The "dispatcher" argument can be null if the "name" argument matches the name of a valid entity model reader.
* The thread safety of a DispatchContext object is a consequence of its immutability.
*
* @param name The immutable name of the DispatchContext
* @param loader The immutable class loader
* @param dispatcher The immutable dispatcher associated to the DispatchContext
*
*/
public DispatchContext(String name, ClassLoader loader, LocalDispatcher dispatcher) {
this.name = name;
this.loader = loader;
this.dispatcher = dispatcher;
String modelName = null;
if (this.dispatcher != null) {
Delegator delegator = dispatcher.getDelegator();
if (delegator != null) {
DelegatorElement delegatorInfo = null;
try {
delegatorInfo = EntityConfig.getInstance().getDelegator(delegator.getDelegatorBaseName());
} catch (GenericEntityConfException e) {
Debug.logWarning(e, "Exception thrown while getting delegator config: ", module);
}
if (delegatorInfo != null) {
modelName = delegatorInfo.getEntityModelReader();
}
}
}
if (modelName == null) {
// if a modelName is not associated to the dispatcher (e.g. dispatcher is null) then use the name
// of the DispatchContext as the model reader name
modelName = name;
}
this.model = modelName;
getGlobalServiceMap();
}
示例9: getEntityEcaReaderName
import org.ofbiz.entity.config.model.DelegatorElement; //导入依赖的package包/类
public static String getEntityEcaReaderName(String delegatorName) {
DelegatorElement delegatorInfo = null;
try {
delegatorInfo = EntityConfig.getInstance().getDelegator(delegatorName);
} catch (GenericEntityConfException e) {
Debug.logWarning(e, "Exception thrown while getting field type config: ", module);
}
if (delegatorInfo == null) {
Debug.logError("BAD ERROR: Could not find delegator config with name: " + delegatorName, module);
return null;
}
return delegatorInfo.getEntityEcaReader();
}
示例10: LabelReferences
import org.ofbiz.entity.config.model.DelegatorElement; //导入依赖的package包/类
public LabelReferences(Delegator delegator, LabelManagerFactory factory) {
this.delegator = delegator;
this.labels = factory.getLabels();
DelegatorElement delegatorInfo = null;
try {
delegatorInfo = EntityConfig.getInstance().getDelegator(delegator.getDelegatorBaseName());
} catch (GenericEntityConfException e) {
Debug.logWarning(e, "Exception thrown while getting delegator config: ", module);
}
String modelName;
if (delegatorInfo != null) {
modelName = delegatorInfo.getEntityModelReader();
} else {
modelName = "main";
}
// since we do not associate a dispatcher to this DispatchContext, it is important to set a name of an existing entity model reader:
// in this way it will be possible to retrieve the service models from the cache
this.dispatchContext = new DispatchContext(modelName, this.getClass().getClassLoader(), null);
Collection<LabelInfo> infoList = this.labels.values();
for (LabelInfo labelInfo : infoList) {
this.labelSet.add(labelInfo.getLabelKey());
}
Collection<ComponentConfig> componentConfigs = ComponentConfig.getAllComponents();
for (ComponentConfig config : componentConfigs) {
String rootFolder = config.getRootLocation();
rootFolder = rootFolder.replace('\\', '/');
if (!rootFolder.endsWith("/")) {
rootFolder = rootFolder + "/";
}
this.rootFolders.add(rootFolder);
}
}
示例11: getModelGroupReader
import org.ofbiz.entity.config.model.DelegatorElement; //导入依赖的package包/类
public static ModelGroupReader getModelGroupReader(String delegatorName) throws GenericEntityConfException {
DelegatorElement delegatorInfo = EntityConfigUtil.getDelegator(delegatorName);
if (delegatorInfo == null) {
throw new GenericEntityConfException("Could not find a delegator with the name " + delegatorName);
}
String tempModelName = delegatorInfo.getEntityGroupReader();
ModelGroupReader reader = readers.get(tempModelName);
if (reader == null) {
reader = readers.putIfAbsentAndGet(tempModelName, new ModelGroupReader(tempModelName));
}
return reader;
}
示例12: DispatchContext
import org.ofbiz.entity.config.model.DelegatorElement; //导入依赖的package包/类
/**
* Creates new DispatchContext as an immutable object.
* The "dispatcher" argument can be null if the "name" argument matches the name of a valid entity model reader.
* The thread safety of a DispatchContext object is a consequence of its immutability.
*
* @param name The immutable name of the DispatchContext
* @param loader The immutable class loader
* @param dispatcher The immutable dispatcher associated to the DispatchContext
*
*/
public DispatchContext(String name, ClassLoader loader, LocalDispatcher dispatcher) {
this.name = name;
this.loader = loader;
this.dispatcher = dispatcher;
String modelName = null;
if (this.dispatcher != null) {
Delegator delegator = dispatcher.getDelegator();
if (delegator != null) {
DelegatorElement delegatorInfo = null;
try {
delegatorInfo = EntityConfigUtil.getDelegator(delegator.getDelegatorBaseName());
} catch (GenericEntityConfException e) {
Debug.logWarning(e, "Exception thrown while getting delegator config: ", module);
}
if (delegatorInfo != null) {
modelName = delegatorInfo.getEntityModelReader();
}
}
}
if (modelName == null) {
// if a modelName is not associated to the dispatcher (e.g. dispatcher is null) then use the name
// of the DispatchContext as the model reader name
modelName = name;
}
this.model = modelName;
getGlobalServiceMap();
}
示例13: LabelReferences
import org.ofbiz.entity.config.model.DelegatorElement; //导入依赖的package包/类
public LabelReferences(Delegator delegator, LabelManagerFactory factory) {
this.delegator = delegator;
this.labels = factory.getLabels();
DelegatorElement delegatorInfo = null;
try {
delegatorInfo = EntityConfigUtil.getDelegator(delegator.getDelegatorBaseName());
} catch (GenericEntityConfException e) {
Debug.logWarning(e, "Exception thrown while getting delegator config: ", module);
}
String modelName;
if (delegatorInfo != null) {
modelName = delegatorInfo.getEntityModelReader();
} else {
modelName = "main";
}
// since we do not associate a dispatcher to this DispatchContext, it is important to set a name of an existing entity model reader:
// in this way it will be possible to retrieve the service models from the cache
this.dispatchContext = new DispatchContext(modelName, this.getClass().getClassLoader(), null);
Collection<LabelInfo> infoList = this.labels.values();
for (LabelInfo labelInfo : infoList) {
this.labelSet.add(labelInfo.getLabelKey());
}
Collection<ComponentConfig> componentConfigs = ComponentConfig.getAllComponents();
for (ComponentConfig config : componentConfigs) {
String rootFolder = config.getRootLocation();
rootFolder = rootFolder.replace('\\', '/');
if (!rootFolder.endsWith("/")) {
rootFolder = rootFolder + "/";
}
this.rootFolders.add(rootFolder);
}
}
示例14: getDelegator
import org.ofbiz.entity.config.model.DelegatorElement; //导入依赖的package包/类
public static DelegatorElement getDelegator(String name) throws GenericEntityConfException {
return getEntityConfig().getDelegator(name);
}