Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2013-07-30 03:02:20 -0400
committerTobias Schwarz2013-07-30 03:02:20 -0400
commitcd3cdbc0a85da2f57a2732cb63fb4e29f6ab4848 (patch)
treee218b386aeba23add09442d642243cd4c0b1302f /target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core
parentb07499780c7f2cb8ae57e921dfd91cbac60eb93d (diff)
downloadorg.eclipse.tcf-cd3cdbc0a85da2f57a2732cb63fb4e29f6ab4848.tar.gz
org.eclipse.tcf-cd3cdbc0a85da2f57a2732cb63fb4e29f6ab4848.tar.xz
org.eclipse.tcf-cd3cdbc0a85da2f57a2732cb63fb4e29f6ab4848.zip
Target Explorer: add common property access service
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/META-INF/MANIFEST.MF1
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/plugin.xml7
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/internal/services/PropertiesAccessService.java139
3 files changed, 5 insertions, 142 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/META-INF/MANIFEST.MF b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/META-INF/MANIFEST.MF
index acd2d1892..6c11319ed 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/META-INF/MANIFEST.MF
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/META-INF/MANIFEST.MF
@@ -30,7 +30,6 @@ Export-Package: org.eclipse.tcf.te.tcf.processes.core.activator;x-internal:=true
org.eclipse.tcf.te.tcf.processes.core.model.interfaces,
org.eclipse.tcf.te.tcf.processes.core.model.interfaces.runtime,
org.eclipse.tcf.te.tcf.processes.core.model.internal.factory;x-internal:=true,
- org.eclipse.tcf.te.tcf.processes.core.model.internal.services;x-internal:=true,
org.eclipse.tcf.te.tcf.processes.core.model.nodes,
org.eclipse.tcf.te.tcf.processes.core.model.properties,
org.eclipse.tcf.te.tcf.processes.core.model.runtime,
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/plugin.xml
index 437f7d1b0..d7914f7bd 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/plugin.xml
@@ -14,13 +14,16 @@
<!-- Service contributions -->
<extension point="org.eclipse.tcf.te.runtime.services.services">
<service
- class="org.eclipse.tcf.te.tcf.processes.core.model.internal.services.PropertiesAccessService"
+ class="org.eclipse.tcf.te.tcf.core.model.services.PropertiesAccessService"
id="org.eclipse.tcf.te.tcf.processes.services.tcf.propertiesAccess">
<serviceType
bundleId="org.eclipse.tcf.te.runtime.services"
class="org.eclipse.tcf.te.runtime.services.interfaces.IPropertiesAccessService"/>
<enablement>
- <instanceof value="org.eclipse.tcf.te.tcf.processes.core.model.interfaces.IProcessContextNode"/>
+ <or>
+ <instanceof value="org.eclipse.tcf.te.tcf.processes.core.model.interfaces.IProcessContextNode"/>
+ <instanceof value="org.eclipse.tcf.te.tcf.processes.core.model.runtime.RuntimeModel"/>
+ </or>
</enablement>
</service>
</extension>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/internal/services/PropertiesAccessService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/internal/services/PropertiesAccessService.java
deleted file mode 100644
index c6db5ac3d..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/internal/services/PropertiesAccessService.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 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.processes.core.model.internal.services;
-
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicReference;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.runtime.services.AbstractService;
-import org.eclipse.tcf.te.runtime.services.interfaces.IPropertiesAccessService;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.tcf.processes.core.model.interfaces.IProcessContextNode;
-
-/**
- * Process context node properties access service implementation.
- */
-public class PropertiesAccessService extends AbstractService implements IPropertiesAccessService {
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.services.interfaces.IPropertiesAccessService#getTargetAddress(java.lang.Object)
- */
- @Override
- public Map<String, String> getTargetAddress(Object context) {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.services.interfaces.IPropertiesAccessService#getProperty(java.lang.Object, java.lang.String)
- */
- @Override
- public Object getProperty(final Object context, final String key) {
- Assert.isNotNull(context);
- Assert.isNotNull(key);
-
- final AtomicReference<Object> value = new AtomicReference<Object>();
- if (context instanceof IProcessContextNode) {
- final IProcessContextNode node = (IProcessContextNode) context;
-
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- Object val = node.getProperty(key);
- value.set(val);
- }
- };
-
- if (Protocol.isDispatchThread()) runnable.run();
- else Protocol.invokeAndWait(runnable);
- }
-
- return value.get();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.services.interfaces.IPropertiesAccessService#setProperty(java.lang.Object, java.lang.String, java.lang.Object)
- */
- @Override
- public boolean setProperty(final Object context, final String key, final Object value) {
- Assert.isNotNull(context);
- Assert.isNotNull(key);
-
- final AtomicBoolean result = new AtomicBoolean();
- if (context instanceof IPeerModel) {
- final IProcessContextNode node = (IProcessContextNode) context;
-
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- result.set(node.setProperty(key, value));
- }
- };
-
- if (Protocol.isDispatchThread()) runnable.run();
- else Protocol.invokeAndWait(runnable);
- }
-
- return result.get();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.services.interfaces.IPropertiesAccessService#isProperty(java.lang.Object, java.lang.String, java.lang.Object)
- */
- @Override
- public boolean isProperty(final Object context, final String key, final Object value) {
- Assert.isNotNull(context);
- Assert.isNotNull(key);
-
- final AtomicBoolean result = new AtomicBoolean();
- if (context instanceof IPeerModel) {
- final IProcessContextNode node = (IProcessContextNode) context;
-
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- result.set(node.isProperty(key, value));
- }
- };
-
- if (Protocol.isDispatchThread()) runnable.run();
- else Protocol.invokeAndWait(runnable);
- }
-
- return result.get();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.services.interfaces.IPropertiesAccessService#getParent(java.lang.Object)
- */
- @Override
- public Object getParent(final Object context) {
- Assert.isNotNull(context);
-
- final AtomicReference<Object> value = new AtomicReference<Object>();
- if (context instanceof IProcessContextNode) {
- final IProcessContextNode node = (IProcessContextNode) context;
-
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- value.set(node.getParent());
- }
- };
-
- if (Protocol.isDispatchThread()) runnable.run();
- else Protocol.invokeAndWait(runnable);
- }
-
- return value.get();
- }
-}

Back to the top