Examples of OperationEntry


Examples of net.kuujo.copycat.internal.log.OperationEntry

    }
    log.delete();
  }

  public void testAppendEntries() throws Exception {
    Entry entry = new OperationEntry(1, "foo", "bar");
    assertEquals(log.appendEntries(entry, entry, entry), Arrays.asList(1L, 2L, 3L));
  }
View Full Code Here

Examples of net.kuujo.copycat.internal.log.OperationEntry

    Entry entry = new OperationEntry(1, "foo", "bar");
    assertEquals(log.appendEntries(entry, entry, entry), Arrays.asList(1L, 2L, 3L));
  }

  public void testAppendEntry() throws Exception {
    assertEquals(log.appendEntry(new OperationEntry(1, "foo", "bar")), 1);
    assertEquals(log.appendEntry(new OperationEntry(1, "foo", "bar")), 2);
    assertEquals(log.appendEntry(new OperationEntry(1, "foo", "bar")), 3);
  }
View Full Code Here

Examples of net.kuujo.copycat.internal.log.OperationEntry

  }

  @Test(expectedExceptions = IllegalStateException.class)
  public void testThrowsIllegalStateExceptionWhenClosed() throws Exception {
    log.close();
    log.appendEntry(new OperationEntry(1, "foo", "bar"));
  }
View Full Code Here

Examples of net.kuujo.copycat.internal.log.OperationEntry

    assertEquals(log.firstIndex(), 3);
    assertEquals(log.lastIndex(), 5);
    SnapshotEntry entry = log.getEntry(3);
    assertEquals(entry.term(), 1);
    assertEquals("Hello world!", new String(entry.data()));
    OperationEntry entry2 = log.getEntry(4);
    assertEquals(entry2.term(), 1);
    assertEquals("bar", entry2.operation());
    OperationEntry entry3 = log.getEntry(5);
    assertEquals(entry3.term(), 1);
    assertEquals("baz", entry3.operation());
  }
View Full Code Here

Examples of net.kuujo.copycat.internal.log.OperationEntry

    assertTrue(log.getEntry(3) instanceof OperationEntry);
  }

  public void testIsEmpty() {
    assertTrue(log.isEmpty());
    assertEquals(log.appendEntry(new OperationEntry(1, "foo", "bar")), 1);
    assertFalse(log.isEmpty());
  }
View Full Code Here

Examples of net.kuujo.copycat.internal.log.OperationEntry

    assertTrue(log.lastEntry() instanceof ConfigurationEntry);
  }

  public void testSize() {
    long size = log.size();
    log.appendEntry(new OperationEntry(1, "foo", "bar"));
    assertNotEquals(size, size = log.size());
    log.appendEntry(new OperationEntry(1, "foo", "bar"));
    assertNotEquals(size, size = log.size());
    log.appendEntry(new OperationEntry(1, "foo", "bar"));
    assertNotEquals(size, size = log.size());
  }
View Full Code Here

Examples of net.kuujo.copycat.internal.log.OperationEntry

      .withLocalMember(new Member("foo"))
      .withRemoteMembers(new Member("bar"), new Member("baz")), new byte[10]));
    log.appendEntry(new ConfigurationEntry(1, new ClusterConfig()
      .withLocalMember(new Member("foo"))
      .withRemoteMembers(new Member("bar"), new Member("baz"))));
    log.appendEntry(new OperationEntry(1, "foo", Arrays.asList("bar", "baz")));
    log.appendEntry(new OperationEntry(1, "bar", Arrays.asList("bar", "baz")));
    log.appendEntry(new OperationEntry(1, "baz", Arrays.asList("bar", "baz")));
  }
View Full Code Here

Examples of org.jboss.as.controller.registry.OperationEntry

            throw createInstanceNotFoundException(name);
        }
        final ImmutableManagementResourceRegistration registration = getMBeanRegistration(address, reg);

        String realOperationName = null;
        OperationEntry opEntry = registration.getOperationEntry(PathAddress.EMPTY_ADDRESS, operationName);

        if (opEntry != null) {
            realOperationName = operationName;
        } else {
            Map<String, OperationEntry> ops = registration.getOperationDescriptions(PathAddress.EMPTY_ADDRESS, false);
View Full Code Here

Examples of org.jboss.as.controller.registry.OperationEntry

                        opName.equals(RootResourceHack.NAME)) {
                    //Ignore some of the global operations which probably don't make much sense here
                    continue;
                }
            }
            final OperationEntry opEntry = entry.getValue();
            if (standalone ? true : opEntry.getFlags().contains(OperationEntry.Flag.READ_ONLY)) {
                ops.add(getOperation(NameConverter.convertToCamelCase(entry.getKey()), null, opEntry));
            }
        }
        addChildAddOperations(ops, resourceRegistration);
        return ops.toArray(new OpenMBeanOperationInfo[ops.size()]);
View Full Code Here

Examples of org.jboss.as.controller.registry.OperationEntry

    static Map<PathElement, ChildAddOperationEntry> findAddChildOperations(ImmutableManagementResourceRegistration resourceRegistration){
        Map<PathElement, ChildAddOperationEntry> operations = new HashMap<PathElement, ChildAddOperationEntry>();
        for(PathElement childElement : resourceRegistration.getChildAddresses(PathAddress.EMPTY_ADDRESS)) {
            final ImmutableManagementResourceRegistration childReg = resourceRegistration.getSubModel(PathAddress.pathAddress(childElement));
            final Map<String, OperationEntry> registeredOps = childReg.getOperationDescriptions(PathAddress.EMPTY_ADDRESS, false);
            final OperationEntry childAdd = registeredOps.get(ADD);
            if (childAdd != null) {
                operations.put(childElement, new ChildAddOperationEntry(childAdd, childElement));
            }
        }
        return operations;
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.