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 extension org.opendaylight.controller.sal.binding.impl.utils.PropertiesUtils.*;
21 class OsgiProviderContext extends OsgiConsumerContext implements ProviderContext {
24 val Map<Class<? extends RpcService>, RpcServiceRegistrationImpl<? extends RpcService>> registeredServices
26 new(BundleContext ctx, BindingAwareBrokerImpl broker) {
28 _registeredServices = new HashMap();
31 override def <T extends RpcService> RpcServiceRegistration<T> addRpcImplementation(Class<T> type, T implementation) {
33 // TODO Auto-generated method stub
34 val properties = new Hashtable<String, String>();
35 properties.salServiceType = Constants.SAL_SERVICE_TYPE_PROVIDER
38 val salReg = broker.registerRpcImplementation(type, implementation, this, properties)
39 registeredServices.put(type, salReg)