Skip to content

Instantly share code, notes, and snippets.

View sizovs's full-sized avatar
🌴
Mentoring software developers @ principal.dev

Eduards Sizovs sizovs

🌴
Mentoring software developers @ principal.dev
View GitHub Profile
package fm.ask.infrastructure.caching;
import com.google.common.base.Function;
import com.google.common.base.Ticker;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.support.CompositeCacheManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
package fm.ask.infrastructure.caching;
import com.google.common.base.Supplier;
import com.google.common.base.Ticker;
import com.google.common.cache.CacheBuilder;
import com.rubylight.conf.IConfListener;
import com.rubylight.conf.IConfProperty;
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
import org.springframework.cache.guava.GuavaCacheManager;
package fm.ask.infrastructure.caching;
import org.springframework.cache.CacheManager;
public abstract class CacheManagerFactory {
protected abstract CacheManager createInstance() ;
}
Method method = PersonController.class.getMethod("show", Long.class);
Link link = linkTo(method, 2L).withSelfRel();
assertThat(link.getHref(), is("/people/2")));
interface Validator
validate(Q)
@Qualifier
@Inherited
@interface V1Annotation {
}
@Component
@Override
public void onFloatingActionTrigger() {
getRandomQuestion();
}
private void getRandomQuestion() {
setRefreshing(true);
NetworkActionMaker.MKE.networkRequest(mActivity, RequestDefinition.MY_QUESTIONS_GET_RANDOM, new NetworkActionCallback<QuestionWrapper>() {
// this is a non-abstract TEMPLATE METHOD. Empty by default.
set 'zzk_skip_avatar_cache_for_finish_avatar_upload' hostGroup 'any' appGroup 'any' to '0'
set 'zzk_email_configuration_graceful_degradation' to 'yoman'
set 'zzk_json' to json(
[
'socket-timeout' : 10000,
'connection-timeout': 5000
])
ensure 'zzk_skip_avatar_cache_for_finish_avatar_upload', 'any', 'any' {
is '0'
}
ensure 'zzk_email_configuration_graceful_degradation' {
is 'yoman'
}
ensure 'zzk_json' {
is json(
ensure 'zzk_skip_avatar_cache_for_finish_avatar_upload', 'any', 'any' {
is '0'
}
ensure 'zzk_email_configuration_graceful_degradation' {
is 'yoman'
}
ensure 'zzk_json' {
def "repeatedly resolves correct client in getClientForToken"() {
...
}