1
<?xml version="1.0" encoding="UTF-8"?>
3
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
5
Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
8
The contents of this file are subject to the terms of either the GNU
9
General Public License Version 2 only ("GPL") or the Common
10
Development and Distribution License("CDDL") (collectively, the
11
"License"). You may not use this file except in compliance with the
12
License. You can obtain a copy of the License at
13
http://www.netbeans.org/cddl-gplv2.html
14
or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
15
specific language governing permissions and limitations under the
16
License. When distributing the software, include this License Header
17
Notice in each file and include the License file at
18
nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
19
particular file as subject to the "Classpath" exception as provided
20
by Sun in the GPL Version 2 section of the License file that
21
accompanied this code. If applicable, add the following below the
22
License Header, with the fields enclosed by brackets [] replaced by
23
your own identifying information:
24
"Portions Copyrighted [year] [name of copyright owner]"
28
The Original Software is NetBeans. The Initial Developer of the Original
29
Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
30
Microsystems, Inc. All Rights Reserved.
32
If you wish your version of this file to be governed by only the CDDL
33
or only the GPL Version 2, indicate your decision by adding
34
"[Contributor] elects to include this software in this distribution
35
under the [CDDL or GPL Version 2] license." If you do not indicate a
36
single choice of license, a recipient has the option to distribute
37
your version of this file under either the CDDL, the GPL Version 2 or
38
to extend the choice of license to its licensees as provided above.
39
However, if you add GPL Version 2 code and therefore, elected the GPL
40
Version 2 license, then the option applies only if the new code is
41
made subject to such option by the copyright holder.
43
<!DOCTYPE api-answers PUBLIC "-//NetBeans//DTD Arch Answers//EN" "../nbbuild/antsrc/org/netbeans/nbbuild/Arch.dtd" [
44
<!ENTITY api-questions SYSTEM "../nbbuild/antsrc/org/netbeans/nbbuild/Arch-api-questions.xml">
48
question-version="1.23"
49
author="jjancura@netbeans.org"
55
<!-- architecture ********************************************************************** -->
58
<!-- Question: arch-what
60
<question id="arch-what">
61
What is this project good for?
63
Please provide here few lines describing the the project,
64
what problem it should solve, provide links to documentation,
69
<answer id="arch-what">
70
The debuggerjpda module supports debugging of Java applications.
72
<api name="JPDADebuggerAPI" type="export" category="official" url="http://debuggercore.netbeans.org/docs/api/index.html" group="java"/>
73
See <a href="http://debugger.netbeans.org/">debugger.netbeans.org</a> and
74
<a href="http://debuggercore.netbeans.org/">debuggercore.netbeans.org</a>
79
<question id="arch-overall" when="init">
80
Describe the overall architecture.
83
<a href="http://openide.netbeans.org/tutorial/api-design.html#design.apiandspi">
84
clients and what support API</a>?
85
What parts will be pluggable?
86
How will plug-ins be registered? Please use <code><api type="export"/></code>
87
to describe your general APIs.
88
If possible please provide
93
<answer id="arch-overall">
94
See <a href="http://debuggercore.netbeans.org/docs/api/ProgrammersGuide.html">Programmers Guide</a>.
98
<question id="arch-usecases" when="init">
99
Describe the main <a href="http://openide.netbeans.org/tutorial/api-design.html#usecase">
100
use cases</a> of the new API. Who will use it at
101
what circumstances and what will be the typical code to write
105
<answer id="arch-usecases">
106
See <a href="http://debuggercore.netbeans.org/docs/api/UseCases.html">Usecases</a>.
110
<question id="arch-time" when="init">
111
What are the time estimates of the work?
113
Please express your estimates of how long the design, implementation,
114
stabilization are likely to last. How many people will be needed to
115
implement this and what is the expected milestone the work should be
120
<answer id="arch-time">
121
See <a href="http://debuggercore.netbeans.org/plans/NB40Plan.html">Integration Plan</a>.
125
<question id="arch-quality" when="init">
126
How the <a href="http://www.netbeans.org/community/guidelines/q-evangelism.html">quality</a>
127
of your code will be tested and
128
how future regressions are going to be prevented?
131
you want to use? What/how much area of functionality
132
should be covered by the tests?
137
<answer id="arch-quality">
138
We plan to use standard unit testing to prevent future regressions.
139
We would like to test 100% of our APIs.
142
<!-- dependencies ********************************************************************** -->
145
<!-- Question: dep-jre
147
<question id="dep-jre">
148
Which version of JRE you need (1.2, 1.3, 1.4, etc.)?
150
It is expected that if your module runs on 1.x that it will run
151
on 1.x+1 if no, state that please. Also describe here cases where
152
you run different code on different versions of JRE and why.
156
<answer id="dep-jre">
157
Needs at least JRE 1.4.
162
<!-- Question: dep-jrejdk
164
<question id="dep-jrejdk">
165
Do you require JDK or is JRE enough?
168
<answer id="dep-jrejdk">
169
Need JDK (dt.jar, tools.jar).
174
<!-- Question: dep-nb
176
<question id="dep-nb">
177
What other NetBeans projects this one depends on?
179
If you want, describe such projects as imported API using
180
the <code><api name="identification" type="import or export" category="stable" url="where is the description" /></code>
185
<api name="OpenAPIs" type="import" category="official" url="http://openide.netbeans.org" group="java"/>
186
<api name="DebuggerCoreAPI" type="import" category="official" url="http://debuggercore.netbeans.org/docs/api/index.html" group="java"/>
187
<api name="JavaHierarchyAPI" type="import" category="official" url="http://www.netbeans.org/download/dev/javadoc/JavaHierarchyAPI/index.html" group="java"/>
188
<api name="JavaAPI" type="import" category="official" url="http://www.netbeans.org/download/dev/javadoc/JavaHierarchyAPI/index.html" group="java"/>
189
<api name="ExecutionAPI" url="http://www.netbeans.org/download/dev/javadoc/ExecutionAPI/org/openide/execution/doc-files/api.html"
190
type="import" category="official" group="java"
192
<api name="OpenAPIs" type="import" category="official" url="http://openide.netbeans.org" group="java"/>
197
<!-- Question: dep-non-nb
199
<question id="dep-non-nb">
200
What other non-NetBeans projects this one depends on?
203
Some non-NetBeans projects are packaged as NetBeans modules
204
(see <a href="http://libs.netbeans.org">libraries</a>) and
205
it is prefered to use this approach when more modules may
206
depend on such third-party library.
210
<answer id="dep-non-nb">
216
<!-- Question: dep-platform
218
<question id="dep-platform">
219
On which platforms your module run? Any? Does it run in the same
222
If your module is using JNI or deals with special differences of
223
OSes like filesystems, etc. please describe here what they are.
227
<answer id="dep-platform">
228
The module is 100% pure Java and runs on any platform.
233
<!-- deploy ********************************************************************** -->
237
<!-- Question: deploy-jar
239
<question id="deploy-jar">
240
Do you deploy just module JAR file(s) or some other files?
242
If your module consist just from one module JAR file, just confirm that.
243
If it uses more than one JAR, describe where there are located, how
244
they refer to each other.
245
If it consist of module JAR(s) and other files, please describe
246
what is their purpose, why other files are necessary. Please
247
make sure that installation/deinstallation leaves the system
248
in state as it was before installation.
252
<answer id="deploy-jar">
258
<!-- Question: deploy-nbm
260
<question id="deploy-nbm">
261
Can you deploy NBM via AutoUpdate center?
267
<answer id="deploy-nbm">
273
<!-- Question: deploy-packages
275
<question id="deploy-packages">
276
Are packages of your module made inaccessible by not declaring them
280
NetBeans module system allows restriction of access rights to
281
public classes of your module from other modules. This prevents
282
unwanted dependencies of others on your code and should be used
283
whenever possible (<a href="http://www.netbeans.org/download/apis/org/openide/doc-files/upgrade.html#3.4-public-packages">
289
<answer id="deploy-packages">
295
<!-- Question: deploy-shared
297
<question id="deploy-shared">
298
Do you need to be installed in shared location or only in user directory?
300
Installation location shall not matter, if it does explain why.
304
<answer id="deploy-shared">
305
Module can be installed anywhere.
309
<answer id="deploy-dependencies">
315
<!-- compatibility ********************************************************************** -->
318
<!-- Question: compat-i18n
320
<question id="compat-i18n">
321
Is your module correctly internationalized?
323
Correct internationalization means that it obeys instuctions
324
at <a href="http://www.netbeans.org/devhome/docs/i18n/index.html">
325
NetBeans I18N pages</a>.
329
<answer id="compat-i18n">
335
<!-- Question: compat-standards
337
<question id="compat-standards">
338
Does the module implements or defines any standards? Is the
339
implementation exact or it deviates somehow?
342
<answer id="compat-standards">
343
None defined or implemented.
348
<!-- Question: compat-version
350
<question id="compat-version">
351
Does your module properly coexists with earlier and future
352
versions? Can you correctly read settings? Will future
353
versions be able to read settings?
356
Very helpful for reading settings is to store version number
357
there, so future versions can decide whether how to read/convert
358
the settings and older versions can ignore the new ones.
362
<answer id="compat-version">
363
Only one version of the module can be installed at a time.
364
The settings are shared across different versions, stored
365
and read by Java serialization and will be read in future as well.
371
<!-- resources ********************************************************************** -->
374
<!-- Question: resources-file
376
<question id="resources-file">
377
Does your module use <code>java.io.File</code> directly?
380
NetBeans provide a logical wrapper over plain files called
381
<code>org.openide.filesystems.FileObject</code> that
382
provides uniform access to such resources and is the prefered
383
way that should be used. But of course there can be situations when
384
this is not suitable.
388
<answer id="resources-file">
394
<!-- Question: resources-layer
396
<question id="resources-layer">
397
Does your module provide own layer? Does it create some files or
398
folders on it? What it is trying to communicate by that and with which
402
NetBeans allows automatic and declarative installation of resources
403
by module layers. Module register files into appropriate places
404
and other components use that information to perform their task
405
(build menu, toolbar, window layout, list of templates, set of
410
<answer id="resources-layer">
411
Yes, files are created for menus, actions, shortcuts, templates, window system layout,
412
settings storage - these are all in standard Open
418
<!-- Question: resources-mask
420
<question id="resources-mask">
421
Does your module mask/hide/override any resource provided by another one in
425
If you mask a file provided by another module, you probably depend
426
on that and do not want the other module to (for example) change
427
the file's name. That module shall thus make that file available as an API
428
of some stability category.
432
<answer id="resources-mask">
438
<!-- Question: resources-read
440
<question id="resources-read">
441
Does your module read any resources from layers? For what purpose?
444
As this is some kind of intermodule dependency, it is a kind of API.
445
Please describe it and clasify according to
446
<a href="http://openide.netbeans.org/tutorial/api-design.html#categories">
447
common stability categories</a>.
451
<answer id="resources-read">
456
<!-- lookup ********************************************************************** -->
459
<!-- Question: lookup-lookup
461
<question id="lookup-lookup">
462
Does your module uses <code>org.openide.util.Lookup</code>
463
to find any components to communicate to? Which ones?
466
Please describe the interfaces you are searching for, where
467
are defined, whether you are searching for just one or more of them,
468
if the order is important, etc. Also clasify the stability of such
473
<answer id="lookup-lookup">
474
No. But we use our own private implementation of lookup pattern.
475
We are searching for instances of various services defined in *.spi.* packages.
476
The contract is described in JavaDoc.
481
<!-- Question: lookup-register
483
<question id="lookup-register">
484
Do you register anything into the lookup for other to find?
486
Do you register using layer file or using <code>META-INF/services</code>?
487
Who is supposed to find your component?
491
<answer id="lookup-register">
492
We use our private namespace <code>META-INF/debugger</code> for registration.
493
The contract is described in JavaDoc.
498
<!-- Question: lookup-remove
500
<question id="lookup-remove">
501
Are removing entries of other modules from the lookup?
503
Why? Of course, that is possible, but it can be dangerous. Is the module
504
your are masking resource from aware of what you are doing?
508
<answer id="lookup-remove">
514
<!-- execution ********************************************************************** -->
517
<!-- Question: exec-property
519
<question id="exec-property">
520
Is execution of your code influenced by any environment of
521
system (<code>System.getProperty</code>) property?
524
If there is a property that can change the behaviour of your
525
code, somebody will likely use it. You should describe what it does
526
and the stability category of this API. You may use
528
<property name="id" category="private" >
529
description of the property, where it is used, what it influence, etc.
535
<answer id="exec-property">
536
<!-- Update also debuggerjpda/api/arch.xml/exec-property when changing this -->
537
<api name="SS_ACTION_STEPOUT" group="property" category="friend" type="export">
538
When set to Boolean.TRUE, this option is causing step out during smart-stepping
539
instead of step into. Thus it much faster skips code that is not selected
540
for debugging, but it may also skip code that should be debugged if it's
541
called from a source that has debugging disabled.
542
This is advantageous when the speed is important (e.g. in J2ME).
543
This property can be set through a map of properties that is passed to
544
JPDADebugger.attach (), like J2ME_DEBUGGER property.
546
<api name="netbeans.debugger.show_hidden_breakpoints" group="property" category="private" type="export">
547
This system property is causing the breakpoints view to show also hidden
550
<api name="org.netbeans.modules.debugger.jpda.breakpoints.level" group="property" category="private" type="export">
551
Logging level for informational messages about breakpoint
552
submission and hits. They use Level.FINE and Level.FINER levels and
553
are printed into the NetBeans message log.
555
<api name="netbeans.debugger.start" group="property" category="private" type="export">
556
When this system property is set, informational messages about start of
557
JPDA debugger are printed into standard output (console).
559
<api name="netbeans.debugger.jditrace" group="property" category="private" type="export">
560
This system property sets the debug mode of the debuggee virtual machine
561
via <code>VirtualMachine.setDebugTraceMode()</code> method. See the javadoc
562
of that method for the description and possible values.
564
<api name="org.netbeans.modules.debugger.jpda.jdievents.level" group="property" category="private" type="export">
565
Logging level for informational messages about received JDI events.
566
They use Level.FINE level and are printed into the NetBeans message log.
568
<api name="netbeans.debugger.smartstepping" group="property" category="private" type="export">
569
When this system property is set, informational messages about the smart
570
stepping process are printed into standard output (console).
572
<api name="netbeans.debugger.noInvokeMethods" group="property" category="private" type="export">
573
When this system property is set, methods invocation in debuggee is disabled.
575
<api name="org.netbeans.modules.debugger.jpda.invokeMethod.level" group="property" category="private" type="export">
576
Logging level for messages about method invocation.
577
They use Level.FINE level and are printed into the NetBeans message log.
579
<api name="org.netbeans.modules.debugger.jpda.getValue.level" group="property" category="private" type="export">
580
Logging level for messages about variables evaluation.
581
They use Level.FINE level and are printed into the NetBeans message log.
583
<api name="netbeans.debugger.viewrefresh" group="property" category="private" type="export">
584
When this system property is set, informational messages about the tasks
585
that refresh debugger views are printed into standard output (console).
586
The value of that property should contain 'w' for watches view, 'l' for
587
local variables view, 'c' for call stack view, 's' for classes view and
588
't' for threads view.
593
<!-- Question: exec-component
595
<question id="exec-component">
596
Is execution of your code influenced by (string) property
597
of any of your components?
600
Often <code>JComponent.getClientProperty</code>, <code>Action.getValue</code>
601
or <code>PropertyDescriptor.getValue</code>, etc. are used to influence
602
a behaviour of some code. This of course forms an interface that should
603
be documented. Also if one depends on some interface that an object
604
implements (<code>component instanceof Runnable</code>) that forms an
609
<answer id="exec-component">
614
<!-- Question: exec-classloader
616
<question id="exec-classloader">
617
Does your code uses own classloader?
619
A bit unusual. Please explain why and what for.
623
<answer id="exec-classloader">
630
<!-- Question: exec-reflection
632
<question id="exec-reflection">
633
Does your code uses java.lang.reflect to execute some other code?
635
This usually indicates a missing or unsufficient API in the other
636
part of the system. If the other side is not aware of your dependency
637
this contract can be easily broken.
641
<answer id="exec-reflection">
642
VirtualMachine.canBeModified(), TypeComponent.genericSignature() and
643
LocalVariable.genericSignature() are called by reflection, because it's
644
available on JDK 1.5 and higher only.
650
<!-- Question: exec-privateaccess
652
<question id="exec-privateaccess">
653
Are you aware of any other part of the system calling some of
654
your methods by reflection?
656
If so, describe the "contract" as an API. Likely private or friend one, but
657
still API and consider rewrite of it.
661
<answer id="exec-privateaccess">
667
<!-- Question: exec-process
668
<question id="exec-process">
669
Do you execute an external process from your module? How do you ensure
670
that the result is the same on different platforms? Do you parse output?
671
Do you depend on result code?
673
If you feed an input, parse the output please declare that as an API.
678
<answer id="exec-process">
682
<!-- Question: exec-introspection
683
<question id="exec-introspection">
684
Does your module use any kind of runtime type information (<code>instanceof</code>,
685
work with <code>java.lang.Class</code>, etc.)?
687
Check for cases when you have an object of type A and you also
688
expect it to (possibly) be of type B and do some special action. That
689
should be documented. The same applies on operations in meta-level
690
(Class.isInstance(...), Class.isAssignableFrom(...), etc.).
695
<answer id="exec-introspection">
696
debuggercore does not use introspection.
697
The cases when an object is tested on various types are quite common, but not documented.
703
<!-- Question: exec-threading
704
<question id="exec-threading" when="impl">
705
What threading models, if any, does your module adhere to?
707
If your module calls foreign APIs which have a specific threading model,
708
indicate how you comply with the requirements for multithreaded access
709
(synchronization, mutexes, etc.) applicable to those APIs.
710
If your module defines any APIs, or has complex internal structures
711
that might be used from multiple threads, declare how you protect
712
data against concurrent access, race conditions, deadlocks, etc.,
713
and whether such rules are enforced by runtime warnings, errors, assertions, etc.
714
Examples: a class might be non-thread-safe (like Java Collections); might
715
be fully thread-safe (internal locking); might require access through a mutex
716
(and may or may not automatically acquire that mutex on behalf of a client method);
717
might be able to run only in the event queue; etc.
718
Also describe when any events are fired: synchronously, asynchronously, etc.
719
Ideas: <a href="http://core.netbeans.org/proposals/threading/index.html#recommendations">Threading Recommendations</a> (in progress)
725
<answer id="exec-threading">
726
We use standard Java features - synchronized blocks - to synchronize our code.
731
<!-- format ********************************************************************** -->
735
<!-- Question: format-clipboard
737
<question id="format-clipboard">
738
Which protocols your code reads/inserts when communicating with
742
<answer id="format-clipboard">
744
<li>custom DataFlavor type referencing own structures (for copy/cut/paste)</li>
745
<li>standard Open API's NodeTransfer.cookie for InstanceCookie (just for pasting):
746
<api name="InstanceCookie-paste" type="export" category="private" group="java"/>
753
<!-- Question: format-dnd
755
<question id="format-dnd">
756
Which protocols your code understands during drag-n-drop?
759
<answer id="format-dnd">
765
<!-- Question: format-types
767
<question id="format-types">
768
Which file formats your code reads or writes on disk?
771
<answer id="format-types">
777
<!-- performance ********************************************************************** -->
781
<!-- Question: perf-startup
783
<question id="perf-startup">
784
Does your module executes anything on startup?
787
<answer id="perf-startup">
792
<!-- Question: perf-exit
794
<question id="perf-exit">
795
Does your module executes anything on exit?
798
<answer id="perf-exit">
804
<!-- Question: perf-scale
806
<question id="perf-scale">
807
Which external criteria influence the performance of your
808
program (size of file in editor, number of files in menu,
809
in source directory, etc.) and how well your code scales?
810
Please include some estimates.
813
<answer id="perf-scale">
818
<!-- Question: perf-limit
820
<question id="perf-limit">
821
Are there any limits in number/size of elements your code
825
<answer id="perf-limit">
826
No explicit limits. Technically, the available memory size is the limit...
831
<!-- Question: perf-mem
833
<question id="perf-mem">
834
What is the amount of memory your component occupies? Estimate
835
with a relaction to the number of windows, etc.
838
<answer id="perf-mem">
841
<li>debuggercore with Debugger Window opened: 2MB</li>
846
<!-- Question: perf-wakeup
848
<question id="perf-wakeup">
849
Is any piece of your code waking up periodically?
852
<answer id="perf-wakeup">
858
<!-- Question: perf-progress
860
<question id="perf-progress">
861
Does your module executes some long running task?
862
<hint>Typically they are tasks like connecting over
863
network, computing huge amount of data, compilation.
864
Such communication should be done asynchronously (for example
865
using <code>RequestProcessor</code>), definitively it should
866
not block AWT thread.
870
<answer id="perf-progress">
875
<!-- Question: perf-huge_dialogs
877
<question id="perf-huge_dialogs">
878
Does your module contain any dialogs or wizards with huge
879
amount of GUI controls like combo boxes, lists, trees, text
883
<answer id="perf-huge_dialogs">
888
<!-- Question: perf-menus
890
<question id="perf-menus">
891
Does your module use dynamically changing context menus or
892
context sensitive actions with complicated logic for enable/disable?
895
<answer id="perf-menus">
896
No. Context menu are rather stable once created. Enabling logic is simple.
900
<!-- Question: perf-spi
901
<question id="perf-spi" when="init">
902
How the performance of the plugged in code will be enforced?
904
If you allow foreign code to be plugged into your own module, how
905
do you enforce, that it will behave correctly and fast and will not
906
negatively influence the performance of your own module?
910
<answer id="perf-spi">
911
We are not able to enforce performance of plugged in code.