Permalink
Browse files

refactor: move Settings processor to factory

Also move mustaches templates.
Dependency on restx-core will be no more needed to use the
@Settings mechanism.

WIP: test are not yet working
  • Loading branch information...
a-peyrard committed Dec 22, 2014
1 parent ffbda71 commit bc13b80e3811449dd93b23edfacf1f97374c18f0
@@ -1,3 +1,2 @@
restx.annotations.processor.RestxAnnotationProcessor
restx.exceptions.processor.ErrorAnnotationProcessor
restx.config.processor.SettingsAnnotationProcessor
@@ -2,7 +2,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import restx.common.RestxConfig;
import restx.config.Settings;
import restx.config.SettingsKey;
import restx.factory.AutoStartable;
@@ -33,17 +32,6 @@ public String disableBareFilter() {
return "false";
}
// @Settings is not processed as long as this is part of core itself
@Provides
public SecuritySettings securitySettings(final RestxConfig config) {
return new SecuritySettings() {
@Override
public int sessionsLimit() {
return config.getInt("restx.sessions.stats.limit").or(100);
}
};
}
@Provides @Named("Sessions")
public Sessions session(SecuritySettings settings) {
return new Sessions(settings.sessionsLimit());
@@ -4,11 +4,10 @@
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableMap;
import com.samskivert.mustache.Template;
import restx.common.Mustaches;
import restx.common.processor.RestxAbstractProcessor;
import restx.config.Settings;
import restx.config.SettingsKey;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import javax.annotation.processing.RoundEnvironment;
import javax.annotation.processing.SupportedAnnotationTypes;
import javax.annotation.processing.SupportedOptions;
@@ -18,9 +17,10 @@
import javax.lang.model.element.TypeElement;
import javax.lang.model.type.DeclaredType;
import javax.lang.model.type.TypeMirror;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import restx.common.Mustaches;
import restx.common.processor.RestxAbstractProcessor;
import restx.config.Settings;
import restx.config.SettingsKey;
/**
*/
@@ -1 +1,2 @@
restx.factory.processor.FactoryAnnotationProcessor
restx.factory.processor.FactoryAnnotationProcessor
restx.config.processor.SettingsAnnotationProcessor

0 comments on commit bc13b80

Please sign in to comment.