@Test public void testAccessByName() { PersistTestImpl p1 = new PersistTestImpl(); TrioConveyor tc1 = new TrioConveyor(); PersistentConveyor<Integer, TrioPart, Trio> pc1 = new PersistentConveyor(p1, tc1); pc1.setName("test_name"); Conveyor pc2 = Conveyor.byName("test_name"); assertEquals(pc1,pc2); }
@Override public void setName(String string) { this.name = string; forward.setName("Persistent<"+string+">"); this.setMbean(string); ackConveyor.setName("AcknowledgeBuildingConveyor<" + string + ">"); cleaner.setName("PersistenceCleanupBatchConveyor<" + string + ">"); }
PersistentConveyor implements Conveyor<K, L, OUT> { @Override public void setName(String string) { this.name = string; forward.setName("Persistent<"+string+">"); this.setMbean(string); ackConveyor.setName("AcknowledgeBuildingConveyor<" + string + ">"); cleaner.setName("PersistenceCleanupBatchConveyor<" + string + ">"); } }
PersistentConveyor implements Conveyor<K, L, OUT> { @Override public void setName(String string) { this.name = string; forward.setName("Persistent<"+string+">"); this.setMbean(string); ackConveyor.setName("AcknowledgeBuildingConveyor<" + string + ">"); cleaner.setName("PersistenceCleanupBatchConveyor<" + string + ">"); } PersistentConveyor(Persistence<K> persistence, Conveyor<K, L, OUT> forward);   PersistentConveyor(Persistence<K> persistence);   PersistentConveyor(Persistence<K> persistence, Supplier<Conveyor<K, L, OUT>> forwardSupplier); }
PersistentConveyor implements Conveyor<K, L, OUT> { @Override public void setName(String string) { this.name = string; forward.setName("Persistent<"+string+">"); this.setMbean(string); ackConveyor.setName("AcknowledgeBuildingConveyor<" + string + ">"); cleaner.setName("PersistenceCleanupBatchConveyor<" + string + ">"); } PersistentConveyor(Persistence<K> persistence, Conveyor<K, L, OUT> forward);   PersistentConveyor(Persistence<K> persistence);   PersistentConveyor(Persistence<K> persistence, Supplier<Conveyor<K, L, OUT>> forwardSupplier); void setSkipPersistencePropertyKey(String doNotPersist); @Override PartLoader<K, L> part(); @Override StaticPartLoader<L> staticPart(); @Override BuilderLoader<K, OUT> build(); @Override FutureLoader<K, OUT> future(); @Override CommandLoader<K, OUT> command(); @Override CompletableFuture<Boolean> place(Cart<K, V, L> cart); @Override CompletableFuture<Boolean> command(GeneralCommand<K, V> command); @Override ResultConsumerLoader<K, OUT> resultConsumer(); @Override ResultConsumerLoader<K, OUT> resultConsumer(ResultConsumer<K, OUT> consumer); @Override int getCollectorSize(); @Override int getInputQueueSize(); @Override int getDelayedQueueSize(); @Override ScrapConsumerLoader<K> scrapConsumer(); @Override ScrapConsumerLoader<K> scrapConsumer(ScrapConsumer<K, ?> scrapConsumer); @Override void stop(); @Override CompletableFuture<Boolean> completeAndStop(); @Override void setIdleHeartBeat(long heartbeat, TimeUnit unit); @Override void setIdleHeartBeat(Duration duration); @Override void setDefaultBuilderTimeout(long builderTimeout, TimeUnit unit); @Override void setDefaultBuilderTimeout(Duration duration); @Override void rejectUnexpireableCartsOlderThan(long timeout, TimeUnit unit); @Override void rejectUnexpireableCartsOlderThan(Duration duration); @Override void setOnTimeoutAction(Consumer<Supplier<? extends OUT>> timeoutAction); @Override void setDefaultCartConsumer(LabeledValueConsumer<L, ?, B> cartConsumer); @Override void setReadinessEvaluator(BiPredicate<State<K, L>, Supplier<? extends OUT>> ready); @Override void setReadinessEvaluator(Predicate<Supplier<? extends OUT>> readiness); @Override void setBuilderSupplier(BuilderSupplier<OUT> builderSupplier); @Override void setName(String string); @Override boolean isRunning(); @Override void addCartBeforePlacementValidator(Consumer<Cart<K, ?, L>> cartBeforePlacementValidator); @Override void addBeforeKeyEvictionAction(Consumer<AcknowledgeStatus<K>> keyBeforeEviction); @Override void addBeforeKeyReschedulingAction(BiConsumer<K, Long> keyBeforeRescheduling); @Override long getExpirationTime(K key); @Override boolean isLBalanced(); @Override Set<L> getAcceptedLabels(); @SuppressWarnings("unchecked") @Override void acceptLabels(L... labels); @Override String getName(); @Override void enablePostponeExpiration(boolean flag); @Override void enablePostponeExpirationOnTimeout(boolean flag); @Override void setExpirationPostponeTime(long time, TimeUnit unit); @Override void setExpirationPostponeTime(Duration duration); @Override boolean isForwardingResults(); @Override long getCartCounter(); @Override void setAutoAcknowledge(boolean auto); @Override void setAcknowledgeAction(Consumer<AcknowledgeStatus<K>> ackAction); Conveyor<K, L, OUT> getWorkingConveyor(); AcknowledgeBuildingConveyor<K> getAcknowledgeBuildingConveyor(); PersistenceCleanupBatchConveyor<K> getCleaningConveyor(); @Override void autoAcknowledgeOnStatus(Status first, Status... other); @Override ResultConsumer<K, OUT> getResultConsumer(); void unloadOnBuilderTimeout(boolean unload); @Override void interrupt(String conveyorName); @Override void setCartPayloadAccessor(Function<Cart<K, ?, L>, Object> payloadFunction); CompletableFuture<Boolean> compact(K key); CompletableFuture<Boolean> compact(); CompletableFuture<Boolean> compact(SerializablePredicate<K> p); @Override void suspend(); @Override void resume(); @Override boolean isSuspended(); @Override Class<?> mBeanInterface(); }
PersistentConveyor implements Conveyor<K, L, OUT> { @Override public void setName(String string) { this.name = string; forward.setName("Persistent<"+string+">"); this.setMbean(string); ackConveyor.setName("AcknowledgeBuildingConveyor<" + string + ">"); cleaner.setName("PersistenceCleanupBatchConveyor<" + string + ">"); } PersistentConveyor(Persistence<K> persistence, Conveyor<K, L, OUT> forward);   PersistentConveyor(Persistence<K> persistence);   PersistentConveyor(Persistence<K> persistence, Supplier<Conveyor<K, L, OUT>> forwardSupplier); void setSkipPersistencePropertyKey(String doNotPersist); @Override PartLoader<K, L> part(); @Override StaticPartLoader<L> staticPart(); @Override BuilderLoader<K, OUT> build(); @Override FutureLoader<K, OUT> future(); @Override CommandLoader<K, OUT> command(); @Override CompletableFuture<Boolean> place(Cart<K, V, L> cart); @Override CompletableFuture<Boolean> command(GeneralCommand<K, V> command); @Override ResultConsumerLoader<K, OUT> resultConsumer(); @Override ResultConsumerLoader<K, OUT> resultConsumer(ResultConsumer<K, OUT> consumer); @Override int getCollectorSize(); @Override int getInputQueueSize(); @Override int getDelayedQueueSize(); @Override ScrapConsumerLoader<K> scrapConsumer(); @Override ScrapConsumerLoader<K> scrapConsumer(ScrapConsumer<K, ?> scrapConsumer); @Override void stop(); @Override CompletableFuture<Boolean> completeAndStop(); @Override void setIdleHeartBeat(long heartbeat, TimeUnit unit); @Override void setIdleHeartBeat(Duration duration); @Override void setDefaultBuilderTimeout(long builderTimeout, TimeUnit unit); @Override void setDefaultBuilderTimeout(Duration duration); @Override void rejectUnexpireableCartsOlderThan(long timeout, TimeUnit unit); @Override void rejectUnexpireableCartsOlderThan(Duration duration); @Override void setOnTimeoutAction(Consumer<Supplier<? extends OUT>> timeoutAction); @Override void setDefaultCartConsumer(LabeledValueConsumer<L, ?, B> cartConsumer); @Override void setReadinessEvaluator(BiPredicate<State<K, L>, Supplier<? extends OUT>> ready); @Override void setReadinessEvaluator(Predicate<Supplier<? extends OUT>> readiness); @Override void setBuilderSupplier(BuilderSupplier<OUT> builderSupplier); @Override void setName(String string); @Override boolean isRunning(); @Override void addCartBeforePlacementValidator(Consumer<Cart<K, ?, L>> cartBeforePlacementValidator); @Override void addBeforeKeyEvictionAction(Consumer<AcknowledgeStatus<K>> keyBeforeEviction); @Override void addBeforeKeyReschedulingAction(BiConsumer<K, Long> keyBeforeRescheduling); @Override long getExpirationTime(K key); @Override boolean isLBalanced(); @Override Set<L> getAcceptedLabels(); @SuppressWarnings("unchecked") @Override void acceptLabels(L... labels); @Override String getName(); @Override void enablePostponeExpiration(boolean flag); @Override void enablePostponeExpirationOnTimeout(boolean flag); @Override void setExpirationPostponeTime(long time, TimeUnit unit); @Override void setExpirationPostponeTime(Duration duration); @Override boolean isForwardingResults(); @Override long getCartCounter(); @Override void setAutoAcknowledge(boolean auto); @Override void setAcknowledgeAction(Consumer<AcknowledgeStatus<K>> ackAction); Conveyor<K, L, OUT> getWorkingConveyor(); AcknowledgeBuildingConveyor<K> getAcknowledgeBuildingConveyor(); PersistenceCleanupBatchConveyor<K> getCleaningConveyor(); @Override void autoAcknowledgeOnStatus(Status first, Status... other); @Override ResultConsumer<K, OUT> getResultConsumer(); void unloadOnBuilderTimeout(boolean unload); @Override void interrupt(String conveyorName); @Override void setCartPayloadAccessor(Function<Cart<K, ?, L>, Object> payloadFunction); CompletableFuture<Boolean> compact(K key); CompletableFuture<Boolean> compact(); CompletableFuture<Boolean> compact(SerializablePredicate<K> p); @Override void suspend(); @Override void resume(); @Override boolean isSuspended(); @Override Class<?> mBeanInterface();  }