Search in sources :

Example 11 with AllowConcurrentEvents

use of com.google.common.eventbus.AllowConcurrentEvents in project killbill by killbill.

the class InvoiceListener method handleChildrenInvoiceAdjustmentEvent.

@AllowConcurrentEvents
@Subscribe
public void handleChildrenInvoiceAdjustmentEvent(final DefaultInvoiceAdjustmentEvent event) {
    try {
        final InternalCallContext context = internalCallContextFactory.createInternalCallContext(event.getSearchKey2(), event.getSearchKey1(), "AdjustParentInvoice", CallOrigin.INTERNAL, UserType.SYSTEM, event.getUserToken());
        final Account account = accountApi.getAccountById(event.getAccountId(), context);
        // catch children invoices and populate the parent summary invoice
        if (isChildrenAccountAndPaymentDelegated(account)) {
            dispatcher.processParentInvoiceForAdjustments(account, event.getInvoiceId(), context);
        }
    } catch (InvoiceApiException e) {
        log.error(e.getMessage());
    } catch (AccountApiException e) {
        log.error(e.getMessage());
    }
}
Also used : Account(org.killbill.billing.account.api.Account) InvoiceApiException(org.killbill.billing.invoice.api.InvoiceApiException) AccountApiException(org.killbill.billing.account.api.AccountApiException) InternalCallContext(org.killbill.billing.callcontext.InternalCallContext) AllowConcurrentEvents(com.google.common.eventbus.AllowConcurrentEvents) Subscribe(com.google.common.eventbus.Subscribe)

Example 12 with AllowConcurrentEvents

use of com.google.common.eventbus.AllowConcurrentEvents in project killbill by killbill.

the class InvoiceTagHandler method process_AUTO_INVOICING_OFF_removal.

@AllowConcurrentEvents
@Subscribe
public void process_AUTO_INVOICING_OFF_removal(final ControlTagDeletionInternalEvent event) {
    if (event.getTagDefinition().getName().equals(ControlTagType.AUTO_INVOICING_OFF.toString()) && event.getObjectType() == ObjectType.ACCOUNT) {
        final UUID accountId = event.getObjectId();
        final InternalCallContext context = internalCallContextFactory.createInternalCallContext(event.getSearchKey2(), event.getSearchKey1(), "InvoiceTagHandler", CallOrigin.INTERNAL, UserType.SYSTEM, event.getUserToken());
        processUnpaid_AUTO_INVOICING_OFF_invoices(accountId, context);
    }
}
Also used : InternalCallContext(org.killbill.billing.callcontext.InternalCallContext) UUID(java.util.UUID) AllowConcurrentEvents(com.google.common.eventbus.AllowConcurrentEvents) Subscribe(com.google.common.eventbus.Subscribe)

Example 13 with AllowConcurrentEvents

use of com.google.common.eventbus.AllowConcurrentEvents in project killbill by killbill.

the class PaymentTagHandler method process_AUTO_PAY_OFF_removal.

@AllowConcurrentEvents
@Subscribe
public void process_AUTO_PAY_OFF_removal(final ControlTagDeletionInternalEvent event) {
    if (event.getTagDefinition().getName().equals(ControlTagType.AUTO_PAY_OFF.toString()) && event.getObjectType() == ObjectType.ACCOUNT) {
        final UUID accountId = event.getObjectId();
        processUnpaid_AUTO_PAY_OFF_payments(accountId, event.getSearchKey1(), event.getSearchKey2(), event.getUserToken());
    }
}
Also used : UUID(java.util.UUID) AllowConcurrentEvents(com.google.common.eventbus.AllowConcurrentEvents) Subscribe(com.google.common.eventbus.Subscribe)

Aggregations

AllowConcurrentEvents (com.google.common.eventbus.AllowConcurrentEvents)13 Subscribe (com.google.common.eventbus.Subscribe)13 InternalCallContext (org.killbill.billing.callcontext.InternalCallContext)7 UUID (java.util.UUID)4 AccountApiException (org.killbill.billing.account.api.AccountApiException)4 InvoiceApiException (org.killbill.billing.invoice.api.InvoiceApiException)4 Account (org.killbill.billing.account.api.Account)3 Connection (java.sql.Connection)2 PreparedStatement (java.sql.PreparedStatement)2 ArrayList (java.util.ArrayList)2 AbstractShardingDataBasesOnlyDBUnitTest (com.dangdang.ddframe.rdb.integrate.db.AbstractShardingDataBasesOnlyDBUnitTest)1 DMLExecutionEvent (com.dangdang.ddframe.rdb.sharding.executor.event.DMLExecutionEvent)1 DMLExecutionEventListener (com.dangdang.ddframe.rdb.sharding.executor.event.DMLExecutionEventListener)1 SoftTransactionConfiguration (com.dangdang.ddframe.rdb.transaction.soft.api.config.SoftTransactionConfiguration)1 BEDSoftTransaction (com.dangdang.ddframe.rdb.transaction.soft.bed.BEDSoftTransaction)1 TransactionLog (com.dangdang.ddframe.rdb.transaction.soft.storage.TransactionLog)1 TransactionLogStorage (com.dangdang.ddframe.rdb.transaction.soft.storage.TransactionLogStorage)1 ActionOwner (com.google.devtools.build.lib.actions.ActionOwner)1 Artifact (com.google.devtools.build.lib.actions.Artifact)1 ConfiguredTarget (com.google.devtools.build.lib.analysis.ConfiguredTarget)1