本文整理汇总了Java中org.jboss.seam.annotations.async.Asynchronous类的典型用法代码示例。如果您正苦于以下问题:Java Asynchronous类的具体用法?Java Asynchronous怎么用?Java Asynchronous使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Asynchronous类属于org.jboss.seam.annotations.async包,在下文中一共展示了Asynchronous类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: reloadConfigurationTimerEvent
import org.jboss.seam.annotations.async.Asynchronous; //导入依赖的package包/类
@Observer(EVENT_TYPE)
@Asynchronous
public void reloadConfigurationTimerEvent() {
if (this.isActive.get()) {
return;
}
if (!this.isActive.compareAndSet(false, true)) {
return;
}
try {
reloadConfiguration();
} catch (Throwable ex) {
log.error("Exception happened while reloading application configuration", ex);
} finally {
this.isActive.set(false);
}
}
示例2: process
import org.jboss.seam.annotations.async.Asynchronous; //导入依赖的package包/类
@Observer(EVENT_TYPE)
@Asynchronous
public void process() {
if (this.isActive.get()) {
return;
}
if (!this.isActive.compareAndSet(false, true)) {
return;
}
try {
processInt();
} finally {
this.isActive.set(false);
}
}
示例3: reloadConfigurationTimerEvent
import org.jboss.seam.annotations.async.Asynchronous; //导入依赖的package包/类
@Observer(EVENT_TYPE)
@Asynchronous
public void reloadConfigurationTimerEvent() {
if (this.isActive.get()) {
return;
}
if (!this.isActive.compareAndSet(false, true)) {
return;
}
try {
reloadConfiguration();
} catch (Throwable ex) {
log.error("Exception happened while reloading application configuration", ex);
} finally {
this.isActive.set(false);
this.lastFinishedTime = System.currentTimeMillis();
}
}
示例4: schedulePaymentAsynchronously
import org.jboss.seam.annotations.async.Asynchronous; //导入依赖的package包/类
@Asynchronous
@Transactional
public QuartzTriggerHandle schedulePaymentAsynchronously(Payment payment)
{
payment = entityManager.merge(payment);
log.info("[#0] Processing cron payment #1", System.currentTimeMillis(), payment.getId());
if (payment.getActive()) {
BigDecimal balance = payment.getAccount().adjustBalance(payment.getAmount().negate());
log.info(":: balance is now #0", balance);
payment.setLastPaid(new Date());
}
return null;
}
示例5: lookForNotMappedJob
import org.jboss.seam.annotations.async.Asynchronous; //导入依赖的package包/类
@Asynchronous
public QuartzTriggerHandle lookForNotMappedJob(
@Expiration Date expirationDate, @IntervalCron String cronData,
@FinalExpiration Date endDate) {
QuartzTriggerHandle handle = new QuartzTriggerHandle(
"RIDIRE job mapper monitor");
if (!this.flagBearer.isJobMapperRunning()
&& !this.flagBearer.isMappingSuspended()) {
this.flagBearer.setJobMapperRunning(true);
System.out.print("Job mapper running ");
if (this.mainUserTx != null) {
System.out.print(this.mainUserTx);
}
System.out.println();
this.create();
this.lookForNotMappedJob();
this.flagBearer.setJobMapperRunning(false);
System.out.println("Job mapper done");
}
return handle;
}
示例6: reverseVRTFiles
import org.jboss.seam.annotations.async.Asynchronous; //导入依赖的package包/类
@Asynchronous
public void reverseVRTFiles(VRTFilesBuilderData vrtFilesBuilderData) {
String origDir = vrtFilesBuilderData.getOrigDir();
Collection<File> files = FileUtils.listFiles(new File(origDir),
new String[] { "vrt" }, true);
System.out.println("Files to be processed: " + files.size());
File destDir = new File(vrtFilesBuilderData.getDestDir());
destDir.mkdir();
int i = 0;
for (File f : files) {
++i;
try {
this.reverseFile(destDir, f);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if (i % 100 == 0) {
System.out.println("Processed files: " + i);
}
}
}
示例7: saveFrequencyListToFile
import org.jboss.seam.annotations.async.Asynchronous; //导入依赖的package包/类
@Asynchronous
public String saveFrequencyListToFile(
FrequencyListDataGenerator frequencyListDataGenerator)
throws IOException {
Map<String, Integer> fl = this.getBareTable(
frequencyListDataGenerator.getCorporaNames(),
frequencyListDataGenerator.getFunctionalMetadatumDescription(),
frequencyListDataGenerator.getSemanticMetadatumDescription(),
frequencyListDataGenerator.getFrequencyBy());
File file = File.createTempFile("ridireFL-"
+ frequencyListDataGenerator + "-" + new Date(), ".txt");
for (String k : fl.keySet()) {
FileUtils.writeStringToFile(file, k + "\t" + fl.get(k) + "\n",
null, true);
}
System.out.println("Frequency list calculation. Done.");
return "OK";
}
示例8: newThreadSaveSpMetaDataFileSourceTypeURI
import org.jboss.seam.annotations.async.Asynchronous; //导入依赖的package包/类
@Asynchronous
public void newThreadSaveSpMetaDataFileSourceTypeURI(UpdateTrustRelationshipAction updateTrustRelationshipAction){
try {
boolean result = updateTrustRelationshipAction.saveSpMetaDataFileSourceTypeURI();
log.info("Download metadata for TR " + updateTrustRelationshipAction.getTrustRelationship().getDisplayName() + " : result : " + result);
} catch (IOException e) {
log.info("Failed to Download metadata for TR :" + updateTrustRelationshipAction.getTrustRelationship().getDisplayName());
e.printStackTrace();
}
}
示例9: process
import org.jboss.seam.annotations.async.Asynchronous; //导入依赖的package包/类
@Observer(OxTrustConstants.EVENT_CACHE_REFRESH_TIMER)
@Asynchronous
public void process() {
if (this.isActive.get()) {
log.debug("Another process is active");
return;
}
CacheRefreshConfiguration cacheRefreshConfiguration = oxTrustConfiguration.getCacheRefreshConfiguration();
if (!this.isActive.compareAndSet(false, true)) {
log.debug("Failed to start process exclusively");
return;
}
try {
GluuAppliance currentAppliance = applianceService.getAppliance();
if (!isStartCacheRefresh(cacheRefreshConfiguration, currentAppliance)) {
log.debug("Starting conditions aren't reached");
return;
}
processImpl(cacheRefreshConfiguration, currentAppliance);
updateApplianceStatus(currentAppliance, System.currentTimeMillis());
this.lastFinishedTime = System.currentTimeMillis();
} catch (Throwable ex) {
log.error("Exception happened while executing cache refresh synchronization", ex);
} finally {
log.debug("Allowing to run new process exclusively");
this.isActive.set(false);
}
}
示例10: addJobToCorpora
import org.jboss.seam.annotations.async.Asynchronous; //导入依赖的package包/类
@Asynchronous
public void addJobToCorpora(List<SelectableJob> indexedJobs,
List<String> corpusNames) {
JobToCorpusAdder corpusAdder = new JobToCorpusAdder(indexedJobs,
corpusNames);
JobToCorpusAdder2 corpusAdder2 = new JobToCorpusAdder2(indexedJobs,
corpusNames);
this.indexerService.submitCallable(corpusAdder2);
}
示例11: createCorpus
import org.jboss.seam.annotations.async.Asynchronous; //导入依赖的package包/类
@Asynchronous
public void createCorpus(List<SelectableJob> indexedJobs,
List<String> corpusNames) {
CorpusCreator corpusCreator = new CorpusCreator(indexedJobs,
corpusNames);
this.indexerService.submitCallable(corpusCreator);
}
示例12: deleteJobResources
import org.jboss.seam.annotations.async.Asynchronous; //导入依赖的package包/类
@Asynchronous
public void deleteJobResources(Integer jobId, boolean external,
String jobName) {
JobResourcesRemover jobResourcesRemover = new JobResourcesRemover(
jobId, external, jobName);
this.indexerService.submitCallable(jobResourcesRemover);
}
示例13: indexSingleCrawledResource
import org.jboss.seam.annotations.async.Asynchronous; //导入依赖的package包/类
@Asynchronous
public void indexSingleCrawledResource(Integer crId, String corpusName,
boolean commit) {
SingleResourceIndexer singleResourceIndexer = new SingleResourceIndexer(
crId, corpusName, commit);
this.indexerService.submitCallable(singleResourceIndexer);
}
示例14: updateReports
import org.jboss.seam.annotations.async.Asynchronous; //导入依赖的package包/类
@Asynchronous
public QuartzTriggerHandle updateReports(@Expiration Date expirationDate,
@IntervalCron String cronData, @FinalExpiration Date endDate,
ResourcesReporterData resourcesReporterData) {
this.resourcesReporterData = resourcesReporterData;
QuartzTriggerHandle handle = new QuartzTriggerHandle(
"RIDIRE resources reporter");
if (!this.flagBearer.isResourcesUpdaterRunning()) {
System.out.println("RIDIRE resources reporter started");
this.flagBearer.setResourcesUpdaterRunning(true);
this.resourcesReporterData.clearAll();
List<String> usernames = this.entityManager.createQuery(
"select u.username from User u").getResultList();
usernames.add(null);
for (String username : usernames) {
this.getAll(username);
this.getFunctional(username);
this.getMappedJobs(username);
this.getNotMappedJobs(username);
this.getNotStartedJobs(username);
this.getSemantic(username);
this.getTotalJobs(username);
this.getWordsNumber(username);
}
System.out.println("RIDIRE resources reporter ended");
this.flagBearer.setResourcesUpdaterRunning(false);
}
return handle;
}
示例15: schedulePeriodicJob
import org.jboss.seam.annotations.async.Asynchronous; //导入依赖的package包/类
@Asynchronous
@Transactional
public QuartzTriggerHandle schedulePeriodicJob(
@Expiration Date expirationDate, @IntervalCron String cronData,
@FinalExpiration Date endDate, Job job, User user)
throws HeritrixException {
QuartzTriggerHandle handle = new QuartzTriggerHandle(
"RIDIRE periodic job scheduler");
this.crawlerManager.reRunJob(job, user);
return handle;
}