• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java KSBConstants类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中org.kuali.rice.ksb.util.KSBConstants的典型用法代码示例。如果您正苦于以下问题:Java KSBConstants类的具体用法?Java KSBConstants怎么用?Java KSBConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

KSBConstants类属于org.kuali.rice.ksb.util包,在下文中一共展示了KSBConstants类的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: establishRequiredState

点赞 3

import org.kuali.rice.ksb.util.KSBConstants; //导入依赖的package包/类
public ActionMessages establishRequiredState(HttpServletRequest request, ActionForm actionForm) throws Exception {
ThreadPoolForm form = (ThreadPoolForm)actionForm;
form.setThreadPool(KSBServiceLocator.getThreadPool());
if (form.getCorePoolSize() == null) {
    form.setCorePoolSize(form.getThreadPool().getCorePoolSize());
}
if (form.getMaximumPoolSize() == null) {
    form.setMaximumPoolSize(form.getThreadPool().getMaximumPoolSize());
}
if (form.getTimeIncrement() == null) {
    String timeIncrementValue = ConfigContext.getCurrentContextConfig().getProperty(KSBConstants.Config.ROUTE_QUEUE_TIME_INCREMENT_KEY);
    if (!StringUtils.isEmpty(timeIncrementValue)) {
	form.setTimeIncrement(Long.parseLong(timeIncrementValue));
    }
}
if (form.getMaxRetryAttempts() == null) {
    String maxRetryAttemptsValue = ConfigContext.getCurrentContextConfig().getProperty(KSBConstants.Config.ROUTE_QUEUE_MAX_RETRY_ATTEMPTS_KEY);
    if (!StringUtils.isEmpty(maxRetryAttemptsValue)) {
	form.setMaxRetryAttempts(Long.parseLong(maxRetryAttemptsValue));
    }
}
return null;
   }
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:24,
代码来源:ThreadPoolAction.java

示例2: moveToRouteQueue

点赞 3

import org.kuali.rice.ksb.util.KSBConstants; //导入依赖的package包/类
public ActionForward moveToRouteQueue(ActionMapping mapping, ActionForm form, HttpServletRequest request,
    HttpServletResponse response) throws Exception {

QuartzQueueForm quartzForm = (QuartzQueueForm)form;

JobDetail job = KSBServiceLocator.getScheduler().getJobDetail(quartzForm.getJobName(), quartzForm.getJobGroup());
PersistedMessageBO message = (PersistedMessageBO)job.getJobDataMap().get(MessageServiceExecutorJob.MESSAGE_KEY);
    if(message != null){
    message.setQueueStatus(KSBConstants.ROUTE_QUEUE_EXCEPTION);

       message = KSBServiceLocator.getMessageQueueService().save(message);
       KSBServiceLocator.getScheduler().deleteJob(quartzForm.getJobName(), quartzForm.getJobGroup());
    }
   request.setAttribute(RENDER_LIST_OVERRIDE, new Object());
   establishRequiredState(request, form);
return mapping.findForward("joblisting");
   }
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:18,
代码来源:QuartzQueueAction.java

示例3: SignatureVerifyingRequestWrapper

点赞 3

import org.kuali.rice.ksb.util.KSBConstants; //导入依赖的package包/类
public SignatureVerifyingRequestWrapper(HttpServletRequest request) {
	super(request);
	String encodedSignature = request.getHeader(KSBConstants.DIGITAL_SIGNATURE_HEADER);
	if (StringUtils.isEmpty(encodedSignature)) {
		throw new RuntimeException("A digital signature was required on the request but none was found.");
	}
	String verificationAlias = request.getHeader(KSBConstants.KEYSTORE_ALIAS_HEADER);
	String encodedCertificate = request.getHeader(KSBConstants.KEYSTORE_CERTIFICATE_HEADER);
	if ( (StringUtils.isEmpty(verificationAlias)) && (StringUtils.isEmpty(encodedCertificate)) ) {
           throw new RuntimeException("A verification alias or certificate was required on the request but neither was found.");
	}
	try {
           this.digitalSignature = Base64.decodeBase64(encodedSignature.getBytes("UTF-8"));
           if (StringUtils.isNotBlank(encodedCertificate)) {
               byte[] certificate = Base64.decodeBase64(encodedCertificate.getBytes("UTF-8"));
               CertificateFactory cf = CertificateFactory.getInstance("X.509");
               this.signature = KSBServiceLocator.getDigitalSignatureService().getSignatureForVerification(cf.generateCertificate(new ByteArrayInputStream(certificate)));
           } else if (StringUtils.isNotBlank(verificationAlias)) {
               this.signature = KSBServiceLocator.getDigitalSignatureService().getSignatureForVerification(verificationAlias);
           }
	} catch (Exception e) {
		throw new RuntimeException("Failed to initialize digital signature verification.", e);
	}
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:25,
代码来源:SignatureVerifyingRequestWrapper.java

示例4: placeInExceptionRouting

点赞 3

import org.kuali.rice.ksb.util.KSBConstants; //导入依赖的package包/类
/**
 * Executed when an exception is encountered during message invocation.
 * Attempts to call the ExceptionHandler for the message, if that fails it
 * will attempt to set the status of the message in the queue to
 * "EXCEPTION".
 */
protected void placeInExceptionRouting(Throwable t, AsynchronousCall call, Object service) {
    LOG.error("Error processing message: " + this.message, t);
    final Throwable throwable;
    if (t instanceof MessageProcessingException) {
        throwable = t.getCause();
    } else {
        throwable = t;
    }
    try {
    	try {
    		KSBServiceLocator.getExceptionRoutingService().placeInExceptionRouting(throwable, this.message, service);
    	} catch (Throwable t1) {
    		KSBServiceLocator.getExceptionRoutingService().placeInExceptionRoutingLastDitchEffort(throwable, this.message, service);
    	}
    } catch (Throwable t2) {
        LOG.error("An error was encountered when invoking exception handler for message. Attempting to change message status to EXCEPTION.", t2);
        message.setQueueStatus(KSBConstants.ROUTE_QUEUE_EXCEPTION);
        message.setQueueDate(new Timestamp(System.currentTimeMillis()));
        try {
            message = KSBServiceLocator.getMessageQueueService().save(message);
        } catch (Throwable t3) {
            LOG.fatal("Failed to flip status of message to EXCEPTION!!!", t3);
        }
    }
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:32,
代码来源:MessageServiceInvoker.java

示例5: sendMessage

点赞 3

import org.kuali.rice.ksb.util.KSBConstants; //导入依赖的package包/类
public static void sendMessage(PersistedMessageBO message) throws Exception {
    if (!Boolean.valueOf(ConfigContext.getCurrentContextConfig().getProperty(KSBConstants.Config.MESSAGING_OFF))) {

        if (ConfigContext.getCurrentContextConfig().getObject(RiceConstants.SPRING_TRANSACTION_MANAGER) != null
                || ConfigContext.getCurrentContextConfig().getObject(RiceConstants.TRANSACTION_MANAGER_OBJ) != null) {
            if (TransactionSynchronizationManager.isSynchronizationActive()) {
                TransactionSynchronizationManager.registerSynchronization(new MessageSendingTransactionSynchronization(
                        message));
            } else {
                KSBServiceLocator.getThreadPool().execute(new MessageServiceInvoker(message));
            }
        } else {
            KSBServiceLocator.getThreadPool().execute(new MessageServiceInvoker(message));
        }
    }
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:17,
代码来源:MessageSender.java

示例6: buildMessage

点赞 3

import org.kuali.rice.ksb.util.KSBConstants; //导入依赖的package包/类
public static PersistedMessageBO buildMessage(ServiceConfiguration serviceConfiguration, AsynchronousCall methodCall) {
    PersistedMessageBO message = new PersistedMessageBO();
    message.setPayload(new PersistedMessagePayload(methodCall, message));
    message.setIpNumber(RiceUtilities.getIpNumber());
    message.setServiceName(serviceConfiguration.getServiceName().toString());
    message.setQueueDate(new Timestamp(System.currentTimeMillis()));
    if (serviceConfiguration.getPriority() == null) {
        message.setQueuePriority(KSBConstants.ROUTE_QUEUE_DEFAULT_PRIORITY);
    } else {
        message.setQueuePriority(serviceConfiguration.getPriority());
    }
    message.setQueueStatus(KSBConstants.ROUTE_QUEUE_QUEUED);
    message.setRetryCount(0);
    if (serviceConfiguration.getMillisToLive() > 0) {
        message.setExpirationDate(new Timestamp(System.currentTimeMillis() + serviceConfiguration.getMillisToLive()));
    }
    message.setApplicationId(CoreConfigHelper.getApplicationId());
    message.setMethodName(methodCall.getMethodName());
    return message;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:21,
代码来源:PersistedMessageBO.java

示例7: configureDataSource

点赞 3

import org.kuali.rice.ksb.util.KSBConstants; //导入依赖的package包/类
protected void configureDataSource() {
    if (isMessagePersistenceEnabled()) {
        if (getMessageDataSource() != null) {
            ConfigContext.getCurrentContextConfig().putObject(KSBConstants.Config.KSB_MESSAGE_DATASOURCE, getMessageDataSource());
        }
        if (getNonTransactionalMessageDataSource() != null) {
            ConfigContext.getCurrentContextConfig().putObject(KSBConstants.Config.KSB_MESSAGE_NON_TRANSACTIONAL_DATASOURCE, getNonTransactionalMessageDataSource());
        }
    }
    if (getRunMode().equals(RunMode.LOCAL)) {
        if (getRegistryDataSource() != null) {
            ConfigContext.getCurrentContextConfig().putObject(KSBConstants.Config.KSB_REGISTRY_DATASOURCE, getRegistryDataSource());
        }
    }
    if (isBamEnabled()) {
        if (getBamDataSource() != null) {
            ConfigContext.getCurrentContextConfig().putObject(KSBConstants.Config.KSB_BAM_DATASOURCE, getBamDataSource());
        }
    }
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:21,
代码来源:KSBConfigurer.java

示例8: initializeRemoteServiceRegistry

点赞 3

import org.kuali.rice.ksb.util.KSBConstants; //导入依赖的package包/类
protected ServiceRegistry initializeRemoteServiceRegistry() {
	String registryBootstrapUrl = ConfigContext.getCurrentContextConfig().getProperty(KSBConstants.Config.REGISTRY_SERVICE_URL);
	if (StringUtils.isBlank(registryBootstrapUrl)) {
		throw new RiceRuntimeException("Failed to load registry bootstrap service from url: " + registryBootstrapUrl);
	}
	ClientProxyFactoryBean clientFactory = new JaxWsProxyFactoryBean();
	clientFactory.setServiceClass(ServiceRegistry.class);
	clientFactory.setBus(cxfBus);
	clientFactory.setAddress(registryBootstrapUrl);

       boolean registrySecurity = ConfigContext.getCurrentContextConfig().getBooleanProperty(SERVICE_REGISTRY_SECURITY_CONFIG, true);

	// Set security interceptors
	clientFactory.getOutInterceptors().add(new CXFWSS4JOutInterceptor(registrySecurity));
	clientFactory.getInInterceptors().add(new CXFWSS4JInInterceptor(registrySecurity));

       //Set transformation interceptors
       clientFactory.getInInterceptors().add(new ImmutableCollectionsInInterceptor());
	
	Object service = clientFactory.create();
	if (!(service instanceof ServiceRegistry)) {
		throw new RiceRuntimeException("Endpoint to service registry at URL '" + registryBootstrapUrl + "' was not an instance of ServiceRegistry, instead was: " + service);
	}
	return (ServiceRegistry)service;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:26,
代码来源:LazyRemoteServiceRegistryConnector.java

示例9: testBadWorkgroupRoleAttribute

点赞 3

import org.kuali.rice.ksb.util.KSBConstants; //导入依赖的package包/类
/**
 * Tests that if you return a non-null Id object with a null id value inside, that the role action request
 * generation handles it properly.
 */
@Test public void testBadWorkgroupRoleAttribute() throws Exception {
	loadXmlFile("BadWorkgroupRoleAttributeTestConfig.xml");
	WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("user1"), "BadWorkgroupRoleAttributeDocument");


       ConfigContext.getCurrentContextConfig().putProperty(KSBConstants.Config.ALLOW_SYNC_EXCEPTION_ROUTING, "false");
	try {
		document.route("");
		fail("Should have thrown an error because we had some bad ids.");
	} catch (Exception e) {
       } finally {
           // be sure to change it back afterward!
           ConfigContext.getCurrentContextConfig().putProperty(KSBConstants.Config.ALLOW_SYNC_EXCEPTION_ROUTING, "true");
       }
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:20,
代码来源:RoleAttributeTest.java

示例10: moveToRouteQueue

点赞 3

import org.kuali.rice.ksb.util.KSBConstants; //导入依赖的package包/类
public ActionForward moveToRouteQueue(ActionMapping mapping, ActionForm form, HttpServletRequest request,
    HttpServletResponse response) throws Exception {

QuartzQueueForm quartzForm = (QuartzQueueForm)form;

JobDetail job = KSBServiceLocator.getScheduler().getJobDetail(quartzForm.getJobName(), quartzForm.getJobGroup());
PersistedMessageBO message = (PersistedMessageBO)job.getJobDataMap().get(MessageServiceExecutorJob.MESSAGE_KEY);
    if(message != null){
    message.setQueueStatus(KSBConstants.ROUTE_QUEUE_EXCEPTION);

       KSBServiceLocator.getMessageQueueService().save(message);
       KSBServiceLocator.getScheduler().deleteJob(quartzForm.getJobName(), quartzForm.getJobGroup());
    }
   request.setAttribute(RENDER_LIST_OVERRIDE, new Object());
   establishRequiredState(request, form);
return mapping.findForward("joblisting");
   }
 

开发者ID:aapotts,
项目名称:kuali_rice,
代码行数:18,
代码来源:QuartzQueueAction.java

示例11: placeInExceptionRouting

点赞 3

import org.kuali.rice.ksb.util.KSBConstants; //导入依赖的package包/类
/**
 * Executed when an exception is encountered during message invocation.
 * Attempts to call the ExceptionHandler for the message, if that fails it
 * will attempt to set the status of the message in the queue to
 * "EXCEPTION".
 */
protected void placeInExceptionRouting(Throwable t, AsynchronousCall call, Object service) {
    LOG.error("Error processing message: " + this.message, t);
    final Throwable throwable;
    if (t instanceof MessageProcessingException) {
        throwable = t.getCause();
    } else {
        throwable = t;
    }
    try {
    	try {
    		KSBServiceLocator.getExceptionRoutingService().placeInExceptionRouting(throwable, this.message, service);
    	} catch (Throwable t1) {
    		KSBServiceLocator.getExceptionRoutingService().placeInExceptionRoutingLastDitchEffort(throwable, this.message, service);
    	}
    } catch (Throwable t2) {
        LOG.error("An error was encountered when invoking exception handler for message. Attempting to change message status to EXCEPTION.", t2);
        message.setQueueStatus(KSBConstants.ROUTE_QUEUE_EXCEPTION);
        message.setQueueDate(new Timestamp(System.currentTimeMillis()));
        try {
            KSBServiceLocator.getMessageQueueService().save(message);
        } catch (Throwable t3) {
            LOG.fatal("Failed to flip status of message to EXCEPTION!!!", t3);
        }
    }
}
 

开发者ID:aapotts,
项目名称:kuali_rice,
代码行数:32,
代码来源:MessageServiceInvoker.java

示例12: getNextDocuments

点赞 3

import org.kuali.rice.ksb.util.KSBConstants; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public List<PersistedMessageBO> getNextDocuments(Integer maxDocuments) {
	Criteria crit = new Criteria();
	String applicationId = CoreConfigHelper.getApplicationId();
	crit.addEqualTo("applicationId", applicationId);
	crit.addNotEqualTo("queueStatus", KSBConstants.ROUTE_QUEUE_EXCEPTION);
	crit.addEqualTo("ipNumber", RiceUtilities.getIpNumber());

	QueryByCriteria query = new QueryByCriteria(PersistedMessageBO.class, crit);
	query.addOrderByAscending("queuePriority");
	query.addOrderByAscending("routeQueueId");
	query.addOrderByAscending("queueDate");
	if (maxDocuments != null)
		query.setEndAtIndex(maxDocuments.intValue());
	return (List) getPersistenceBrokerTemplate().getCollectionByQuery(query);
}
 

开发者ID:aapotts,
项目名称:kuali_rice,
代码行数:17,
代码来源:MessageQueueDAOOjbImpl.java

示例13: loadLifecycles

点赞 3

import org.kuali.rice.ksb.util.KSBConstants; //导入依赖的package包/类
@Override
public List<Lifecycle> loadLifecycles() throws Exception {
	List<Lifecycle> lifecycles = new LinkedList<Lifecycle>();
	// this validation of our service list needs to happen after we've
	// loaded our configs so it's a lifecycle
	lifecycles.add(new BaseLifecycle() {

		@Override
		public void start() throws Exception {
			// first check if we want to allow self-signed certificates for SSL communication
			if (Boolean.valueOf(ConfigContext.getCurrentContextConfig().getProperty(KSBConstants.Config.KSB_ALLOW_SELF_SIGNED_SSL)).booleanValue()) {
			    Protocol.registerProtocol("https", new Protocol("https",
				    (ProtocolSocketFactory) new EasySSLProtocolSocketFactory(), 443));
			}
			super.start();
		}
	});
	return lifecycles;
}
 

开发者ID:aapotts,
项目名称:kuali_rice,
代码行数:20,
代码来源:KSBConfigurer.java

示例14: configureDataSource

点赞 3

import org.kuali.rice.ksb.util.KSBConstants; //导入依赖的package包/类
protected void configureDataSource() {
if (isMessagePersistenceEnabled()) {
	if (getMessageDataSource() != null) {
		ConfigContext.getCurrentContextConfig().putObject(KSBConstants.Config.KSB_MESSAGE_DATASOURCE, getMessageDataSource());
	}
	if (getNonTransactionalMessageDataSource() != null) {
           ConfigContext.getCurrentContextConfig().putObject(KSBConstants.Config.KSB_MESSAGE_NON_TRANSACTIONAL_DATASOURCE, getNonTransactionalMessageDataSource());
	}
}
      if (getRunMode().equals(RunMode.LOCAL)) {
      	if (getRegistryDataSource() != null) {
              ConfigContext.getCurrentContextConfig().putObject(KSBConstants.Config.KSB_REGISTRY_DATASOURCE, getRegistryDataSource());
          }
      }
      if (isBamEnabled()) {
      	if (getBamDataSource() != null) {
      		ConfigContext.getCurrentContextConfig().putObject(KSBConstants.Config.KSB_BAM_DATASOURCE, getBamDataSource());
      	}
      }
  }
 

开发者ID:aapotts,
项目名称:kuali_rice,
代码行数:21,
代码来源:KSBConfigurer.java

示例15: findRouteQueues

点赞 2

import org.kuali.rice.ksb.util.KSBConstants; //导入依赖的package包/类
protected List<PersistedMessageBO> findRouteQueues(HttpServletRequest request, MessageQueueForm routeQueueForm, int maxRows) {
List<PersistedMessageBO> routeQueues = new ArrayList<PersistedMessageBO>();

// no filter applied
if (StringUtils.isBlank(routeQueueForm.getFilterApplied())) {
    routeQueues.addAll(getRouteQueueService().findAll(maxRows));
}

// one or more filters applied
else {
    if (!StringUtils.isBlank(routeQueueForm.getRouteQueueIdFilter())) {
	if (!NumberUtils.isNumber(routeQueueForm.getRouteQueueIdFilter())) {
	    // TODO better error handling here
	    throw new RuntimeException("Message Id must be a number.");
	}
    }

    Map<String, String> criteriaValues = new HashMap<String, String>();
    String key = null;
    String value = null;
    String trimmedKey = null;
    for (Iterator iter = request.getParameterMap().keySet().iterator(); iter.hasNext();) {
	key = (String) iter.next();
	if (key.endsWith(KSBConstants.ROUTE_QUEUE_FILTER_SUFFIX)) {
	    value = request.getParameter(key);
	    if (StringUtils.isNotBlank(value)) {
		trimmedKey = key.substring(0, key.indexOf(KSBConstants.ROUTE_QUEUE_FILTER_SUFFIX));
		criteriaValues.put(trimmedKey, value);
	    }
	}
    }
    routeQueues.addAll(getRouteQueueService().findByValues(criteriaValues, maxRows));
}
return routeQueues;
   }
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:36,
代码来源:MessageQueueAction.java

示例16: sign

点赞 2

import org.kuali.rice.ksb.util.KSBConstants; //导入依赖的package包/类
public void sign() throws Exception {
    if (StringUtils.isNotBlank(this.alias) ) {
        this.response.setHeader(KSBConstants.KEYSTORE_ALIAS_HEADER, this.alias);
    }
    if (this.certificate != null) {
        this.response.setHeader(KSBConstants.KEYSTORE_CERTIFICATE_HEADER, getEncodedCertificate(this.certificate));
    }
    this.response.setHeader(KSBConstants.DIGITAL_SIGNATURE_HEADER, getEncodedSignature());
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:10,
代码来源:ResponseHeaderDigitalSigner.java

示例17: sign

点赞 2

import org.kuali.rice.ksb.util.KSBConstants; //导入依赖的package包/类
public void sign() throws Exception {
       if (StringUtils.isNotBlank(this.alias) ) {
           this.method.addHeader(KSBConstants.KEYSTORE_ALIAS_HEADER, this.alias);
       }
    if (this.certificate != null) {
        this.method.addHeader(KSBConstants.KEYSTORE_CERTIFICATE_HEADER, getEncodedCertificate(this.certificate));
    }
    this.method.addHeader(KSBConstants.DIGITAL_SIGNATURE_HEADER, getEncodedSignature());
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:10,
代码来源:HttpClientHeaderDigitalSigner.java

示例18: getInInterceptors

点赞 2

import org.kuali.rice.ksb.util.KSBConstants; //导入依赖的package包/类
public static List<Interceptor<? extends Message>> getInInterceptors() {
	try {
		return (List<Interceptor<? extends Message>>) getService(KSBConstants.ServiceNames.BUS_IN_INTERCEPTORS);
	}
	catch(RiceRemoteServiceConnectionException ex) {
		// swallow this exception, means no bus wide interceptors defined
		return null;
	}
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:10,
代码来源:KSBServiceLocator.java

示例19: getOutInterceptors

点赞 2

import org.kuali.rice.ksb.util.KSBConstants; //导入依赖的package包/类
public static List<Interceptor<? extends Message>> getOutInterceptors() {
	try {
		return (List<Interceptor<? extends Message>>) getService(KSBConstants.ServiceNames.BUS_OUT_INTERCEPTORS);
	}
	catch(RiceRemoteServiceConnectionException ex) {
		// swallow this exception, means no bus wide interceptors defined
		return null;
	}
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:10,
代码来源:KSBServiceLocator.java

示例20: run

点赞 2

import org.kuali.rice.ksb.util.KSBConstants; //导入依赖的package包/类
public void run() {
    if (ConfigContext.getCurrentContextConfig().getBooleanProperty(KSBConstants.Config.MESSAGE_PERSISTENCE,
            false)) {
        try {
            requeueDocument();
            requeueMessages();
        } catch (Throwable t) {
            LOG.error("Failed to fetch messages.", t);
        }
    }
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:12,
代码来源:MessageFetcher.java

示例21: requeueDocument

点赞 2

import org.kuali.rice.ksb.util.KSBConstants; //导入依赖的package包/类
private void requeueDocument() {
    try {
        if (this.routeQueueId != null) {
            PersistedMessageBO message = getRouteQueueService().findByRouteQueueId(this.routeQueueId);
            message.setQueueStatus(KSBConstants.ROUTE_QUEUE_ROUTING);
            message = getRouteQueueService().save(message);
            executeMessage(message);
        }
    } catch (Throwable t) {
        LOG.error("Failed to fetch or process some messages during requeueDocument", t);
    }
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:13,
代码来源:MessageFetcher.java

示例22: markEnrouteAndSaveMessage

点赞 2

import org.kuali.rice.ksb.util.KSBConstants; //导入依赖的package包/类
private PersistedMessageBO markEnrouteAndSaveMessage(final PersistedMessageBO message) {
    try {
        return KSBServiceLocator.getTransactionTemplate().execute(new TransactionCallback<PersistedMessageBO>() {
            public PersistedMessageBO doInTransaction(TransactionStatus status) {
                message.setQueueStatus(KSBConstants.ROUTE_QUEUE_ROUTING);
                return getRouteQueueService().save(message);
            }
        });
    } catch (Throwable t) {
        LOG.error("Caught error attempting to mark message " + message + " as R", t);
    }
    return message;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:14,
代码来源:MessageFetcher.java

示例23: getNextDocuments

点赞 2

import org.kuali.rice.ksb.util.KSBConstants; //导入依赖的package包/类
public List<PersistedMessageBO> getNextDocuments(Integer maxDocuments) {
    String applicationId = CoreConfigHelper.getApplicationId();

    TypedQuery<PersistedMessageBO> query = entityManager.createNamedQuery("PersistedMessageBO.GetNextDocuments",
            PersistedMessageBO.class);
    query.setParameter("applicationId", applicationId);
    query.setParameter("queueStatus", KSBConstants.ROUTE_QUEUE_EXCEPTION);
    query.setParameter("ipNumber", RiceUtilities.getIpNumber());

    if (maxDocuments != null) {
        query.setMaxResults(maxDocuments);
    }

    return query.getResultList();
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:16,
代码来源:MessageQueueDaoJpa.java

示例24: delete

点赞 2

import org.kuali.rice.ksb.util.KSBConstants; //导入依赖的package包/类
public void delete(PersistedMessageBO routeQueue) {
    if (Boolean.valueOf(ConfigContext.getCurrentContextConfig().getProperty(KSBConstants.Config.MESSAGE_PERSISTENCE))) {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Message Persistence is on.  Deleting stored message" + routeQueue);
        }
        this.getMessageQueueDao().remove(routeQueue);
    }
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:9,
代码来源:MessageQueueServiceImpl.java

示例25: save

点赞 2

import org.kuali.rice.ksb.util.KSBConstants; //导入依赖的package包/类
public PersistedMessageBO save(PersistedMessageBO routeQueue) {
    if (Boolean.valueOf(ConfigContext.getCurrentContextConfig().getProperty(KSBConstants.Config.MESSAGE_PERSISTENCE))) {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Persisting Message " + routeQueue);
        }
        return getMessageQueueDao().save(routeQueue);
    }
    return routeQueue;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:10,
代码来源:MessageQueueServiceImpl.java

示例26: createInstance

点赞 2

import org.kuali.rice.ksb.util.KSBConstants; //导入依赖的package包/类
@Override
   protected Object createInstance() throws Exception {
Properties properties = new Properties();
Properties configProps = ConfigContext.getCurrentContextConfig().getProperties();
boolean useQuartzDatabase = Boolean.valueOf(ConfigContext.getCurrentContextConfig().getProperty(KSBConstants.Config.USE_QUARTZ_DATABASE));
for (Object keyObj : configProps.keySet()) {
    if (keyObj instanceof String) {
    	String key = (String)keyObj;
    	if (key.startsWith(QUARTZ_PREFIX) && !propertyShouldBeFiltered(useQuartzDatabase, key)) {
    		properties.put(key.substring(4), configProps.get(key));
    	}
    }
}
return properties;
   }
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:16,
代码来源:QuartzConfigPropertiesFactoryBean.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)