Debian Codegraph @

bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileRegistryComponent.java

raw
1 /*******************************************************************************
2 * Copyright (c) 2009, 2017 IBM Corporation and others.
3 *
4 * This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License 2.0
6 * which accompanies this distribution, and is available at
7 * https://www.eclipse.org/legal/epl-2.0/
8 *
9 * SPDX-License-Identifier: EPL-2.0
10 *
11 * Contributors:
12 * IBM Corporation - initial API and implementation
13 *******************************************************************************/
14 package org.eclipse.equinox.internal.p2.engine;
15
16 import org.eclipse.equinox.internal.provisional.p2.core.eventbus.IProvisioningEventBus;
17 import org.eclipse.equinox.p2.core.IAgentLocation;
18 import org.eclipse.equinox.p2.core.IProvisioningAgent;
19 import org.eclipse.equinox.p2.core.spi.IAgentServiceFactory;
20 import org.eclipse.equinox.p2.engine.IProfileRegistry;
21
22 /**
23 * Instantiates default instances of {@link IProfileRegistry}.
24 */
25 public class ProfileRegistryComponent implements IAgentServiceFactory {
26
27 @Override
28 public Object createService(IProvisioningAgent agent) {
29 IAgentLocation location = agent.getService(IAgentLocation.class);
30 SimpleProfileRegistry registry = new SimpleProfileRegistry(agent, SimpleProfileRegistry.getDefaultRegistryDirectory(location));
31 registry.setEventBus(agent.getService(IProvisioningEventBus.class));
32 return registry;
33 }
34 }