<!-- <questionid="arch-what"> Whatisthisprojectgoodfor? <hint> Pleaseprovideherefewlinesdescribingthetheproject, whatproblemitshouldsolve,providelinkstodocumentation, specifications,etc. </hint> </question>
-->
<answer id="arch-what">
The Modules API lies at the core of NetBeans and describes how plug-in
modules are added and managed.
<api name="ModulesAPI" group="java"type="export" category="official"url="@TOP@/org/openide/modules/doc-files/api.html"/>
</answer>
Gory technical details are explained on <a href="@TOP@/org/openide/modules/doc-files/api.html">
API overview page
</a>. Other interesting topic(s) follow:
<usecase id="classpath" name="How a classpath of my module is constructed?" >
The NetBeans is defacto a container that manages individual module's
lifecycle and other runtime aspects. One of the important things is
that it creates a runtime classpath for provided modules based on
dependencies they specify in their manifests. The
<a href="@TOP@/org/openide/modules/doc-files/classpath.html">
overview of the runtime infrastructure</a> is a good starting place for
everyone who wishes to learn more about the NetBeans runtime container
behaviour.
</usecase>
<usecase id="patchfor" name="Runtime compatibility patches">
<p>
To maintain binary compatibility, method implementations may be injected
at runtime, in a form of a superclass in the class' inheritance hierarchy.
Modules compiled against older version of APIs which contains MethodReferences to
methods removed from the oficial APIs will be then linked according to JVM Resolution
algorithm to a matching method present in the superclass of the referenced type.
</p>
<p>
Annotations are used to instruct the ClassLoader to make transformations to the API
classes. <a href="@TOP@/org/openide/modules/PatchFor.html">PatchFor</a> causes the annotated
class to be injected as a superclass of the API class identified by the annotation's value.
<a href="@TOP@/org/openide/modules/ConstructorDelegate.html">ConstructorDelegate</a> marks
a method, which is called as constructor implementation in the case that it is necessary
to preserve a constructor for binary compatibility.
</p>
</usecase>
</answer>
<!-- <questionid="compat-standards"> Doesthemoduleimplementsordefinesanystandards?Isthe implementationexactoritdeviatessomehow? </question>
-->
<answer id="compat-standards">
It defines and implements the Modules API. No intentional deviations.
</answer>
<!-- <questionid="compat-version"> Doesyourmoduleproperlycoexistswithearlierandfuture versions?Canyoucorrectlyreadsettings?Willfuture versionsbeabletoreadsettings? <hint> Veryhelpfulforreadingsettingsistostoreversionnumber there,sofutureversionscandecidewhetherhowtoread/convert thesettingsandolderversionscanignorethenewones. </hint> </question>
-->
<answer id="compat-version">
Backward compatibility of setting storage for the list of configured modules
is considered a design priority. The implementation of the Modules API uses
an XML format to store this list; it has an associated versioned DTD, and the 1.0 format additionally supports expansion through arbitrary named parameters.
Also, the modules themselves can be considered settings in that a user directory
may contain them, so backward compatibility of the directory layout is maintained.
</answer>
<!-- <questionid="deploy-jar"> DoyoudeployjustmoduleJARfile(s)orsomeotherfiles? <hint> IfyourmoduleconsistjustfromonemoduleJARfile,justconfirmthat. IfitusesmorethanoneJAR,describewheretherearelocated,how theyrefertoeachother. IfitconsistofmoduleJAR(s)andotherfiles,pleasedescribe whatistheirpurpose,whyotherfilesarenecessary.Please makesurethatinstallation/deinstallationleavesthesystem instateasitwasbeforeinstallation. </hint> </question>
-->
<answer id="deploy-jar">
The API portion is inside <samp>openide.jar</samp>;
the implementation refers to this and is inside <samp>core.jar</samp>.
</answer>
<!-- <questionid="deploy-nbm"> CanyoudeployNBMviaAutoUpdatecenter? <hint> Ifnotwhy? </hint> </question>
-->
<answer id="deploy-nbm">
Yes (as part of <samp>openide.nbm</samp> and <samp>core.nbm</samp>).
</answer>
<!-- <questionid="deploy-packages"> Arepackagesofyourmodulemadeinaccessiblebynotdeclaringthem public? <hint> NetBeansmodulesystemallowsrestrictionofaccessrightsto publicclassesofyourmodulefromothermodules.Thisprevents unwanteddependenciesofothersonyourcodeandshouldbeused wheneverpossible(<ahref="http://www.netbeans.org/download/apis/org/openide/doc-files/upgrade.html#3.4-public-packages"> publicpackages </a>). </hint> </question>
-->
<answer id="deploy-packages">
<p>
The entire API is one public package.
<api name="ModulesAPI" group="java"type="export" category="official" />
</p>
<p>
The implementation is in another package and is not considered public, though it is made available to <code>autoupdate</code> and
<code>apisupport</code> as these special modules deal directly with
the module system at a deeper level than the API provides for.
<api name="CoreModulesAPI" group="java"type="export" category="friend"/>
</p>
</answer>
<!-- <questionid="deploy-shared"> Doyouneedtobeinstalledinsharedlocationoronlyinuserdirectory? <hint> Installationlocationshallnotmatter,ifitdoesexplainwhy. </hint> </question>
-->
<answer id="deploy-shared">
Must be installed in the shared location as it is part of the very core of NetBeans.
</answer>
<!-- <questionid="exec-classloader"> Doesyourcodeusesownclassloader? <hint> Abitunusual.Pleaseexplainwhyandwhatfor. </hint> </question>
-->
<answer id="exec-classloader">
The implementation creates one class loader for each enabled module,
plus a special "system" class loader.
</answer>
<!-- <questionid="exec-property"> Isexecutionofyourcodeinfluencedbyanyenvironmentof system(<code>System.getProperty</code>)property? <hint> Ifthereisapropertythatcanchangethebehaviourofyour code,somebodywilllikelyuseit.Youshoulddescribewhatitdoes andthestabilitycategoryofthisAPI.Youmayuse <PRE> <propertyname="id"category="private"> descriptionoftheproperty,whereitisused,whatitinfluence,etc. </property> </PRE> </hint> </question>
-->
<answer id="exec-property">
<api type="import" group="systemproperty" name="netbeans.home" category="private">
NetBeans installation directory.
</api>
<api type="import" group="systemproperty" name="netbeans.user" category="private">
User directory.
</api>
<api type="import" group="systemproperty" name="netbeans.dirs" category="private">
Additional installation component directories.
</api>
<api type="export" group="systemproperty" name="netbeans.systemclassloader.patches" category="friend">
Classpath appended to the system class loader.
Used for automated testing infrastructure.
</api>
<api type="import" group="systemproperty" name="netbeans.classpath" category="friend">
May be used to prepend items to the same class loader as is used
for <samp>openide.jar</samp> and <samp>core.jar</samp>, similarly
to JARs found in <samp>lib/patches/</samp>.
</api>
<api type="export" group="systemproperty" name="netbeans.cache.manifests" category="private">
By default true, may be turned off to disable manifest caching.
</api>
<api type="export" group="systemproperty" name="netbeans.patches.MODULE.CODE.NAME.BASE" category="friend">
Patch directories or JARs to add to the class loader for a module,
besides <samp>patches/MODULE-CODE-NAME-BASE/*.jar</samp>.
</api>
<api type="export" group="systemproperty" name="netbeans.preresolve.classes" category="private">
If true, all module classes are forcibly loaded at startup, to help
detect possible linkage errors.
</api>
<api type="export" group="systemproperty" name="org.netbeans.core.modules.NbInstaller.noAutoDeps" category="private">
Disables automatic module dependency upgrades.
</api>
<api type="export" group="systemproperty" name="org.netbeans.core.modules" category="private">
If set to <samp>0</samp>, enables logging for the module system.
</api>
<api type="export" group="systemproperty" name="org.netbeans.core.modules.NbInstaller.NO_COMPAT_AUTO_TRANSITIVE_DEPS" category="private">
Disabled automatic transitive class loader dependencies for old modules.
</api>
<api type="export" group="systemproperty" name="netbeans.modules.quiet" category="private">
Avoids text messaging (other than <code>ErrorManager</code> logging) to the console
from the module system.
</api>
<api type="export" group="systemproperty" name="netbeans.moduleitem.dontverifyclassloader" category="private">
Suppresses checks to ensure that module section classes are actually loaded
from the module itself.
</api>
<api type="import" group="systemproperty" name="netbeans.full.hack" category="friend"url="https://netbeans.apache.org/wiki/DevFaqNetBeansFullHack">
Avoids using GUI when user-visible error conditions occur.
</api>
<api type="import" group="systemproperty" name="netbeans.mainclass" category="friend">
Name of class from <samp>core.jar</samp> which will handle most of the
startup sequence; by default, <samp>org.netbeans.core.Main</samp>.
</api> <!-- XXX this is really in "launcher", not module system -->
<api type="export" group="systemproperty" name="netbeans.security.nocheck" category="friend">
Suppress security checks in the VM, even from "untrusted" code.
</api>
<api type="export" group="systemproperty" name="netbeans.classloader.verbose" category="private">
Prints messages when resources or classes are loaded from JARs.
</api>
<api group="systemproperty" name="netbeans.cache.layers"type="export" category="private">
<p>
Used to control the XML layer cache mechanism. Value may be a
fully-qualified class name to load as a manager (implement
<code>org.netbeans.core.projects.cache.LayerCacheManager</code>),
or <code>-</code> to disable caching and always parse the XML
layers directly. Current default is to use a binary cache
manager.
</p>
</api>
</answer>
<!-- <questionid="exec-reflection"> Doesyourcodeusesjava.lang.reflecttoexecutesomeothercode? <hint> ThisusuallyindicatesamissingorunsufficientAPIintheother partofthesystem.Iftheothersideisnotawareofyourdependency thiscontractcanbeeasilybroken. </hint> </question>
-->
<answer id="exec-reflection">
Of course components present in modules are initially loaded using
reflection. Otherwise there is little semantic use of it (transparent
optimizations only). One exception: pending a solution to <a href="https://bz.apache.org/netbeans/show_bug.cgi?id=29382">#29382</a>,
one portion of the Filesystems API is accessed via reflection when
merging XML layers from modules.
</answer>
<!-- <questionid="format-types"> Whichfileformatsyourcodereadsorwritesondisk? </question>
-->
<answer id="format-types">
<ul>
<li>Module JAR files, as specified by the Modules API</li>
<li><api group="dtd" category="devel"type="export" name="module-status-1_0.dtd"url="http://www.netbeans.org/dtds/module-status-1_0.dtd"><samp>-//NetBeans//DTD Module Status 1.0//EN</samp></api></li>
<li><api group="dtd" category="devel"type="export" name="module-auto-deps-1_0.dtd"url="http://www.netbeans.org/dtds/module-auto-deps-1_0.dtd"><samp>-//NetBeans//DTD Module Automatic Dependencies 1.0//EN</samp></api></li>
<li><api group="dtd" category="stable"type="export" name="filesystem-1_1.dtd"url="http://www.netbeans.org/dtds/filesystem-1_1.dtd"><samp>-//NetBeans//DTD Filesystem 1.1//EN</samp></api></li>
<li>a custom binary format for caching merged layer contents</li>
<li>a custom binary format for caching module manifests</li>
<li>a custom binary (serialized) format for caching folder lookup</li>
<li>Java serialization for externalized <code>ModuleInstall</code>s (deprecated)</li>
</ul>
</answer>
<!-- <questionid="lookup-lookup"> Doesyourmoduleuses<code>org.openide.util.Lookup</code> tofindanycomponentstocommunicateto?Whichones? <hint> Pleasedescribetheinterfacesyouaresearchingfor,where aredefined,whetheryouaresearchingforjustoneormoreofthem, iftheorderisimportant,etc.Alsoclasifythestabilityofsuch APIcontract. </hint> </question>
-->
<answer id="lookup-lookup">
All registered <code>InstalledFileLocator</code>
instances are queried and used
to implement <code>InstalledFileLocator.getDefault()</code>.
</answer>
<!-- <questionid="lookup-register"> Doyouregisteranythingintothelookupforothertofind? <hint> Doyouregisterusinglayerfileorusing<code>META-INF/services</code>? Whoissupposedtofindyourcomponent? </hint> </question>
-->
<answer id="lookup-register">
<ul>
<li><code>TestModuleDeployer</code> (from META-INF), used by apisupport</li>
<li><code>InstalledFileLocator</code> (from META-INF), used by its public default method</li>
<li>an instance of every known <code>ModuleInfo</code>, via a custom lookup insertion (specified in API)</li>
<li>an instance of <code>ClassLoader</code>, via a custom lookup insertion (used broadly)</li>
</ul>
</answer>
<!-- <questionid="perf-mem"> Whatistheamountofmemoryyourcomponentoccupies?Estimate witharelactiontothenumberofwindows,etc. </question>
-->
<answer id="perf-mem">
Not a lot. On modules which are well-formed (layers, JAR entries,
complex interdependencies) but which do not run any code there is a modest
incremental cost: 3.1msec and 4.5Kb per module at least measurement.
</answer>
<!-- <questionid="perf-progress"> Doesyourmoduleexecutessomelongrunningtask? <hint>Typicallytheyaretaskslikeconnectingover network,computinghugeamountofdata,compilation. Suchcommunicationshouldbedoneasynchronously(forexample using<code>RequestProcessor</code>),definitivelyitshould notblockAWTthread. </hint> </question>
-->
<answer id="perf-progress">
Bulk module installation can be time-consuming. <code>org.netbeans.core.ui.ModuleBean</code>
is a Swing-safe bean that serves as a nonblocking wrapper for all module system
modifications and is used e.g. in the <b>Modules</b> node.
</answer>
<!-- <questionid="perf-scale"> Whichexternalcriteriainfluencetheperformanceofyour program(sizeoffileineditor,numberoffilesinmenu, insourcedirectory,etc.)andhowwellyourcodescales? Pleaseincludesomeestimates. </question>
-->
<answer id="perf-scale">
Scalability of the standalone system seems reasonably good; even with
a thousand modules (an order of magnitude higher than current reality)
startup time and memory consumption in the module system itself are
not large (7 seconds, 6 Mb).
</answer>
<!-- <questionid="perf-startup"> Doesyourmoduleexecutesanythingonstartup? </question>
-->
<answer id="perf-startup">
Yes, of course - it finds and loads all modules.
</answer>
<!-- <questionid="resources-file"> Doesyourmoduleuse<code>java.io.File</code>directly? <hint> NetBeansprovidealogicalwrapperoverplainfilescalled <code>org.openide.filesystems.FileObject</code>that providesuniformaccesstosuchresourcesandistheprefered waythatshouldbeused.Butofcoursetherecanbesituationswhen thisisnotsuitable. </hint> </question>
-->
<answer id="resources-file">
<p>
Yes, module JARs and associated resource JARs must be real files.
They are loaded as defined by module enablement XML files.
</p>
<p>
Module enablement XML files are loaded via Filesystems. The public
API (partially) specifies them only in these terms.
<code>autoupdate</code> uses Filesystems to manipulate them when
necessary, though it relies on some additional
implementation-specific knowledge of their format (which is fairly
stable, especially since changes are limited by compatibility
constraints on old user directories). The NetBeans build scripts use
some additional implementation knowledge to pregenerate suitable XML
files for modules included in the application distribution.
</p>
</answer>
<!-- <questionid="resources-layer"> Doesyourmoduleprovideownlayer?Doesitcreatesomefilesor foldersonit?Whatitistryingtocommunicatebythatandwithwhich component? <hint> NetBeansallowsautomaticanddeclarativeinstallationofresources bymodulelayers.Moduleregisterfilesintoappropriateplaces andothercomponentsusethatinformationtoperformtheirtask (buildmenu,toolbar,windowlayout,listoftemplates,setof options,etc.). </hint> </question>
-->
<answer id="resources-layer">
The Modules API defines some layer folders:
<ul>
<li><samp>Modules/*.xml</samp> (read from and written to)</li>
<li><samp>ModuleAutoDeps/*.xml</samp> (only read from)</li>
</ul>
</answer>
<!-- <questionid="resources-read"> Doesyourmodulereadanyresourcesfromlayers?Forwhatpurpose? <hint> Asthisissomekindofintermoduledependency,itisakindofAPI. Pleasedescribeitandclasifyaccordingto <ahref="http://openide.netbeans.org/tutorial/api-design.html#categories"> commonstabilitycategories</a>. </hint> </question>
-->
<answer id="resources-read"> XML files are read from the two folders defined by the API.
Note however that since these folders control the module system itself,
contents generally should not be placed in module layers, but in the
<samp>system/</samp> subfolder of the installation or user directory
(generally, in the NBM).
</answer>
</api-answers>
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.16 Sekunden
(vorverarbeitet am 2026-06-11)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.