Package org.springframework.transaction.support

Examples of org.springframework.transaction.support.TransactionCallbackWithoutResult


        return this;
    }

    public Processor createActivityProcessor(ActivityBuilder activityBuilder) {
        notNull(jpaTemplate, "jpaTemplate");
        transactionTemplate.execute(new TransactionCallbackWithoutResult() {
            protected void doInTransactionWithoutResult(TransactionStatus status) {
                processRules.setProcessDefinition(getProcessDefinition());
            }
        });
        return new JpaBamProcessor(getTransactionTemplate(), getJpaTemplate(), activityBuilder.getCorrelationExpression(), activityBuilder.getActivityRules(), getEntityType());
View Full Code Here


            try {
                long now = System.currentTimeMillis();
                long nextPoll = now + windowMillis;
                final Date timeNow = new Date(now);

                transactionTemplate.execute(new TransactionCallbackWithoutResult() {
                    protected void doInTransactionWithoutResult(TransactionStatus status) {
                        Map<String, Object> params = new HashMap<String, Object>(1);
                        params.put("timeNow", timeNow);

                        List<ActivityState> list = CastUtils.cast(template.findByNamedParams("select x from "
View Full Code Here

    protected void doInTransactionTemplate(final Exchange exchange) {

        // spring transaction template is working best with rollback if you throw it a runtime exception
        // otherwise it may not rollback messages send to JMS queues etc.

        transactionTemplate.execute(new TransactionCallbackWithoutResult() {
            protected void doInTransactionWithoutResult(TransactionStatus status) {
                // wrapper exception to throw if the exchange failed
                // IMPORTANT: Must be a runtime exception to let Spring regard it as to do "rollback"
                RuntimeException rce;
View Full Code Here

            }
        });
    }

    public void remove(final CamelContext camelContext, final String correlationId, final Exchange exchange) {
        transactionTemplate.execute(new TransactionCallbackWithoutResult() {
            protected void doInTransactionWithoutResult(TransactionStatus status) {
                final String key = correlationId;
                final String confirmKey = exchange.getExchangeId();
                try {
                    final byte[] data = codec.marshallExchange(camelContext, exchange);
View Full Code Here

            }
        });
    }

    public void confirm(final CamelContext camelContext, final String exchangeId) {
        transactionTemplate.execute(new TransactionCallbackWithoutResult() {
            protected void doInTransactionWithoutResult(TransactionStatus status) {
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Confirming exchangeId [" + exchangeId + "]");
                }
                final String confirmKey = exchangeId;
View Full Code Here

            appContext = new ClassPathXmlApplicationContext(defaultConfigPaths);
            final ApplicationContext fappContext = appContext;
            //BeanLocatorFactory.setApplicationContext(appContext);
             TransactionTemplate txTemplate = (TransactionTemplate) BeanLocatorFactory.getBean("transactionTemplate");

                 txTemplate.execute(new TransactionCallbackWithoutResult() {
                     public void doInTransactionWithoutResult(TransactionStatus status)
                     {
                         try {
                          
                           ObjectDAO objectDAO = (ObjectDAO)fappContext.getBean("objectDAO");
View Full Code Here

    final ActionInvocation finalInvoker = invoker;
    try
    {     
      TransactionTemplate txTemplate =(TransactionTemplate) BeanLocatorFactory.getBean("transactionTemplate");
     
      txTemplate.execute(new TransactionCallbackWithoutResult(){
        public void doInTransactionWithoutResult(TransactionStatus status) {
          try {
                        logger.debug("Begin transaction interceptor");
            finalInvoker.invoke();
                        logger.debug("End transaction interceptor");
View Full Code Here

    final ActionInvocation finalInvoker = invoker;
    try
    {     
      TransactionTemplate txTemplate =(TransactionTemplate) BeanLocatorFactory.getBean("transactionTemplate");
     
      txTemplate.execute(new TransactionCallbackWithoutResult(){
        public void doInTransactionWithoutResult(TransactionStatus status) {
          try {
                        //logger.debug("Begin transaction interceptor");
            finalInvoker.invoke();
                        //logger.debug("End transaction interceptor");
View Full Code Here

        overdueEndpoint.assertIsSatisfied();
    }

    protected void sendAMessages() {
        TransactionTemplate transaction = getMandatoryBean(TransactionTemplate.class, "transactionTemplate");
        transaction.execute(new TransactionCallbackWithoutResult() {
            protected void doInTransactionWithoutResult(TransactionStatus status) {
                template.sendBody("direct:a", "<hello id='123'>A</hello>");
                template.sendBody("direct:a", "<hello id='124'>B</hello>");
                template.sendBody("direct:a", "<hello id='125'>C</hello>");
            }
View Full Code Here

        });
    }

    protected void sendBMessages() {
        TransactionTemplate transaction = getMandatoryBean(TransactionTemplate.class, "transactionTemplate");
        transaction.execute(new TransactionCallbackWithoutResult() {
            protected void doInTransactionWithoutResult(TransactionStatus status) {
                template.sendBody("direct:b", "<hello id='123'>A</hello>");
                template.sendBody("direct:b", "<hello id='125'>C</hello>");
            }
        });
View Full Code Here

TOP

Related Classes of org.springframework.transaction.support.TransactionCallbackWithoutResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.