blob: 14b4adf68b89153119dd81ee3274719d77e49a8c (
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
|
/*******************************************************************************
* Copyright (c) 2015 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
package org.eclipse.tcf.te.tcf.locator.services;
import java.util.Map;
import org.eclipse.tcf.te.core.terminals.interfaces.ITerminalContextPropertiesProvider;
import org.eclipse.tcf.te.runtime.services.ServiceManager;
import org.eclipse.tcf.te.runtime.services.interfaces.IPropertiesAccessService;
/**
* Terminal context properties provider implementation.
*/
public class TerminalContextPropertiesProvider implements ITerminalContextPropertiesProvider {
/* (non-Javadoc)
* @see org.eclipse.tcf.te.core.terminals.interfaces.ITerminalContextPropertiesProvider#getTargetAddress(java.lang.Object)
*/
@Override
public Map<String, String> getTargetAddress(Object context) {
IPropertiesAccessService service = ServiceManager.getInstance().getService(context, IPropertiesAccessService.class);
if (service != null) {
return service.getTargetAddress(context);
}
return null;
}
/* (non-Javadoc)
* @see org.eclipse.tcf.te.core.terminals.interfaces.ITerminalContextPropertiesProvider#getProperty(java.lang.Object, java.lang.String)
*/
@Override
public Object getProperty(Object context, String key) {
IPropertiesAccessService service = ServiceManager.getInstance().getService(context, IPropertiesAccessService.class);
if (service != null) {
return service.getProperty(context, key);
}
return null;
}
}
|