private void destroyBeans(ApplicationAssociate applicationAssociate,Map<String,Object> viewMap){
  for (  Map.Entry<String,Object> entry : viewMap.entrySet()) {
    String name=entry.getKey();
    Object bean=entry.getValue();
    try {
      if (applicationAssociate != null) {
        BeanManager beanManager=applicationAssociate.getBeanManager();
        if (beanManager != null && beanManager.isManaged(name)) {
          beanManager.destroy(name,bean);
        }
      }
    }
 catch (    Exception exception) {
      if (LOGGER.isLoggable(Level.WARNING)) {
        LOGGER.log(Level.WARNING,"Error calling @PreDestroy on bean with name: " + name,exception);
      }
    }
  }
}

private void destroyBeans ( ApplicationAssociate applicationAssociate , Map < String , Object > viewMap ) { for ( Map . Entry < String , Object > entry : viewMap . entrySet ( ) ) { String name = entry . getKey ( ) ; Object bean = entry . getValue ( ) ; try { if ( applicationAssociate != null ) { BeanManager beanManager = applicationAssociate . getBeanManager ( ) ; if ( beanManager != null && beanManager . isManaged ( name ) ) { beanManager . destroy ( name , bean ) ; } } } catch ( Exception exception ) { if ( LOGGER . isLoggable ( Level . WARNING ) ) { LOGGER . log ( Level . WARNING , "Error calling @PreDestroy on bean with name: " + name , exception ) ; } } } }
destroy the managed beans from the given view map .
