public void afterReturning(final StaticPart staticPart, final Object result) {
if(logger.isDebugEnabled()){
logger.debug("EmailNotificationAspect, afterReturning");
}
try {
final AddressGeolocMessageJms addressGeolocMessageJms = new AddressGeolocMessageJms();
addressGeolocMessageJms.setEnvironmentName(environmentName);
addressGeolocMessageJms.setEnvironmentId(environmentId);
addressGeolocMessageJms.setApplicationName(applicationName);
addressGeolocMessageJms.setServerName(InetAddress.getLocalHost().getHostName());
addressGeolocMessageJms.setServerIp(InetAddress.getLocalHost().getHostAddress());
if(result != null && result instanceof GeolocAddress){
GeolocAddress geolocAddress = (GeolocAddress) result;
addressGeolocMessageJms.setGeolocType("GeolocAddress");
} else if(result != null && result instanceof GeolocCity){
GeolocCity geolocCity = (GeolocCity) result;
addressGeolocMessageJms.setGeolocType("GeolocCity");
}
// Generate and send the JMS message
addressGeolocMessageProducer.generateMessages(addressGeolocMessageJms);