@Test public void testAccessByName() { KBalancedParallelConveyor<String, String, User> ac1 = new KBalancedParallelConveyor<>(ScalarConvertingConveyor::new,4); ac1.setName("test_name"); Conveyor<String,String,User> ac2 = Conveyor.byName("test_name"); assertTrue(ac1==ac2); }
public void setName(String name) { this.name = name; this.setMbean(name); int i = 0; for(Conveyor<K,L,OUT> conv: conveyors) { conv.setName(name+" ["+i+"]"); i++; } }
ParallelConveyor implements Conveyor<K, L, OUT> { public void setName(String name) { this.name = name; this.setMbean(name); int i = 0; for(Conveyor<K,L,OUT> conv: conveyors) { conv.setName(name+" ["+i+"]"); i++; } } }
ParallelConveyor implements Conveyor<K, L, OUT> { public void setName(String name) { this.name = name; this.setMbean(name); int i = 0; for(Conveyor<K,L,OUT> conv: conveyors) { conv.setName(name+" ["+i+"]"); i++; } } protected  ParallelConveyor(); }
ParallelConveyor implements Conveyor<K, L, OUT> { public void setName(String name) { this.name = name; this.setMbean(name); int i = 0; for(Conveyor<K,L,OUT> conv: conveyors) { conv.setName(name+" ["+i+"]"); i++; } } protected  ParallelConveyor(); @Override PartLoader<K, L> part(); @Override StaticPartLoader<L> staticPart(); @Override BuilderLoader<K, OUT> build(); @Override FutureLoader<K, OUT> future(); @Override abstract CompletableFuture<Boolean> command(GeneralCommand<K, V> cart); @Override CommandLoader<K, OUT> command(); @Override abstract CompletableFuture<Boolean> place(Cart<K,V,L> cart); int getNumberOfConveyors(); int getCollectorSize(int idx); int getInputQueueSize(int idx); int getDelayedQueueSize(int idx); void stop(); @Override CompletableFuture<Boolean> completeAndStop(); long getExpirationCollectionIdleInterval(); TimeUnit getExpirationCollectionIdleTimeUnit(); void setIdleHeartBeat(long expirationCollectionInterval, TimeUnit unit); long getDefaultBuilderTimeout(); void setDefaultBuilderTimeout(long builderTimeout, TimeUnit unit); @Override void setDefaultBuilderTimeout(Duration duration); void rejectUnexpireableCartsOlderThan(long timeout, TimeUnit unit); boolean isOnTimeoutAction(); void setOnTimeoutAction(Consumer<Supplier<? extends OUT>> timeoutAction); void setDefaultCartConsumer(LabeledValueConsumer<L, ?, B> cartConsumer); void setReadinessEvaluator(BiPredicate<State<K,L>, Supplier<? extends OUT>> ready); void setReadinessEvaluator(Predicate<Supplier<? extends OUT>> readiness); void setBuilderSupplier(BuilderSupplier<OUT> builderSupplier); void setName(String name); boolean isRunning(); boolean isRunning(int idx); void addCartBeforePlacementValidator(Consumer<Cart<K, ?, L>> cartBeforePlacementValidator); @Override void addBeforeKeyEvictionAction(Consumer<AcknowledgeStatus<K>> keyBeforeEviction); void addBeforeKeyReschedulingAction(BiConsumer<K,Long> keyBeforeRescheduling); long getExpirationTime(K key); @Override int getCollectorSize(); @Override int getInputQueueSize(); @Override int getDelayedQueueSize(); void setBalancingCommandAlgorithm(Function<GeneralCommand<K, ?>, List<? extends Conveyor<K, L, OUT>>> balancingCommand); void setBalancingCartAlgorithm(Function<Cart<K, ?, L>, List<? extends Conveyor<K, L, OUT>>> balancingCart); @Override boolean isLBalanced(); @Override Set<L> getAcceptedLabels(); @Override void acceptLabels(L... labels); @Override String getName(); @Override String toString(); @Override void enablePostponeExpiration(boolean flag); @Override void enablePostponeExpirationOnTimeout(boolean flag); @Override void setExpirationPostponeTime(long time, TimeUnit unit); @Override boolean isForwardingResults(); @Override long getCartCounter(); long getCartCounter(int idx); @Override void setIdleHeartBeat(Duration duration); @Override void rejectUnexpireableCartsOlderThan(Duration duration); @Override void setExpirationPostponeTime(Duration duration); @Override ResultConsumerLoader<K, OUT> resultConsumer(); @Override ResultConsumerLoader<K, OUT> resultConsumer(ResultConsumer<K,OUT> consumer); ScrapConsumerLoader<K> scrapConsumer(); @Override ScrapConsumerLoader<K> scrapConsumer(ScrapConsumer<K,?> scrapConsumer); @Override void setAutoAcknowledge(boolean auto); @Override void autoAcknowledgeOnStatus(Status first, Status... other); @Override ResultConsumer<K, OUT> getResultConsumer(); @Override void interrupt(final String conveyorName); @Override void setCartPayloadAccessor(Function<Cart<K, ?, L>, Object> payloadFunction); @Override void suspend(); @Override void resume(); @Override boolean isSuspended(); @Override Class<?> mBeanInterface(); }
ParallelConveyor implements Conveyor<K, L, OUT> { public void setName(String name) { this.name = name; this.setMbean(name); int i = 0; for(Conveyor<K,L,OUT> conv: conveyors) { conv.setName(name+" ["+i+"]"); i++; } } protected  ParallelConveyor(); @Override PartLoader<K, L> part(); @Override StaticPartLoader<L> staticPart(); @Override BuilderLoader<K, OUT> build(); @Override FutureLoader<K, OUT> future(); @Override abstract CompletableFuture<Boolean> command(GeneralCommand<K, V> cart); @Override CommandLoader<K, OUT> command(); @Override abstract CompletableFuture<Boolean> place(Cart<K,V,L> cart); int getNumberOfConveyors(); int getCollectorSize(int idx); int getInputQueueSize(int idx); int getDelayedQueueSize(int idx); void stop(); @Override CompletableFuture<Boolean> completeAndStop(); long getExpirationCollectionIdleInterval(); TimeUnit getExpirationCollectionIdleTimeUnit(); void setIdleHeartBeat(long expirationCollectionInterval, TimeUnit unit); long getDefaultBuilderTimeout(); void setDefaultBuilderTimeout(long builderTimeout, TimeUnit unit); @Override void setDefaultBuilderTimeout(Duration duration); void rejectUnexpireableCartsOlderThan(long timeout, TimeUnit unit); boolean isOnTimeoutAction(); void setOnTimeoutAction(Consumer<Supplier<? extends OUT>> timeoutAction); void setDefaultCartConsumer(LabeledValueConsumer<L, ?, B> cartConsumer); void setReadinessEvaluator(BiPredicate<State<K,L>, Supplier<? extends OUT>> ready); void setReadinessEvaluator(Predicate<Supplier<? extends OUT>> readiness); void setBuilderSupplier(BuilderSupplier<OUT> builderSupplier); void setName(String name); boolean isRunning(); boolean isRunning(int idx); void addCartBeforePlacementValidator(Consumer<Cart<K, ?, L>> cartBeforePlacementValidator); @Override void addBeforeKeyEvictionAction(Consumer<AcknowledgeStatus<K>> keyBeforeEviction); void addBeforeKeyReschedulingAction(BiConsumer<K,Long> keyBeforeRescheduling); long getExpirationTime(K key); @Override int getCollectorSize(); @Override int getInputQueueSize(); @Override int getDelayedQueueSize(); void setBalancingCommandAlgorithm(Function<GeneralCommand<K, ?>, List<? extends Conveyor<K, L, OUT>>> balancingCommand); void setBalancingCartAlgorithm(Function<Cart<K, ?, L>, List<? extends Conveyor<K, L, OUT>>> balancingCart); @Override boolean isLBalanced(); @Override Set<L> getAcceptedLabels(); @Override void acceptLabels(L... labels); @Override String getName(); @Override String toString(); @Override void enablePostponeExpiration(boolean flag); @Override void enablePostponeExpirationOnTimeout(boolean flag); @Override void setExpirationPostponeTime(long time, TimeUnit unit); @Override boolean isForwardingResults(); @Override long getCartCounter(); long getCartCounter(int idx); @Override void setIdleHeartBeat(Duration duration); @Override void rejectUnexpireableCartsOlderThan(Duration duration); @Override void setExpirationPostponeTime(Duration duration); @Override ResultConsumerLoader<K, OUT> resultConsumer(); @Override ResultConsumerLoader<K, OUT> resultConsumer(ResultConsumer<K,OUT> consumer); ScrapConsumerLoader<K> scrapConsumer(); @Override ScrapConsumerLoader<K> scrapConsumer(ScrapConsumer<K,?> scrapConsumer); @Override void setAutoAcknowledge(boolean auto); @Override void autoAcknowledgeOnStatus(Status first, Status... other); @Override ResultConsumer<K, OUT> getResultConsumer(); @Override void interrupt(final String conveyorName); @Override void setCartPayloadAccessor(Function<Cart<K, ?, L>, Object> payloadFunction); @Override void suspend(); @Override void resume(); @Override boolean isSuspended(); @Override Class<?> mBeanInterface();  }