Codota Logo
PluginDispatcher
Code IndexAdd Codota to your IDE (free)

How to use
PluginDispatcher
in
com.ning.billing.payment.dispatcher

Best Java code snippets using com.ning.billing.payment.dispatcher.PluginDispatcher (Showing top 8 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
origin: com.ning.billing/killbill-payment

public T dispatchWithAccountLock(final Callable<T> task)
    throws PaymentApiException, TimeoutException {
  return dispatchWithAccountLockAndTimeout(task, timeoutSeconds, DEEFAULT_PLUGIN_TIMEOUT_UNIT);
}
origin: com.ning.billing/killbill-payment

final PaymentPluginApi plugin = getPaymentProviderPlugin(account, context);
voidPluginDispatcher.dispatchWithAccountLock(new CallableWithAccountLock<Void>(locker,
                                        account.getExternalKey(),
                                        new WithAccountLockCallback<Void>() {
origin: com.ning.billing/killbill-payment

@Inject
public PaymentProcessor(final OSGIServiceRegistration<PaymentPluginApi> pluginRegistry,
            final PaymentMethodProcessor paymentMethodProcessor,
            final AccountInternalApi accountUserApi,
            final InvoiceInternalApi invoiceApi,
            final TagInternalApi tagUserApi,
            final FailedPaymentRetryServiceScheduler failedPaymentRetryService,
            final PluginFailureRetryServiceScheduler pluginFailureRetryService,
            final AutoPayRetryServiceScheduler autoPayoffRetryService,
            final PaymentDao paymentDao,
            final NonEntityDao nonEntityDao,
            final PersistentBus eventBus,
            final Clock clock,
            final GlobalLocker locker,
            final PaymentConfig paymentConfig,
            @Named(PLUGIN_EXECUTOR_NAMED) final ExecutorService executor) {
  super(pluginRegistry, accountUserApi, eventBus, paymentDao, nonEntityDao, tagUserApi, locker, executor, invoiceApi);
  this.paymentMethodProcessor = paymentMethodProcessor;
  this.failedPaymentRetryService = failedPaymentRetryService;
  this.pluginFailureRetryService = pluginFailureRetryService;
  this.autoPayoffRetryService = autoPayoffRetryService;
  this.clock = clock;
  this.paymentConfig = paymentConfig;
  final long paymentPluginTimeoutSec = TimeUnit.SECONDS.convert(paymentConfig.getPaymentPluginTimeout().getPeriod(), paymentConfig.getPaymentPluginTimeout().getUnit());
  this.paymentPluginDispatcher = new PluginDispatcher<Payment>(paymentPluginTimeoutSec, executor);
  this.voidPluginDispatcher = new PluginDispatcher<Void>(paymentPluginTimeoutSec, executor);
}
origin: com.ning.billing/killbill-payment

public void process_AUTO_PAY_OFF_removal(final Account account, final InternalCallContext context) throws PaymentApiException {
    voidPluginDispatcher.dispatchWithAccountLock(new CallableWithAccountLock<Void>(locker,
                                            account.getExternalKey(),
                                            new WithAccountLockCallback<Void>() {
origin: com.ning.billing/killbill-payment

@Test(groups = "fast")
public void testDispatchWithPaymentApiException() throws TimeoutException, PaymentApiException {
  boolean gotIt = false;
  try {
    voidPluginDispatcher.dispatchWithAccountLockAndTimeout(new Callable<Void>() {
      @Override
      public Void call() throws Exception {
        throw new PaymentApiException(ErrorCode.PAYMENT_ADD_PAYMENT_METHOD, "foo", "foo");
      }
    }, 100, TimeUnit.MILLISECONDS);
    Assert.fail("Failed : should have had Timeout exception");
  } catch (TimeoutException e) {
    Assert.fail("Failed : should have had PaymentApiException exception");
  } catch (PaymentApiException e) {
    gotIt = true;
  }
  Assert.assertTrue(gotIt);
}
origin: com.ning.billing/killbill-payment

return paymentPluginDispatcher.dispatchWithAccountLock(new CallableWithAccountLock<Payment>(locker,
                                              account.getExternalKey(),
                                              new WithAccountLockCallback<Payment>() {
origin: com.ning.billing/killbill-payment

  @Test(groups = "fast")
  public void testDispatchWithRuntimeExceptionWrappedInPaymentApiException() throws TimeoutException, PaymentApiException {
    boolean gotIt = false;
    try {
      voidPluginDispatcher.dispatchWithAccountLockAndTimeout(new Callable<Void>() {
        @Override
        public Void call() throws Exception {
          throw new RuntimeException("whatever");
        }
      }, 100, TimeUnit.MILLISECONDS);
      Assert.fail("Failed : should have had Timeout exception");
    } catch (TimeoutException e) {
      Assert.fail("Failed : should have had RuntimeException exception");
    } catch (PaymentApiException e) {
      gotIt = true;
    } catch (RuntimeException e) {
    }
    Assert.assertTrue(gotIt);
  }
}
origin: com.ning.billing/killbill-payment

@Test(groups = "fast")
public void testDispatchWithTimeout() throws TimeoutException, PaymentApiException {
  boolean gotIt = false;
  try {
    voidPluginDispatcher.dispatchWithAccountLockAndTimeout(new Callable<Void>() {
      @Override
      public Void call() throws Exception {
        Thread.sleep(1000);
        return null;
      }
    }, 100, TimeUnit.MILLISECONDS);
    Assert.fail("Failed : should have had Timeout exception");
  } catch (TimeoutException e) {
    gotIt = true;
  } catch (PaymentApiException e) {
    Assert.fail("Failed : should have had Timeout exception");
  }
  Assert.assertTrue(gotIt);
}
com.ning.billing.payment.dispatcherPluginDispatcher

Most used methods

  • dispatchWithAccountLockAndTimeout
  • <init>
  • dispatchWithAccountLock

Popular in Java

  • Finding current android device location
  • addToBackStack (FragmentTransaction)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • getSystemService (Context)
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • DecimalFormat (java.text)
    DecimalFormat is a concrete subclass ofNumberFormat that formats decimal numbers. It has a variety o
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • DataSource (javax.sql)
    A factory for connections to the physical data source that this DataSource object represents. An alt
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now