KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > internal > ccvs > ui > model > RepositoryLocationSchedulingRule


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.team.internal.ccvs.ui.model;
12
13 import org.eclipse.core.runtime.jobs.ISchedulingRule;
14 import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
15
16 /**
17  * A simple job scheduling rule for serializing jobs for an ICVSRepositoryLocation
18  */

19 public class RepositoryLocationSchedulingRule implements ISchedulingRule {
20     ICVSRepositoryLocation location;
21     public RepositoryLocationSchedulingRule(ICVSRepositoryLocation location) {
22         this.location = location;
23     }
24     public boolean isConflicting(ISchedulingRule rule) {
25         if(rule instanceof RepositoryLocationSchedulingRule) {
26             return ((RepositoryLocationSchedulingRule)rule).location.equals(location);
27         }
28         return false;
29     }
30     public boolean contains(ISchedulingRule rule) {
31         return isConflicting(rule);
32     }
33 }
34
Popular Tags