4841f9e093baacfbb955a579b9ef2d05263ca337
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng.ui / src / org / eclipse / linuxtools / lttng / ui / tracecontrol / connectorservice / TraceConnectorServiceManager.java
1 /*******************************************************************************
2 * Copyright (c) 2011 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 * Polytechnique Montréal - Initial API and implementation
11 * Bernd Hufmann - Productification, enhancements and fixes
12 *
13 *******************************************************************************/
14 package org.eclipse.linuxtools.lttng.ui.tracecontrol.connectorservice;
15
16 import org.eclipse.linuxtools.lttng.ui.tracecontrol.subsystems.ITCFSubSystem;
17 import org.eclipse.linuxtools.lttng.ui.tracecontrol.subsystems.ITraceSubSystem;
18 import org.eclipse.rse.core.subsystems.AbstractConnectorServiceManager;
19 import org.eclipse.rse.core.subsystems.IConnectorService;
20 import org.eclipse.rse.core.model.IHost;
21 import org.eclipse.rse.core.subsystems.ISubSystem;
22
23 /**
24 * <b><u>TraceConnectorServiceManager</u></b>
25 * <p>
26 * Implementation of the Trace Connector Service Manager class for the creation
27 * of the Trace Connector service.
28 * </p>
29 */
30 public class TraceConnectorServiceManager extends AbstractConnectorServiceManager {
31
32 // ------------------------------------------------------------------------
33 // Attributes
34 // ------------------------------------------------------------------------
35 private static TraceConnectorServiceManager INSTANCE = new TraceConnectorServiceManager();
36
37 public static final int TCF_PORT = 1534;
38
39 // ------------------------------------------------------------------------
40 // Constructors
41 // ------------------------------------------------------------------------
42 /**
43 * Return singleton instance
44 */
45 public static TraceConnectorServiceManager getInstance() {
46 if (INSTANCE == null) {
47 INSTANCE = new TraceConnectorServiceManager();
48 }
49 return INSTANCE;
50 }
51
52
53 // ------------------------------------------------------------------------
54 // Operations
55 // ------------------------------------------------------------------------
56 /*
57 * (non-Javadoc)
58 * @see org.eclipse.rse.core.subsystems.AbstractConnectorServiceManager#createConnectorService(org.eclipse.rse.core.model.IHost)
59 */
60 @Override
61 public IConnectorService createConnectorService(IHost host) {
62 return new TraceConnectorService(host, TCF_PORT);
63 }
64
65 /*
66 * (non-Javadoc)
67 * @see org.eclipse.rse.core.subsystems.AbstractConnectorServiceManager#sharesSystem(org.eclipse.rse.core.subsystems.ISubSystem)
68 */
69 @Override
70 public boolean sharesSystem(ISubSystem otherSubSystem) {
71 return (otherSubSystem instanceof ITCFSubSystem);
72 }
73
74 /*
75 * (non-Javadoc)
76 * @see org.eclipse.rse.core.subsystems.AbstractConnectorServiceManager#getSubSystemCommonInterface(org.eclipse.rse.core.subsystems.ISubSystem)
77 */
78 @Override
79 public Class<ITraceSubSystem> getSubSystemCommonInterface(ISubSystem subsystem) {
80 return ITraceSubSystem.class;
81 }
82
83 }
This page took 0.032165 seconds and 4 git commands to generate.