2 * Copyright © 2017 AT&T 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
9 package org.opendaylight.transportpce.olm;
11 import org.opendaylight.mdsal.binding.api.RpcProviderService;
12 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev210618.TransportpceOlmService;
13 import org.opendaylight.yangtools.concepts.ObjectRegistration;
14 import org.osgi.service.component.annotations.Activate;
15 import org.osgi.service.component.annotations.Component;
16 import org.osgi.service.component.annotations.Deactivate;
17 import org.osgi.service.component.annotations.Reference;
18 import org.slf4j.Logger;
19 import org.slf4j.LoggerFactory;
22 * The Class OlmProvider.
25 public class OlmProvider {
26 private static final Logger LOG = LoggerFactory.getLogger(OlmProvider.class);
27 private ObjectRegistration<TransportpceOlmService> olmRPCRegistration;
30 * Instantiates a new olm provider.
31 * @param olmPowerServiceRpc
32 * implementation of TransportpceOlmService
33 * @param rpcProviderService
34 * the rpc provider service
37 public OlmProvider(@Reference final RpcProviderService rpcProviderService,
38 @Reference final TransportpceOlmService olmPowerServiceRpc) {
39 olmRPCRegistration = rpcProviderService.registerRpcImplementation(TransportpceOlmService.class,
41 LOG.info("OlmProvider Session Initiated");
45 * Method called when the blueprint container is destroyed.
49 LOG.info("OlmProvider Closed");
50 // Clean up the RPC service registration
51 if (olmRPCRegistration != null) {
52 olmRPCRegistration.close();