use of javax.inject.Singleton in project OpenAM by OpenRock.
the class ForgerockRestGuiceModule method getPrivilegeDefinitions.
@Provides
@Singleton
public Map<String, PrivilegeDefinition> getPrivilegeDefinitions() {
final Map<String, PrivilegeDefinition> definitions = new HashMap<>();
final PrivilegeDefinition evaluateDefinition = PrivilegeDefinition.getInstance("evaluate", PrivilegeDefinition.Action.READ);
definitions.put("evaluate", evaluateDefinition);
definitions.put("evaluateTree", evaluateDefinition);
definitions.put("copy", PrivilegeDefinition.getInstance("modify", PrivilegeDefinition.Action.MODIFY));
definitions.put("move", PrivilegeDefinition.getInstance("modify", PrivilegeDefinition.Action.MODIFY));
definitions.put("schema", PrivilegeDefinition.getInstance("schema", PrivilegeDefinition.Action.READ));
definitions.put("validate", PrivilegeDefinition.getInstance("validate", PrivilegeDefinition.Action.READ));
definitions.put("template", PrivilegeDefinition.getInstance("template", PrivilegeDefinition.Action.READ));
definitions.put("getPropertyNames", PrivilegeDefinition.getInstance("getPropertyNames", PrivilegeDefinition.Action.READ));
definitions.put("getProperty", PrivilegeDefinition.getInstance("getProperty", PrivilegeDefinition.Action.READ));
definitions.put("setProperty", PrivilegeDefinition.getInstance("setProperty", PrivilegeDefinition.Action.MODIFY));
definitions.put("deleteProperty", PrivilegeDefinition.getInstance("deleteProperty", PrivilegeDefinition.Action.MODIFY));
return definitions;
}
use of javax.inject.Singleton in project u2020 by JakeWharton.
the class DebugApiModule method provideBehavior.
@Provides
@Singleton
NetworkBehavior provideBehavior(@NetworkDelay Preference<Long> networkDelay, @NetworkFailurePercent Preference<Integer> networkFailurePercent, @NetworkVariancePercent Preference<Integer> networkVariancePercent) {
NetworkBehavior behavior = NetworkBehavior.create();
behavior.setDelay(networkDelay.get(), MILLISECONDS);
behavior.setFailurePercent(networkFailurePercent.get());
behavior.setVariancePercent(networkVariancePercent.get());
return behavior;
}
use of javax.inject.Singleton in project Telecine by JakeWharton.
the class TelecineModule method provideAnalytics.
@Provides
@Singleton
Analytics provideAnalytics() {
if (BuildConfig.DEBUG) {
return new Analytics() {
@Override
public void send(Map<String, String> params) {
Timber.tag("Analytics").d(String.valueOf(params));
}
};
}
GoogleAnalytics googleAnalytics = GoogleAnalytics.getInstance(app);
Tracker tracker = googleAnalytics.newTracker(BuildConfig.ANALYTICS_KEY);
// ms? s? better be s.
tracker.setSessionTimeout(300);
return new Analytics.GoogleAnalytics(tracker);
}
use of javax.inject.Singleton in project OpenAM by OpenRock.
the class CoreRestGuiceModule method getServerAttributeSyntax.
@Provides
@Singleton
@Named("ServerAttributeSyntax")
public Properties getServerAttributeSyntax() throws IOException {
Properties syntaxProperties = new Properties();
syntaxProperties.load(getClass().getClassLoader().getResourceAsStream("validserverconfig.properties"));
return syntaxProperties;
}
use of javax.inject.Singleton in project SpotiQ by ZinoKader.
the class AppModule method providePartiesRepository.
@Provides
@Singleton
PartiesRepository providePartiesRepository() {
FirebaseDatabase firebaseDatabase = FirebaseDatabase.getInstance();
DatabaseReference databaseReference = firebaseDatabase.getReference().child(FirebaseConstants.CHILD_PARTYLIST);
return new PartiesRepository(databaseReference);
}
Aggregations