Examples of DurabilityListener


Examples of net.sf.hajdbc.durability.DurabilityListener

   * @see net.sf.hajdbc.durability.none.NoDurability#getInvocationStrategy(net.sf.hajdbc.invocation.InvocationStrategy, net.sf.hajdbc.durability.Durability.Phase, java.lang.Object)
   */
  @Override
  public InvocationStrategy getInvocationStrategy(final InvocationStrategy strategy, final Phase phase, final Object transactionId)
  {
    final DurabilityListener listener = this.cluster.getStateManager();

    return new InvocationStrategy()
    {
      @Override
      public <ZZ, DD extends Database<ZZ>, T, R, EE extends Exception> SortedMap<DD, R> invoke(ProxyFactory<ZZ, DD, T, EE> proxy, Invoker<ZZ, DD, T, R, EE> invoker) throws EE
      {
        InvocationEvent event = new InvocationEventImpl(transactionId, phase, proxy.getExceptionFactory().getType());

        listener.beforeInvocation(event);

        try
        {
          return strategy.invoke(proxy, invoker);
        }
        catch (Exception e)
        {
          throw proxy.getExceptionFactory().createException(e);
        }
        finally
        {
          listener.afterInvocation(event);
        }
      }
    };
  }
View Full Code Here

Examples of net.sf.hajdbc.durability.DurabilityListener

   * @see net.sf.hajdbc.durability.none.NoDurability#getInvoker(net.sf.hajdbc.invocation.Invoker, net.sf.hajdbc.durability.Durability.Phase, java.lang.Object, net.sf.hajdbc.ExceptionFactory)
   */
  @Override
  public <T, R, E extends Exception> Invoker<Z, D, T, R, E> getInvoker(final Invoker<Z, D, T, R, E> invoker, final Phase phase, final Object transactionId, final ExceptionFactory<E> exceptionFactory)
  {
    final DurabilityListener listener = this.cluster.getStateManager();
   
    return new Invoker<Z, D, T, R, E>()
    {
      @Override
      public R invoke(D database, T object) throws E
      {
        InvokerEvent event = new InvokerEventImpl(transactionId, phase, database.getId());
       
        listener.beforeInvoker(event);
       
        try
        {
          R result = invoker.invoke(database, object);
         
          event.setResult(new InvokerResultImpl(result));
         
          return result;
        }
        catch (Exception e)
        {
          event.setResult(new InvokerResultImpl(e));
         
          throw exceptionFactory.createException(e);
        }
        finally
        {
          listener.afterInvoker(event);
        }
      }
    };
  }
View Full Code Here

Examples of org.voltdb.CommandLog.DurabilityListener

    SpScheduler(int partitionId, SiteTaskerQueue taskQueue, SnapshotCompletionMonitor snapMonitor)
    {
        super(partitionId, taskQueue);
        m_pendingTasks = new TransactionTaskQueue(m_tasks,getCurrentTxnId());
        m_snapMonitor = snapMonitor;
        m_durabilityListener = new DurabilityListener() {
            @Override
            public void onDurability(final ArrayList<Object> durableThings) {
                final SiteTaskerRunnable r = new SiteTasker.SiteTaskerRunnable() {
                    @Override
                    void run() {
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.