2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.sal.binding.impl;
10 import java.util.HashMap;
11 import java.util.Hashtable;
14 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
15 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcServiceRegistration;
16 import org.opendaylight.yangtools.yang.binding.RpcService;
17 import org.osgi.framework.BundleContext;
19 import static org.opendaylight.controller.sal.binding.impl.osgi.Constants.*;
20 import static extension org.opendaylight.controller.sal.binding.impl.osgi.PropertiesUtils.*;
22 class OsgiProviderContext extends OsgiConsumerContext implements ProviderContext {
25 val Map<Class<? extends RpcService>, RpcServiceRegistrationImpl<? extends RpcService>> registeredServices
27 new(BundleContext ctx, BindingAwareBrokerImpl broker) {
29 _registeredServices = new HashMap();
32 override def <T extends RpcService> RpcServiceRegistration<T> addRpcImplementation(Class<T> type, T implementation) {
34 // TODO Auto-generated method stub
35 val properties = new Hashtable<String, String>();
36 properties.salServiceType = SAL_SERVICE_TYPE_PROVIDER
39 val salReg = broker.registerRpcImplementation(type, implementation, this, properties)
40 registeredServices.put(type, salReg)