Mercurial > hg4j
annotate src/org/tmatesoft/hg/internal/Lifecycle.java @ 234:b2cfbe46f9b6
HgTags got TagInfo to access tags. Tags are read from all branches/revisions now, not only working copy
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Tue, 07 Jun 2011 04:28:32 +0200 |
parents | e39cf474ef94 |
children | d3ab16739736 |
rev | line source |
---|---|
217
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
1 /* |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
2 * Copyright (c) 2011 TMate Software Ltd |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
3 * |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
4 * This program is free software; you can redistribute it and/or modify |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
5 * it under the terms of the GNU General Public License as published by |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
6 * the Free Software Foundation; version 2 of the License. |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
7 * |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
8 * This program is distributed in the hope that it will be useful, |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
11 * GNU General Public License for more details. |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
12 * |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
13 * For information on how to redistribute this software under |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
14 * the terms of a license other than GNU General Public License |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
15 * contact TMate Software at support@hg4j.com |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
16 */ |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
17 package org.tmatesoft.hg.internal; |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
18 |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
19 /** |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
20 * EXPERIMENTAL. |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
21 * Mix-in for RevlogStream.Inspector to get informed about start and end of the iteration |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
22 * |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
23 * @author Artem Tikhomirov |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
24 * @author TMate Software Ltd. |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
25 */ |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
26 public interface Lifecycle { |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
27 |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
28 public void start(int count, Callback callback, Object token); |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
29 public void finish(Object token); |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
30 |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
31 interface Callback { |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
32 void stop(); |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
33 } |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
34 |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
35 class BasicCallback implements Callback { |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
36 private boolean done = false; |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
37 |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
38 public void stop() { |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
39 done = true; |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
40 } |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
41 public boolean isStopped() { |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
42 return done; |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
43 } |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
44 } |
e39cf474ef94
Experimental support to mix-in start and end events for inspectors. Additionally, Lifecycle may serve as iteration control
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
45 } |