當前位置: 首頁>>代碼示例>>Java>>正文


Java Propagation.NEVER屬性代碼示例

本文整理匯總了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");
}
 
開發者ID:FlowCI,項目名稱:flow-platform,代碼行數:24,代碼來源:AgentServiceImpl.java

示例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);
	}
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:13,代碼來源:ItemServiceImpl.java

示例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");
}
 
開發者ID:FlowCI,項目名稱:flow-platform,代碼行數:33,代碼來源:CmdDispatchServiceImpl.java

示例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;
}
 
開發者ID:FlowCI,項目名稱:flow-platform,代碼行數:9,代碼來源:CmdServiceImpl.java

示例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));
        }
    }
}
 
開發者ID:FlowCI,項目名稱:flow-platform,代碼行數:11,代碼來源:AgentServiceImpl.java

示例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();
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:59,代碼來源:InstitutionImportServiceImpl.java


注:本文中的org.springframework.transaction.annotation.Propagation.NEVER屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。