All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.gw.common.utils.GwClientResource Maven / Gradle / Ivy

package com.gw.common.utils;

import javax.annotation.PreDestroy;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
@Component

public class GwClientResource   {
	private final Logger logger = LoggerFactory.getLogger(this.getClass());
	private GwClientWrapper gwClientWrapper;

	@Bean(initMethod = "startClient")
	public void startClient() throws Exception {
		gwClientWrapper = new GwClientWrapper();
		logger.info("GwClientResource start"); 
	}
	
	public GwClientWrapper getGwClientWrapper() {
		return gwClientWrapper;
	}

	@PreDestroy
	public void stopClient() throws Exception {
		if (gwClientWrapper != null) {
			gwClientWrapper.dispose();
		}
		logger.info("GwClientResource stop"); 
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy