Examples of TransactionCallbackWithoutResult


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

Examples of org.springframework.transaction.support.TransactionCallbackWithoutResult

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

                transactionTemplate.execute(new TransactionCallbackWithoutResult() {
                    protected void doInTransactionWithoutResult(TransactionStatus status) {
                        List<ActivityState> list = template.find("select x from " + ActivityState.class.getName() + " x where x.escalationLevel = ?1 and x.timeOverdue < ?2", escalateLevel, timeNow);
                        for (ActivityState activityState : list) {
                            fireExpiredEvent(activityState);
                        }
View Full Code Here

Examples of org.springframework.transaction.support.TransactionCallbackWithoutResult

            + propagationBehaviorToString(transactionTemplate.getPropagationBehavior())
            + "[" + getProcessor() + "]";
    }

    public void process(final Exchange exchange) {
        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"
                RuntimeCamelException rce = null;
View Full Code Here

Examples of org.springframework.transaction.support.TransactionCallbackWithoutResult

        overdueEndpoint.assertIsSatisfied();
    }

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

Examples of org.springframework.transaction.support.TransactionCallbackWithoutResult

        });
    }

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

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

Examples of org.springframework.transaction.support.TransactionCallbackWithoutResult

                    }
                    TransactionTemplate tt = new TransactionTemplate(this.txManager);


                    try {
                        tt.execute(new TransactionCallbackWithoutResult() {
                            @Override
                            protected void doInTransactionWithoutResult(TransactionStatus status) {
                                try {

                                    for (final String queue : QUEUES) {
View Full Code Here

Examples of org.springframework.transaction.support.TransactionCallbackWithoutResult

                    }
                    TransactionTemplate tt = new TransactionTemplate(this.txManager);


                    try {
                        tt.execute(new TransactionCallbackWithoutResult() {
                            @Override
                            protected void doInTransactionWithoutResult(TransactionStatus status) {
                                try {

                                    for (final String queue : QUEUES) {
View Full Code Here

Examples of org.springframework.transaction.support.TransactionCallbackWithoutResult

    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 = null;
View Full Code Here

Examples of org.springframework.transaction.support.TransactionCallbackWithoutResult

  }

  @Async
  public void doAsyncTask(final Map<Object, Object> context) {
    new TransactionTemplate(transactionManager)
    .execute(new TransactionCallbackWithoutResult(){
      @Override
      protected void doInTransactionWithoutResult(TransactionStatus status) {
          try {
            doTask(context);
          } catch (Exception e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.