本文整理汇总了Java中org.springframework.transaction.annotation.Propagation.NEVER属性的典型用法代码示例。如果您正苦于以下问题:Java Propagation.NEVER属性的具体用法?Java Propagation.NEVER怎么用?Java Propagation.NEVER使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.springframework.transaction.annotation.Propagation
的用法示例。
在下文中一共展示了Propagation.NEVER属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sessionTimeoutTask
@Override
@Transactional(propagation = Propagation.NEVER)
@Scheduled(initialDelay = 10 * 1000, fixedDelay = SESSION_TIMEOUT_TASK_HEARTBEAT)
public void sessionTimeoutTask() {
if (!taskConfig.isEnableAgentSessionTimeoutTask()) {
return;
}
LOGGER.traceMarker("sessionTimeoutTask", "start");
ZonedDateTime now = DateUtil.utcNow();
for (Zone zone : zoneService.getZones()) {
Collection<Agent> agents = listForOnline(zone.getName());
for (Agent agent : agents) {
if (agent.getSessionId() != null && isSessionTimeout(agent, now, zone.getAgentSessionTimeout())) {
Cmd delSessionCmd = cmdService.create(new CmdInfo(agent.getPath(), CmdType.DELETE_SESSION, null));
cmdDispatchService.dispatch(delSessionCmd);
LOGGER.traceMarker("sessionTimeoutTask", "Send DELETE_SESSION to agent %s", agent);
}
}
}
LOGGER.traceMarker("sessionTimeoutTask", "end");
}
示例2: itemOperationEvent
@Override
@Transactional(propagation = Propagation.NEVER)
public void itemOperationEvent(ItemOperationEvent event)
{
try
{
operateAll(event.getOperation(), null);
}
catch( WorkflowException ex )
{
logger.error(CurrentLocale.get("com.tle.core.services.item.error.operation"), ex);
}
}
示例3: checkTimeoutTask
@Override
@Transactional(propagation = Propagation.NEVER)
@Scheduled(fixedDelay = 300 * 1000)
public void checkTimeoutTask() {
if (!taskConfig.isEnableCmdExecTimeoutTask()) {
return;
}
LOGGER.traceMarker("checkTimeoutTask", "start");
// find all running status cmd
List<Cmd> workingCmdList = cmdService.listWorkingCmd(null);
for (Cmd cmd : workingCmdList) {
if (cmd.getType() != CmdType.RUN_SHELL || !cmd.isCurrent()) {
continue;
}
if (DateUtil.isTimeOut(cmd.getCreatedDate(), ZonedDateTime.now(), cmd.getTimeout())) {
try {
Cmd killCmd = cmdService.create(new CmdInfo(cmd.getAgentPath(), CmdType.KILL, null));
dispatch(killCmd);
LOGGER.traceMarker("checkTimeoutTask", "Send KILL for timeout cmd %s", cmd);
CmdStatusItem statusItem = new CmdStatusItem(cmd.getId(), CmdStatus.TIMEOUT_KILL, null, true, true);
cmdService.updateStatus(statusItem, false);
} catch (Throwable e) {
LOGGER.warn(e.getMessage());
}
}
}
LOGGER.traceMarker("checkTimeoutTask", "end");
}
示例4: enqueue
@Override
@Transactional(propagation = Propagation.NEVER)
public Cmd enqueue(CmdInfo cmdInfo, int priority, int retry) {
Cmd cmd = create(cmdInfo, retry);
PriorityMessage message = PriorityMessage.create(cmd.getId().getBytes(), priority);
cmdQueue.enqueue(message);
return cmd;
}
示例5: idleAgentTask
@Override
@Transactional(propagation = Propagation.NEVER)
@Scheduled(initialDelay = 10 * 1000, fixedDelay = IDLE_AGENT_TASK_HEARTBEAT)
public void idleAgentTask() {
for (Zone zone : zoneService.getZones()) {
List<Agent> availableList = findAvailable(zone.getName());
if (availableList.size() > 0) {
this.dispatchEvent(new AgentResourceEvent(this, zone.getName(), Category.RELEASED));
}
}
}
示例6: exportInstitution
/**
* @return A staging ID
*/
@Override
@Transactional(propagation = Propagation.NEVER)
@SecureOnCallSystem
public String exportInstitution(final Institution institution, final ListProgressCallback callback,
final Set<String> flags)
{
// inst short name, date and time
final StringBuilder name = new StringBuilder();
name.append(institution.getFilestoreId());
name.append('-');
name.append(new LocalDate(CurrentTimeZone.get()).format(Dates.ISO).replace("-", "").replace(":", ""));
final String exportName = name.toString();
final TemporaryFileHandle export = new ExportFile(exportName);
runAs.executeAsSystem(institution, new Runnable()
{
@Override
public void run()
{
InstitutionInfo instInfo = getInstitutionInfo(institution);
instInfo.setFlags(flags);
ConverterParams params = new ConverterParams(instInfo, callback);
ConverterTasks tasks = getConverterTasksInternal(ConvertType.EXPORT, params);
try( OutputStream outStream = fileSystemService.getOutputStream(export, INSTITUTION_FILE, false) )
{
xmlService.serialiseToWriter(instInfo, new OutputStreamWriter(outStream, "UTF-8"));
// Do export tasks
for( NameValue cid : tasks.getNormalTasks() )
{
params.setMessageCallback(null);
String value = cid.getValue();
Converter converter = getConverter(value);
converter.exportIt(export, institution, params, value);
params.getCallback().incrementCurrent();
}
}
catch( IOException e )
{
Throwables.propagate(e);
}
finally
{
if( fileSystemService.fileExists(new ExportFile(exportName + ".tgz")) )
{
fileSystemService.removeFile(export);
}
}
}
});
return export.getMyPathComponent();
}