Package net.sf.hajdbc.durability

Examples of net.sf.hajdbc.durability.InvokerEvent


        {
          InvokerKey key = entry.getKey();
          Map<String, InvokerEvent> invokers = result.get(new InvocationEventImpl(txIdFactory.deserialize(key.getTransactionId()), Durability.Phase.values()[key.getPhase()], null));
          if (invokers != null)
          {
            InvokerEvent invoker = new InvokerEventImpl(txIdFactory.deserialize(key.getTransactionId()), Durability.Phase.values()[key.getPhase()], key.getDatabaseId());
            byte[] value = entry.getValue();
            if (value.length > 0)
            {
              invoker.setResult(Objects.<InvokerResult>deserialize(value));
            }
            invokers.put(key.getDatabaseId(), invoker);
          }
        }
        return null;
View Full Code Here


             
              Map<String, InvokerEvent> invokers = map.get(new InvocationEventImpl(txId, phase, null));
              if (invokers != null)
              {
                String databaseId = cursor.getString(DATABASE_COLUMN);
                InvokerEvent event = new InvokerEventImpl(txId, phase, databaseId);
               
                if (!cursor.isNull(RESULT_COLUMN))
                {
                  byte[] result = cursor.getBlobAsArray(RESULT_COLUMN);
                  event.setResult(Objects.<InvokerResult>deserialize(result));
                }

                invokers.put(databaseId, event);
              }
            }
View Full Code Here

  @Override
  public Void execute(StateCommandContext<Z, D> context)
  {
    Map<InvocationEvent, Map<String, InvokerEvent>> invokers = context.getRemoteInvokers(this.descriptor);

    InvokerEvent event = this.descriptor.getEvent();
    String databaseId = event.getDatabaseId();
   
    synchronized (invokers)
    {
      Map<String, InvokerEvent> map = invokers.get(event);
     
View Full Code Here

    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
        {
View Full Code Here

    }
  }
 
  private boolean deactivateSlave(D primary, D backup, InvocationEvent invocation, Map<String, InvokerEvent> invokers)
  {
    InvokerEvent primaryEvent = invokers.get(primary.getId());
   
    if (primaryEvent != null)
    {
      InvokerResult result = primaryEvent.getResult();
     
      if (result != null)
      {
        Object primaryValue = result.getValue();
        Exception primaryException = result.getException();
       
        InvokerEvent backupEvent = invokers.get(backup.getId());
       
        if (backupEvent != null)
        {
          InvokerResult backupResult = backupEvent.getResult();
         
          if (backupResult != null)
          {
            Object backupValue = backupResult.getValue();
            Exception backupException = backupResult.getException();
View Full Code Here

           
            if (invokers != null)
            {
              String databaseId = resultSet.getString(3);
             
              InvokerEvent event = new InvokerEventImpl(txId, phase, databaseId);
             
              byte[] bytes = resultSet.getBytes(4);
             
              if (!resultSet.wasNull())
              {
                event.setResult(Objects.<InvokerResult>deserialize(bytes));
              }

              invokers.put(databaseId, event);
            }
          }
View Full Code Here

        {
          InvokerKey key = entry.getKey();
          Map<String, InvokerEvent> invokers = result.get(new InvocationEventImpl(txIdFactory.deserialize(key.getTransactionId()), Durability.Phase.values()[key.getPhase()], null));
          if (invokers != null)
          {
            InvokerEvent invoker = new InvokerEventImpl(txIdFactory.deserialize(key.getTransactionId()), Durability.Phase.values()[key.getPhase()], key.getDatabaseId());
            byte[] value = entry.getValue();
            if (value.length > 0)
            {
              invoker.setResult(Objects.<InvokerResult>deserialize(value));
            }
            invokers.put(key.getDatabaseId(), invoker);
          }
        }
        return null;
View Full Code Here

           
            if (invokers != null)
            {
              String databaseId = resultSet.getString(3);
             
              InvokerEvent event = new InvokerEventImpl(txId, phase, databaseId);
             
              byte[] bytes = resultSet.getBytes(4);
             
              if (!resultSet.wasNull())
              {
                event.setResult(Objects.<InvokerResult>deserialize(bytes));
              }

              invokers.put(databaseId, event);
            }
          }
View Full Code Here

           
            if (invokers != null)
            {
              String databaseId = resultSet.getString(3);
             
              InvokerEvent event = new InvokerEventImpl(txId, phase, databaseId);
             
              byte[] bytes = resultSet.getBytes(4);
             
              if (!resultSet.wasNull())
              {
                event.setResult(Objects.<InvokerResult>deserialize(bytes));
              }

              invokers.put(databaseId, event);
            }
          }
View Full Code Here

TOP

Related Classes of net.sf.hajdbc.durability.InvokerEvent

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.