Package org.jtrim.concurrent

Examples of org.jtrim.concurrent.GenericUpdateTaskExecutor


    private final PropertySource<Boolean> valid;

    private final MostSevereValidator validator;

    public BackgroundValidator() {
        this.validationExecutor = new GenericUpdateTaskExecutor(VALIDATOR_PROCESSOR);
        this.validator = new MostSevereValidator();

        this.currentProblem = lazilySetProperty(memProperty((Problem)null, true), Equality.<Problem>referenceEquality());
        this.currentProblemForSwing = SwingProperties.toSwingSource(currentProblem, new EventDispatcher<ChangeListener, Void>() {
            @Override
View Full Code Here


        ExceptionHelper.checkNotNullArgument(validator, "validator");
        ExceptionHelper.checkNotNullArgument(input, "input");
        ExceptionHelper.checkNotNullArgument(inputReaderExecutor, "inputReaderExecutor");

        final UpdateTaskExecutor updateReader = new GenericUpdateTaskExecutor(inputReaderExecutor);

        final AtomicReference<InputType> valueRef = new AtomicReference<>(input.getValue());
        final Runnable updateValueTask = new Runnable() {
            @Override
            public void run() {
                valueRef.set(input.getValue());
                performValidation();
            }
        };

        ListenerRef ref1 = input.addChangeListener(new Runnable() {
            @Override
            public void run() {
                updateReader.execute(updateValueTask);
            }
        });
        ListenerRef ref2 = this.validator.addValidator(new Validator<Void>() {
            @Override
            public Problem validateInput(Void inputType) {
View Full Code Here

TOP

Related Classes of org.jtrim.concurrent.GenericUpdateTaskExecutor

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.