blob: 487a045f1c8e0261a7eee9ab591c4b214ea9aca4 [file] [log] [blame]
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
= DevFaqThreadingBuiltIn
:jbake-type: wiki
:jbake-tags: wiki, devfaq, needsreview
:jbake-status: published
:keywords: Apache NetBeans wiki DevFaqThreadingBuiltIn
:description: Apache NetBeans wiki DevFaqThreadingBuiltIn
:toc: left
:toc-title:
:syntax: true
=== What APIs come with built-in background thread handling
A few APIs come with built in multi-threading - if you want your code to run on a background thread, you don't have to do any special set up to do that.
Specifically they are
* The Actions API - if you override `asynchronous` to return true (or don't override it - for historical reasons this is the default), your action's `performAction` method will run in the background
* The Nodes API - to compute node children that are expensive to create, use `link:http://wiki.netbeans.org/DevFaqNodesChildFactory[ChildFactory]` and specify `true` as the boolean argument to `link:http://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/Children.html#create(org.openide.nodes.ChildFactory,%20boolean)[Children.create()]`
* Various parsing APIs - for syntax highlighting languages and so forth - usually you just provide a task to do, and it will automatically call you in the background when a reparse is being done
* QuickSearch API - searchers are typically called in background thread by infrastructure in link:http://bits.netbeans.org/dev/javadoc/org-netbeans-spi-quicksearch/org/netbeans/spi/quicksearch/SearchProvider.html#evaluate%28org.netbeans.spi.quicksearch.SearchRequest,%20org.netbeans.spi.quicksearch.SearchResponse%29[SearchProvider.evaluate(...)]
=== Apache Migration Information
The content in this page was kindly donated by Oracle Corp. to the
Apache Software Foundation.
This page was exported from link:http://wiki.netbeans.org/DevFaqThreadingBuiltIn[http://wiki.netbeans.org/DevFaqThreadingBuiltIn] ,
that was last modified by NetBeans user Dsimonek
on 2009-12-03T15:38:48Z.
*NOTE:* This document was automatically converted to the AsciiDoc format on 2018-02-07, and needs to be reviewed.