Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 5626b492453219d333267943652e74bdfb4fed65 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package org.eclipse.papyrus.core.services;

import java.util.ArrayList;
import java.util.List;

import org.eclipse.papyrus.core.services.IService;
import org.eclipse.papyrus.core.services.ServicesRegistry;

public class ServiceA implements IService {

	public enum TraceKind {
		init, start, dispose
	};

	static List<TraceKind> trace = new ArrayList<TraceKind>();

	static List<String> nametrace = new ArrayList<String>();



	static public TraceKind getEvent(int index) {
		return trace.get(index);
	}

	static public String getTraceName(int index) {
		return nametrace.get(index);
	}

	static public void resetTrace() {
		trace.clear();
		nametrace.clear();
	}

	public void init(ServicesRegistry servicesRegistry) {
		trace.add(TraceKind.init);
		nametrace.add(this.getClass().getSimpleName());

	}

	public void startService() {
		trace.add(TraceKind.start);
		nametrace.add(this.getClass().getSimpleName());

	}

	public void disposeService() {
		trace.add(TraceKind.dispose);
		nametrace.add(this.getClass().getSimpleName());

	}

}

Back to the top