diff options
author | Alexander Kurtakov | 2019-06-28 13:12:15 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2019-07-01 13:09:05 +0000 |
commit | bb27e7b3fc060a62805281221eac19e21803b40f (patch) | |
tree | 8e38f4d2a6c119f777e9d0963e7fc85cb5a06a4a /bundles/org.eclipse.equinox.p2.core | |
parent | 0406e1d0248310054a35232f5840b5c3c50ab5fd (diff) | |
download | rt.equinox.p2-bb27e7b3fc060a62805281221eac19e21803b40f.tar.gz rt.equinox.p2-bb27e7b3fc060a62805281221eac19e21803b40f.tar.xz rt.equinox.p2-bb27e7b3fc060a62805281221eac19e21803b40f.zip |
Convert to the generic IProvisioningAgent.getService()
Change-Id: If595ceb183461e5a9565d58ccd6a432291f2281b
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.core')
2 files changed, 6 insertions, 5 deletions
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/DefaultAgentProvider.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/DefaultAgentProvider.java index b82428a1e..76e092bc5 100644 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/DefaultAgentProvider.java +++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/DefaultAgentProvider.java @@ -7,7 +7,7 @@ * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -34,16 +34,17 @@ public class DefaultAgentProvider implements IProvisioningAgentProvider { ProvisioningAgent result = new ProvisioningAgent(); result.setBundleContext(context); result.setLocation(location); - IAgentLocation agentLocation = (IAgentLocation) result.getService(IAgentLocation.SERVICE_NAME); + IAgentLocation agentLocation = result.getService(IAgentLocation.class); Dictionary<String, Object> properties = new Hashtable<>(5); if (agentLocation != null) properties.put("locationURI", String.valueOf(agentLocation.getRootLocation())); //$NON-NLS-1$ - //make the currently running system have a higher service ranking + // make the currently running system have a higher service ranking if (location == null) { properties.put(Constants.SERVICE_RANKING, Integer.valueOf(100)); properties.put(IProvisioningAgent.SERVICE_CURRENT, Boolean.TRUE.toString()); } - ServiceRegistration<IProvisioningAgent> reg = context.registerService(IProvisioningAgent.class, result, properties); + ServiceRegistration<IProvisioningAgent> reg = context.registerService(IProvisioningAgent.class, result, + properties); result.setServiceRegistration(reg); return result; } diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/ProvisioningAgent.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/ProvisioningAgent.java index 26a106d47..3d65f1b41 100644 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/ProvisioningAgent.java +++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/ProvisioningAgent.java @@ -7,7 +7,7 @@ * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ |