Examples of CancelableTask


Examples of org.jtrim.concurrent.CancelableTask

            final AtomicBoolean saveQueued,
            final ProjectProperties properties,
            final PropertiesPersister persister) {

        if (saveQueued.compareAndSet(false, true)) {
            PropertiesPersister.PERSISTER_PROCESSOR.execute(Cancellation.UNCANCELABLE_TOKEN, new CancelableTask() {
                @Override
                public void execute(CancellationToken cancelToken) {
                    saveQueued.set(false);
                    persister.save(project, properties, null);
                }
View Full Code Here

Examples of org.jtrim.concurrent.CancelableTask

            final NbGradleProject project,
            File propertiesFile) {

        final CachedProperties result = new CachedProperties(new MemProjectProperties());
        final PropertiesPersister persister = new XmlPropertiesPersister(propertiesFile);
        PropertiesPersister.PERSISTER_PROCESSOR.execute(Cancellation.UNCANCELABLE_TOKEN, new CancelableTask() {
                @Override
                public void execute(CancellationToken cancelToken) {
                persister.load(result, false, new Runnable() {
                    @Override
                    public void run() {
View Full Code Here

Examples of org.jtrim.concurrent.CancelableTask

    }

    private void fetchProfilesAndSelect() {
        final AtomicReference<PanelLockRef> lockRef = new AtomicReference<>(lockPanel());

        NbGradleProject.PROJECT_PROCESSOR.execute(Cancellation.UNCANCELABLE_TOKEN, new CancelableTask() {
            @Override
            public void execute(CancellationToken cancelToken) {
                final Collection<NbGradleConfiguration> profiles = project
                        .getLookup()
                        .lookup(NbGradleSingleProjectConfigProvider.class)
View Full Code Here

Examples of org.jtrim.concurrent.CancelableTask

                taskDef.getJvmArguments(),
                progress);
    }

    private static void scheduleCancel(final DefaultCancellationTokenSource cancelSource) {
        CANCEL_EXECUTOR.execute(Cancellation.UNCANCELABLE_TOKEN, new CancelableTask() {
            @Override
            public void execute(CancellationToken cancelToken) throws Exception {
                cancelSource.cancel();
            }
        }, null);
View Full Code Here

Examples of org.jtrim.concurrent.CancelableTask

        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                final PropertiesSnapshot snapshot = new PropertiesSnapshot(properties);
                NbGradleProject.PROJECT_PROCESSOR.execute(Cancellation.UNCANCELABLE_TOKEN, new CancelableTask() {
                    @Override
                    public void execute(CancellationToken cancelToken) {
                        XmlPropertyFormat.saveToXml(project, propertiesFile, snapshot);
                    }
                }, new CleanupTask() {
View Full Code Here

Examples of org.jtrim.concurrent.CancelableTask

        final Executor setterExecutor = usedConcurrently
                ? SwingExecutor.INSTANCE
                : RecursiveExecutor.INSTANCE;

        NbGradleProject.PROJECT_PROCESSOR.execute(Cancellation.UNCANCELABLE_TOKEN, new CancelableTask() {
            @Override
            public void execute(CancellationToken cancelToken) {
                final PropertiesSnapshot snapshot = XmlPropertyFormat.readFromXml(propertiesFile);

                setterExecutor.execute(new Runnable() {
View Full Code Here

Examples of org.jtrim.concurrent.CancelableTask

        licenseTemplateSrc.copy(licenseRoot, file.getPath(), "");
    }

    private void doUnregister(final File file) {
        SYNC_EXECUTOR.execute(Cancellation.UNCANCELABLE_TOKEN, new CancelableTask() {
            @Override
            public void execute(CancellationToken cancelToken) throws IOException {
                AtomicInteger fileCount = useCount.get(file);
                if (fileCount == null) {
                    LOGGER.log(Level.WARNING, "Too many unregister call to LicenseManager.", new Exception());
View Full Code Here

Examples of org.jtrim.concurrent.CancelableTask

            }
        }, null);
    }

    private void doRegister(final File file, final NbGradleProject project, final LicenseHeaderInfo header) {
        SYNC_EXECUTOR.execute(Cancellation.UNCANCELABLE_TOKEN, new CancelableTask() {
            @Override
            public void execute(CancellationToken cancelToken) throws IOException {
                AtomicInteger fileCount = useCount.get(file);
                if (fileCount == null) {
                    fileCount = new AtomicInteger(1);
View Full Code Here

Examples of org.jtrim.concurrent.CancelableTask

        }
    }

    @Override
    public void onModelChange() {
        NbGradleProject.PROJECT_PROCESSOR.execute(Cancellation.UNCANCELABLE_TOKEN, new CancelableTask() {
            @Override
            public void execute(CancellationToken cancelToken) {
                loadPathResources(javaExt.getCurrentModel());
            }
        }, null);
View Full Code Here

Examples of org.jtrim.concurrent.CancelableTask

        assert initLock.isHeldByCurrentThread();

        ChangeListener changeListener = new ChangeListener() {
            @Override
            public void stateChanged(ChangeEvent e) {
                NbGradleProject.PROJECT_PROCESSOR.execute(Cancellation.UNCANCELABLE_TOKEN, new CancelableTask() {
                    @Override
                    public void execute(CancellationToken cancelToken) {
                        updateClassPathResources();
                        SwingUtilities.invokeLater(new Runnable() {
                            @Override
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.