Fix gvnfm juju compile problem
[vfc/nfvo/driver/vnfm/gvnfm.git] / juju / juju-vnfmadapter / Juju-vnfmadapterService / service / src / main / java / org / onap / vfc / nfvo / vnfm / gvnfm / jujuvnfmadapter / service / activator / ROAJujuServicePostProcessor.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.gvnfm.jujuvnfmadapter.service.activator;
18
19 import org.onap.vfc.nfvo.vnfm.gvnfm.jujuvnfmadapter.service.api.internalsvc.inf.IJujuAdapterMgrService;
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 import org.springframework.stereotype.Service;
25
26 /**
27  * 
28  * ROA juju service post processor class.<br>
29  * <p>
30  * </p>
31  * 
32  * @author
33  * @version     NFVO 0.5  Sep 12, 2016
34  */
35 public class ROAJujuServicePostProcessor implements DestructionAwareBeanPostProcessor{
36     private static final Logger LOG = LoggerFactory.getLogger(ROAJujuServicePostProcessor.class);
37
38     @Override
39     public Object postProcessAfterInitialization(Object bean, String name) throws BeansException {
40         if(bean instanceof IJujuAdapterMgrService){
41             IJujuAdapterMgrService jujuAdapterSvc = (IJujuAdapterMgrService)bean;
42             jujuAdapterSvc.register();
43             LOG.info("Successfully Registered to Microservice BUS!", ROAJujuServicePostProcessor.class);
44         }
45
46         return bean;
47     }
48
49     @Override
50     public Object postProcessBeforeInitialization(Object bean, String name) throws BeansException {
51         // TODO Auto-generated method stub
52         return bean;
53     }
54
55     @Override
56     public void postProcessBeforeDestruction(Object bean, String name) throws BeansException {
57         // TODO Auto-generated method stub
58         
59     }
60
61 }