Package com.commafeed.CommaFeedConfiguration

Examples of com.commafeed.CommaFeedConfiguration.ApplicationSettings


  private final CommaFeedConfiguration config;

  public void sendMail(User user, String subject, String content) throws Exception {

    ApplicationSettings settings = config.getApplicationSettings();

    final String username = settings.getSmtpUserName();
    final String password = settings.getSmtpPassword();
    final String fromAddress = Optional.fromNullable(settings.getSmtpFromAddress()).or(settings.getSmtpUserName());

    String dest = user.getEmail();

    Properties props = new Properties();
    props.put("mail.smtp.auth", "true");
    props.put("mail.smtp.starttls.enable", "" + settings.isSmtpTls());
    props.put("mail.smtp.host", settings.getSmtpHost());
    props.put("mail.smtp.port", "" + settings.getSmtpPort());

    Session session = Session.getInstance(props, new Authenticator() {
      @Override
      protected PasswordAuthentication getPasswordAuthentication() {
        return new PasswordAuthentication(username, password);
View Full Code Here


    this.queues = queues;
    this.config = config;
    this.feedSubscriptionDAO = feedSubscriptionDAO;
    this.cache = cache;

    ApplicationSettings settings = config.getApplicationSettings();
    int threads = Math.max(settings.getDatabaseUpdateThreads(), 1);
    pool = new FeedRefreshExecutor("feed-refresh-updater", threads, Math.min(50 * threads, 1000), metrics);
    locks = Striped.lazyWeakLock(threads * 100000);

    entryCacheMiss = metrics.meter(MetricRegistry.name(getClass(), "entryCacheMiss"));
    entryCacheHit = metrics.meter(MetricRegistry.name(getClass(), "entryCacheHit"));
View Full Code Here

TOP

Related Classes of com.commafeed.CommaFeedConfiguration.ApplicationSettings

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.