hudson.util.CopyOnWriteMap Java Examples

The following examples show how to use hudson.util.CopyOnWriteMap. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: OrganizationContainer.java    From DotCi with MIT License 5 votes vote down vote up
private void init(final String name) {
    if (this.icon == null) {
        this.icon = new OrganizationGravatarIcon(name);
    }
    this.mixin = new MixInImpl(this);
    if (this.views == null) {
        this.views = new CopyOnWriteArrayList<>();
    }
    if (this.views.size() == 0) {
        final AllListView lv = new AllListView(this);
        this.views.add(lv);
    }
    if (this.viewsTabBar == null) {
        this.viewsTabBar = new DefaultViewsTabBar();
    }
    if (this.primaryView == null) {
        this.primaryView = this.views.get(0).getViewName();
    }
    this.mixin = new MixInImpl(this);
    this.viewGroupMixIn = new ViewGroupMixIn(this) {
        @Override
        protected List<View> views() {
            return OrganizationContainer.this.views;
        }

        @Override
        protected String primaryView() {
            return OrganizationContainer.this.primaryView;
        }

        @Override
        protected void primaryView(final String name) {
            OrganizationContainer.this.primaryView = name;
        }
    };
    this.items = new CopyOnWriteMap.Tree<>(CaseInsensitiveComparator.INSTANCE);
    this.items = getJobsForThisContainer();
}
 
Example #2
Source File: OrganizationContainer.java    From DotCi with MIT License 5 votes vote down vote up
private Tree<String, DynamicProject> getJobsForThisContainer() {
    final Iterable<DynamicProject> projects = SetupConfig.get().getDynamicProjectRepository().getProjectsForOrg(this);
    final Tree<String, DynamicProject> itemMap = new CopyOnWriteMap.Tree<>(CaseInsensitiveComparator.INSTANCE);
    for (final DynamicProject dbBackedProject : projects) {
        itemMap.put(dbBackedProject.getName(), dbBackedProject);
        try {
            dbBackedProject.onLoad(this, dbBackedProject.getName());
        } catch (final IOException e) {
            throw new RuntimeException(e);
        }
    }

    return itemMap;
}
 
Example #3
Source File: DynamicProject.java    From DotCi with MIT License 5 votes vote down vote up
private void init() {
    final Iterable<DynamicSubProject> projects = SetupConfig.get().getDynamicProjectRepository().getChildren(this);
    this.items = new CopyOnWriteMap.Tree<>(CaseInsensitiveComparator.INSTANCE);
    for (final DynamicSubProject dbBackedProject : projects) {
        this.items.put(dbBackedProject.getName(), dbBackedProject);
    }
}