Add ARG PKG_VERSION to Dockerfile
[vfc/nfvo/driver/vnfm/svnfm.git] / huawei / vnfmadapter / VnfmadapterService / service / src / main / java / org / onap / vfc / nfvo / vnfm / svnfm / vnfmadapter / service / activator / RoaVnfmServicePostProcessor.java
1 /*
2  * Copyright 2016 Huawei Technologies Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package org.onap.vfc.nfvo.vnfm.svnfm.vnfmadapter.service.activator;
18
19 import org.onap.vfc.nfvo.vnfm.svnfm.vnfmadapter.service.api.internalsvc.inf.IVnfmAdapterMgrService;
20 import org.slf4j.Logger;
21 import org.slf4j.LoggerFactory;
22 import org.springframework.beans.BeansException;
23 import org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor;
24
25 /**
26  * <br/>
27  * <p>
28  * </p>
29  *
30  * @author
31  * @version VFC 1.0 Aug 31, 2016
32  */
33 public class RoaVnfmServicePostProcessor implements DestructionAwareBeanPostProcessor {
34
35     private static final Logger LOG = LoggerFactory.getLogger(RoaVnfmServicePostProcessor.class);
36
37     @Override
38     public Object postProcessAfterInitialization(Object bean, String name) throws BeansException {
39         if(bean instanceof IVnfmAdapterMgrService) {
40                 IVnfmAdapterMgrService vnfmAdapterSvc = (IVnfmAdapterMgrService)bean;
41                 vnfmAdapterSvc.register();
42             LOG.info("Successfully Registered to Microservice BUS!", RoaVnfmServicePostProcessor.class);
43         }
44
45         return bean;
46     }
47
48     @Override
49     public Object postProcessBeforeInitialization(Object bean, String name) throws BeansException {
50         return bean;
51     }
52
53     @Override
54     public void postProcessBeforeDestruction(Object bean, String name) throws BeansException {
55         //post processing
56     }
57
58 }