Commit | Line | Data |
---|---|---|
5d10d135 ASL |
1 | /******************************************************************************* |
2 | * Copyright (c) 2009 Ericsson | |
3 | * | |
4 | * All rights reserved. This program and the accompanying materials are | |
5 | * made available under the terms of the Eclipse Public License v1.0 which | |
6 | * accompanies this distribution, and is available at | |
7 | * http://www.eclipse.org/legal/epl-v10.html | |
8 | * | |
9 | * Contributors: | |
10 | * Alvaro Sanchez-Leon (alvsan09@gmail.com) - Initial API and implementation | |
11 | *******************************************************************************/ | |
12 | package org.eclipse.linuxtools.lttng.state.model; | |
13 | ||
14 | import org.eclipse.linuxtools.lttng.state.LttngStateException; | |
5d10d135 ASL |
15 | |
16 | /** | |
17 | * Entry point to the package | |
18 | * | |
19 | * @author alvaro | |
20 | * | |
21 | */ | |
22 | public class StateModelFactory { | |
23 | ||
24 | // ======================================================================== | |
25 | // Methods | |
26 | // ======================================================================= | |
27 | ||
28 | /** | |
29 | * Return an instance of the entry class, the entry class contains | |
30 | * references to the internal model elements. | |
31 | * | |
32 | * One instance is expected to be created per LttngTrace. | |
33 | * | |
34 | * This method shall be used when a trace is not opened yet and will be | |
35 | * initialized later via the init() method. | |
36 | * | |
37 | * @return | |
38 | */ | |
39 | public static LttngTraceState getStateEntryInstance() { | |
40 | return new LttngTraceState(); | |
41 | } | |
42 | ||
43 | /** | |
44 | * Provide a LttngTraceState when the input data reference is known e.g. | |
45 | * when exchanging the State provider to check point clone. | |
46 | * | |
47 | * @return | |
48 | */ | |
49 | public static LttngTraceState getStateEntryInstance( | |
88144d4a | 50 | ILttngStateInputRef stateInputRef) { |
5d10d135 ASL |
51 | LttngTraceState traceState = new LttngTraceState(); |
52 | try { | |
53 | traceState.init(stateInputRef); | |
54 | } catch (LttngStateException e) { | |
55 | e.printStackTrace(); | |
56 | } | |
57 | return traceState; | |
58 | } | |
59 | } |