本文整理汇总了Java中hudson.util.CopyOnWriteList类的典型用法代码示例。如果您正苦于以下问题:Java CopyOnWriteList类的具体用法?Java CopyOnWriteList怎么用?Java CopyOnWriteList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CopyOnWriteList类属于hudson.util包,在下文中一共展示了CopyOnWriteList类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: fromDBObject
import hudson.util.CopyOnWriteList; //导入依赖的package包/类
@Override
public void fromDBObject(DBObject dbObject, MappedField mf, Object entity, EntityCache cache, Mapper mapper) {
BasicDBList cowlist = (BasicDBList) dbObject.get(mf.getNameToStore());
if (cowlist == null)
throw new IllegalArgumentException("Improperly formatted DBObject for CopyOnWriteList");
List core = new ArrayList();
for (Object obj : cowlist) {
DBObject listEntryDbObj = (DBObject) obj;
// Hack until we can coax MappedField to understand what CopyOnWriteList is. Eliminate as soon as possible.
// Currently mf.getSubType() is null because MappedField does not use Iterable to determine a list and thus
// does not check for subtypes.
Class clazz = mapper.getOptions().getObjectFactory().createInstance(mapper, mf, listEntryDbObj).getClass();
core.add(mapper.fromDBObject(clazz, listEntryDbObj, cache));
}
mf.setFieldValue(entity, new CopyOnWriteList(core));
}
开发者ID:groupon,项目名称:DotCi,代码行数:21,代码来源:CopyOnWriteListMapper.java
示例2: decode
import hudson.util.CopyOnWriteList; //导入依赖的package包/类
@Override
public Object decode(Class targetClass, Object fromDBObject, MappedField optionalExtraInfo) {
if (fromDBObject == null) return null;
BasicDBList rawList = (BasicDBList) fromDBObject;
List core = new ArrayList();
for (Object obj : rawList) {
DBObject dbObj = (DBObject) obj;
core.add(getMapper().fromDBObject(optionalExtraInfo.getSubClass(), dbObj, getMapper().createEntityCache()));
}
return new CopyOnWriteList(core);
}
开发者ID:groupon,项目名称:DotCi,代码行数:15,代码来源:CopyOnWriteListConverter.java
示例3: encode
import hudson.util.CopyOnWriteList; //导入依赖的package包/类
@Override
public Object encode(Object value, MappedField optionalExtraInfo) {
if (value == null) return null;
CopyOnWriteList copyOnWriteList = (CopyOnWriteList) value;
List core = new BasicDBList();
for (Object obj : copyOnWriteList) {
core.add(getMapper().toDBObject(obj));
}
return core;
}
开发者ID:groupon,项目名称:DotCi,代码行数:14,代码来源:CopyOnWriteListConverter.java
示例4: toDBObject
import hudson.util.CopyOnWriteList; //导入依赖的package包/类
@Override
public void toDBObject(Object entity, MappedField mf, DBObject dbObject, Map<Object, DBObject> involvedObjects, Mapper mapper) {
final String name = mf.getNameToStore();
CopyOnWriteList copyOnWriteList = (CopyOnWriteList) mf.getFieldValue(entity);
List core = new ArrayList();
mf.getSubType();
for (Object obj : copyOnWriteList) {
core.add(mapper.toDBObject(obj, involvedObjects));
}
dbObject.put(name, core);
}
开发者ID:groupon,项目名称:DotCi,代码行数:15,代码来源:CopyOnWriteListMapper.java
示例5: toDBObject
import hudson.util.CopyOnWriteList; //导入依赖的package包/类
@Override
public DBObject toDBObject(final Object entity, final Map<Object, DBObject> involvedObjects) {
if (!(entity instanceof CopyOnWriteList || involvedObjects.containsKey(entity))) {
involvedObjects.put(entity, null);
}
return super.toDBObject(entity, involvedObjects);
}
开发者ID:groupon,项目名称:DotCi,代码行数:9,代码来源:JenkinsMapper.java
示例6: JenkinsEmbeddedMapper
import hudson.util.CopyOnWriteList; //导入依赖的package包/类
JenkinsEmbeddedMapper() {
this.customMappers = new HashMap<>();
this.customMappers.put(CopyOnWriteList.class, new CopyOnWriteListMapper());
this.serializationMethodInvoker = new SerializationMethodInvoker();
this.awkwardMapper = new MapKeyValueMapper();
}
开发者ID:groupon,项目名称:DotCi,代码行数:9,代码来源:JenkinsEmbeddedMapper.java
示例7: CustomHandler
import hudson.util.CopyOnWriteList; //导入依赖的package包/类
/** JENKINS-27669: try to preload classes that will be needed by {@link #publish} */
CustomHandler() {
Arrays.hashCode(new Class<?>[] {
Map.Entry.class,
LogRecorder.class,
LogRecorder.Target.class,
LogFile.class,
RewindableFileOutputStream.class,
RewindableRotatingFileOutputStream.class,
StreamHandler.class,
SupportLogFormatter.class,
LogFlusher.class,
CopyOnWriteList.class,
});
}
开发者ID:jenkinsci,项目名称:support-core-plugin,代码行数:16,代码来源:JenkinsLogs.java
示例8: fixProperties
import hudson.util.CopyOnWriteList; //导入依赖的package包/类
private static void fixProperties(AbstractProject implementationProject, TemplateImplementationProperty property, boolean implementationIsTemplate) throws IOException {
CopyOnWriteList<JobProperty<?>> properties = ReflectionUtils.getFieldValue(Job.class, implementationProject, "properties");
properties.add(property);
if (!implementationIsTemplate) {
for (JobProperty<?> jobProperty : properties) {
if (jobProperty instanceof TemplateProperty) {
properties.remove(jobProperty);
}
}
}
}
开发者ID:JoelJ,项目名称:ez-templates,代码行数:13,代码来源:TemplateUtils.java
示例9: CopyOnWriteListConverter
import hudson.util.CopyOnWriteList; //导入依赖的package包/类
public CopyOnWriteListConverter() {
super(CopyOnWriteList.class);
}
开发者ID:groupon,项目名称:DotCi,代码行数:4,代码来源:CopyOnWriteListConverter.java
示例10: getPackageItems
import hudson.util.CopyOnWriteList; //导入依赖的package包/类
/**
* The getter for the packageItems field. (this field is set by the UI part of this plugin see config.jelly file)
*
* @return the value of the packageItems field
*/
public CopyOnWriteList<PackageItem> getPackageItems() {
return packageItems;
}
开发者ID:zgyarmati,项目名称:aptly-plugin,代码行数:9,代码来源:AptlyPublisher.java
示例11: CopyOnWriteListMappedClass
import hudson.util.CopyOnWriteList; //导入依赖的package包/类
/**
* constructor
*
* @param mapper
*/
public CopyOnWriteListMappedClass(final Mapper mapper) {
super(CopyOnWriteList.class, mapper);
}
开发者ID:groupon,项目名称:DotCi,代码行数:9,代码来源:JenkinsMappedClass.java
注:本文中的hudson.util.CopyOnWriteList类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论