use of org.meveo.service.crm.impl.CustomFieldInstanceService in project meveo by meveo-org.
the class MeveoFunctionMapper method getCustomFieldInstanceService.
@SuppressWarnings("unchecked")
private static CustomFieldInstanceService getCustomFieldInstanceService() {
if (customFieldInstanceService == null) {
try {
InitialContext initialContext = new InitialContext();
BeanManager beanManager = (BeanManager) initialContext.lookup("java:comp/BeanManager");
Bean<CustomFieldInstanceService> bean = (Bean<CustomFieldInstanceService>) beanManager.resolve(beanManager.getBeans(CustomFieldInstanceService.class));
customFieldInstanceService = (CustomFieldInstanceService) beanManager.getReference(bean, bean.getBeanClass(), beanManager.createCreationalContext(bean));
} catch (NamingException e) {
Logger log = LoggerFactory.getLogger(MeveoFunctionMapper.class);
log.error("Unable to access CustomFieldInstanceService", e);
throw new RuntimeException(e);
}
}
return customFieldInstanceService;
}
Aggregations