本文整理汇总了Java中com.path.android.jobqueue.config.Configuration类的典型用法代码示例。如果您正苦于以下问题:Java Configuration类的具体用法?Java Configuration怎么用?Java Configuration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Configuration类属于com.path.android.jobqueue.config包,在下文中一共展示了Configuration类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: jobManager
import com.path.android.jobqueue.config.Configuration; //导入依赖的package包/类
@Provides
@Singleton
public JobManager jobManager() {
Configuration config = new Configuration.Builder(mApp)
.consumerKeepAlive(45)
.maxConsumerCount(3)
.minConsumerCount(1)
.customLogger(L.getJobLogger())
.injector(new DependencyInjector() {
@Override
public void inject(Job job) {
if (job instanceof BaseJob) {
((BaseJob) job).inject(mApp.getAppComponent());
}
}
})
.build();
return new JobManager(mApp, config);
}
示例2: onCreate
import com.path.android.jobqueue.config.Configuration; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
context = getApplicationContext();
try {
PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
VERSIONNAME = pInfo.versionName;
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
Storage.deleteTemp(); //Start clean every time!!
VaultHolder.getInstance().clear();
Configuration configuration = new Configuration.Builder(this)
.minConsumerCount(1)//always keep at least one consumer alive
.maxConsumerCount(1)//up to 1 consumers at a time
.loadFactor(1)//1 jobs per consumer
.networkUtil(new NetworkUtilImpl(this))
.build();
jobManager = new JobManager(this, configuration);
}
示例3: provideJobManager
import com.path.android.jobqueue.config.Configuration; //导入依赖的package包/类
@Provides @Singleton public JobManager provideJobManager(@ForApplication Context context) {
Configuration config = new Configuration.Builder(context).minConsumerCount(MIN_CONSUMER_COUNT)
.maxConsumerCount(MAX_CONSUMER_COUNT)
.loadFactor(LOAD_FACTOR)
.build();
return new JobManager(context, config);
}
示例4: onCreate
import com.path.android.jobqueue.config.Configuration; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
context = this.getApplicationContext();
Configuration config = new Configuration.Builder(this).maxConsumerCount(1).build();
jobManager = new JobManager(this, config);
}
示例5: onCreate
import com.path.android.jobqueue.config.Configuration; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void onCreate() {
super.onCreate();
Configuration configuration = new Configuration.Builder(this)
.minConsumerCount(1)
.maxConsumerCount(3)
.loadFactor(3)
.consumerKeepAlive(120)
.build();
jobManager = new JobManager(this, configuration);
}
示例6: configureJobManager
import com.path.android.jobqueue.config.Configuration; //导入依赖的package包/类
/**
* Configurazione del JobManager per il sistema di code
*/
private void configureJobManager() {
Configuration configuration = new Configuration.Builder(this)
.minConsumerCount(1)// always keep at least one consumer alive
.maxConsumerCount(3)// up to 3 consumers at a time
.loadFactor(3)// 3 jobs per consumer
.consumerKeepAlive(120)// wait 2 minute
.build();
jobManager = new JobManager(this, configuration);
}
示例7: provideJobManager
import com.path.android.jobqueue.config.Configuration; //导入依赖的package包/类
@Provides
@ForActivity
@Singleton
JobManager provideJobManager() {
Configuration config = new Configuration.Builder(activity)
.injector(new DependencyInjector() {
@Override
public void inject(BaseJob baseJob) {
activity.inject(baseJob);
}
})
.id("MainActivity")
.build();
return new JobManager(activity, config);
}
示例8: provideJobManager
import com.path.android.jobqueue.config.Configuration; //导入依赖的package包/类
@Provides
@Singleton
@ForActivity
JobManager provideJobManager() {
Configuration config = new Configuration.Builder(activity)
.injector(new DependencyInjector() {
@Override
public void inject(BaseJob baseJob) {
activity.inject(baseJob);
}
})
.id("LoginActivity")
.build();
return new JobManager(activity, config);
}
示例9: provideJobManager
import com.path.android.jobqueue.config.Configuration; //导入依赖的package包/类
@Provides @Singleton
public JobManager provideJobManager(Configuration configuration) {
return new JobManager(mApplicationContext, configuration);
}