本文整理汇总了Java中atg.nucleus.GenericService类的典型用法代码示例。如果您正苦于以下问题:Java GenericService类的具体用法?Java GenericService怎么用?Java GenericService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GenericService类属于atg.nucleus包,在下文中一共展示了GenericService类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: overrideLogListeners
import atg.nucleus.GenericService; //导入依赖的package包/类
public static void overrideLogListeners(GenericService service, List<String> listenerPaths) {
if (listenerPaths == null || listenerPaths.isEmpty()) {
if (service.isLoggingWarning()) {
service.logWarning("Can not override log listeners as no override value has been set");
}
return;
}
if (service.isLoggingInfo()) {
service.logInfo("Overriding logging queue");
}
LogListener [] currentListeners = service.getLogListeners();
if (currentListeners != null) {
for (int i = currentListeners.length - 1; i >= 0; i--) {
service.removeLogListener(currentListeners[i]);
}
if (service.isLoggingInfo()) {
service.logInfo("Log listeners have been overriden");
}
}
for (String path: listenerPaths) {
LogListener l = (LogListener)Nucleus.getGlobalNucleus().resolveName(path);
if (l != null) {
service.addLogListener(l);
} else {
if (service.isLoggingError()) {
service.vlogError("Could not resolve service with path {}", path);
}
}
}
}
示例2: setLoggingManager
import atg.nucleus.GenericService; //导入依赖的package包/类
public void setLoggingManager(GenericService pLogger) {
mLogger = pLogger;
}
示例3: getLoggingManager
import atg.nucleus.GenericService; //导入依赖的package包/类
public GenericService getLoggingManager() {
return mLogger;
}
示例4: setAbsoluteName
import atg.nucleus.GenericService; //导入依赖的package包/类
/**
* Allows the absoluteName of the given service to be explicitly defined.
* Normally this is determined by the object's location in the Nucleus
* hierarchy. For test items that are not really bound to Nucleus, it's
* convenient to just give it an absolute name rather than going through
* the whole configuration and binding process.
*
* @param absoluteName
* The absolute name value to set
* @param service
* The service whose absolute name should be set.
*/
public static void setAbsoluteName(String absoluteName, GenericService service)
throws IllegalAccessException {
FieldUtils.writeDeclaredField(service, "mAbsoluteName", absoluteName, true);
}