コード例 #1
0
  /* (non-Javadoc)
   * @see es.alvsanand.webpage.services.admin.WebAdminService#sentEmail(javax.mail.Message)
   */
  public void sentEmail(Message message) throws ServiceException {
    try {
      logger.debug("Sending email");

      Transport.send(message);
    } catch (MessagingException messagingException) {
      logger.error("Error sending email.", messagingException);

      throw new ServiceException(messagingException);
    }
  }
コード例 #2
0
  /*
   * (non-Javadoc)
   *
   * @see es.alvsanand.webpage.services.admin.WebAdminService#eraseCache()
   */
  public void eraseCache() {
    Cache cache;

    try {
      logger.debug("Erasing cache data");

      CacheFactory cacheFactory = CacheManager.getInstance().getCacheFactory();
      cache = cacheFactory.createCache(Collections.emptyMap());

      for (String cacheName : Globals.CAHE_NAMES) {
        cache.remove(cacheName);
      }
    } catch (CacheException cacheException) {
      logger.error("Error removing erasing cache data.", cacheException);
    }
  }