Package net.sf.hajdbc.durability

Examples of net.sf.hajdbc.durability.InvocationEventImpl


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


      Void execute(Database database)
      {
        for (Map.Entry<InvocationKey, Byte> entry: createInvocationMap(database, true).entrySet())
        {
          InvocationKey key = entry.getKey();
          result.put(new InvocationEventImpl(txIdFactory.deserialize(key.getTransactionId()), Durability.Phase.values()[key.getPhase()], ExceptionType.values()[entry.getValue()]), new HashMap<String, InvokerEvent>());
        }
        return null;
      }
    };
    this.execute(query);
    query = new DatabaseQuery<Void>(INVOKER)
    {
      @Override
      Void execute(Database database)
      {
        for (Map.Entry<InvokerKey, byte[]> entry: createInvokerMap(database, true).entrySet())
        {
          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)
View Full Code Here

            do
            {
              Object txId = txIdFactory.deserialize(cursor.getBlobAsArray(TRANSACTION_COLUMN));
              Durability.Phase phase = Durability.Phase.values()[(int) cursor.getInteger(PHASE_COLUMN)];
              ExceptionType type = ExceptionType.values()[(int) cursor.getInteger(EXCEPTION_COLUMN)];
              map.put(new InvocationEventImpl(txId, phase, type), new HashMap<String, InvokerEvent>());
            }
            while (cursor.next());
          }
        }
        finally
        {
          cursor.close();
        }
        cursor = database.getTable(INVOKER_TABLE).open();
        try
        {
          if (!cursor.eof())
          {
            do
            {
              Object txId = txIdFactory.deserialize(cursor.getBlobAsArray(TRANSACTION_COLUMN));
              Durability.Phase phase = Durability.Phase.values()[(int) cursor.getInteger(PHASE_COLUMN)];
             
              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);
               
View Full Code Here

          while (resultSet.next())
          {
            Object txId = txIdFactory.deserialize(resultSet.getBytes(1));
            Durability.Phase phase = Durability.Phase.values()[resultSet.getInt(2)];
            ExceptionType type = ExceptionType.values()[resultSet.getInt(3)];
            map.put(new InvocationEventImpl(txId, phase, type), new HashMap<String, InvokerEvent>());
          }
        }
        finally
        {
          Resources.close(statement);
        }

        statement = connection.prepareStatement(SELECT_INVOKER_SQL);

        try
        {
          ResultSet resultSet = statement.executeQuery();
         
          while (resultSet.next())
          {
            Object txId = txIdFactory.deserialize(resultSet.getBytes(1));
            Durability.Phase phase = Durability.Phase.values()[resultSet.getByte(2)];
           
            Map<String, InvokerEvent> invokers = map.get(new InvocationEventImpl(txId, phase, null));
           
            if (invokers != null)
            {
              String databaseId = resultSet.getString(3);
             
View Full Code Here

          while (resultSet.next())
          {
            Object txId = txIdFactory.deserialize(resultSet.getBytes(1));
            Durability.Phase phase = Durability.Phase.values()[resultSet.getInt(2)];
            ExceptionType type = ExceptionType.values()[resultSet.getInt(3)];
            map.put(new InvocationEventImpl(txId, phase, type), new HashMap<String, InvokerEvent>());
          }
        }
        finally
        {
          Resources.close(statement);
        }

        statement = connection.prepareStatement(SELECT_INVOKER_SQL);

        try
        {
          ResultSet resultSet = statement.executeQuery();
         
          while (resultSet.next())
          {
            Object txId = txIdFactory.deserialize(resultSet.getBytes(1));
            Durability.Phase phase = Durability.Phase.values()[resultSet.getByte(2)];
           
            Map<String, InvokerEvent> invokers = map.get(new InvocationEventImpl(txId, phase, null));
           
            if (invokers != null)
            {
              String databaseId = resultSet.getString(3);
             
View Full Code Here

      Void execute(Database database)
      {
        for (Map.Entry<InvocationKey, Byte> entry: createInvocationMap(database, true).entrySet())
        {
          InvocationKey key = entry.getKey();
          result.put(new InvocationEventImpl(txIdFactory.deserialize(key.getTransactionId()), Durability.Phase.values()[key.getPhase()], ExceptionType.values()[entry.getValue()]), new HashMap<String, InvokerEvent>());
        }
        return null;
      }
    };
    this.execute(query);
    query = new DatabaseQuery<Void>(INVOKER)
    {
      @Override
      Void execute(Database database)
      {
        for (Map.Entry<InvokerKey, byte[]> entry: createInvokerMap(database, true).entrySet())
        {
          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)
View Full Code Here

          while (resultSet.next())
          {
            Object txId = txIdFactory.deserialize(resultSet.getBytes(1));
            Durability.Phase phase = Durability.Phase.values()[resultSet.getInt(2)];
            ExceptionType type = ExceptionType.values()[resultSet.getInt(3)];
            map.put(new InvocationEventImpl(txId, phase, type), new HashMap<String, InvokerEvent>());
          }
        }
        finally
        {
          Resources.close(statement);
        }

        statement = connection.prepareStatement(SELECT_INVOKER_SQL);

        try
        {
          ResultSet resultSet = statement.executeQuery();
         
          while (resultSet.next())
          {
            Object txId = txIdFactory.deserialize(resultSet.getBytes(1));
            Durability.Phase phase = Durability.Phase.values()[resultSet.getByte(2)];
           
            Map<String, InvokerEvent> invokers = map.get(new InvocationEventImpl(txId, phase, null));
           
            if (invokers != null)
            {
              String databaseId = resultSet.getString(3);
             
View Full Code Here

TOP

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

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.