Line 0
Link Here
|
|
|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
2 |
<!DOCTYPE api-answers PUBLIC "-//NetBeans//DTD Arch Answers//EN" "../nbbuild/antsrc/org/netbeans/nbbuild/Arch.dtd" [ |
3 |
<!ENTITY api-questions SYSTEM "../nbbuild/antsrc/org/netbeans/nbbuild/Arch-api-questions.xml"> |
4 |
]> |
5 |
|
6 |
<api-answers |
7 |
question-version="1.29" |
8 |
author="akrasny@netbeans.org" |
9 |
> |
10 |
|
11 |
&api-questions; |
12 |
|
13 |
|
14 |
<!-- |
15 |
<question id="arch-overall" when="init"> |
16 |
Describe the overall architecture. |
17 |
<hint> |
18 |
What will be API for |
19 |
<a href="http://wiki.netbeans.org/API_Design#Separate_API_for_clients_from_support_API"> |
20 |
clients and what support API</a>? |
21 |
What parts will be pluggable? |
22 |
How will plug-ins be registered? Please use <code><api type="export"/></code> |
23 |
to describe your general APIs and specify their |
24 |
<a href="http://wiki.netbeans.org/API_Stability#Private"> |
25 |
stability categories</a>. |
26 |
If possible please provide simple diagrams. |
27 |
</hint> |
28 |
</question> |
29 |
--> |
30 |
<answer id="arch-overall"> |
31 |
<p> |
32 |
Native Execution API is intended to provide a flexible and extendable |
33 |
aid for running external processes on a local or remote hosts. |
34 |
</p> |
35 |
<p> |
36 |
The module itself doesn't provide any specific implementation. It |
37 |
also doesn't make any strict obligations on what is considered to be a |
38 |
Process or a Host. But it has some assumptions regarging those |
39 |
entities though... |
40 |
</p> |
41 |
<p> |
42 |
But first, two words about what this module is about and what it is not. |
43 |
This module is NOT about hosts management nor it is about connections |
44 |
management system (in sense of UI elements, persistance, etc.). This |
45 |
module is almost entirely about establishing a connection to some |
46 |
destination target (usually a host), running a process there and |
47 |
getting back it's I/O. Also some basic utilities are provided that |
48 |
could make these tasks easier to achieve. |
49 |
</p> |
50 |
<p> |
51 |
From the SPI implementor point of view this module is a set of |
52 |
extension points to introduce own notion of Process/Connection |
53 |
and add own implementation without a need to deal (a lot) with |
54 |
threading and other annoying issues... |
55 |
</p> |
56 |
<p> |
57 |
This API/SPI was written while keeping in mind a previous experiense |
58 |
with NativeExecution module. An attempt to re-design some questinoable |
59 |
approaches used in the previous implementation has been made. |
60 |
</p> |
61 |
Requirements for the module: |
62 |
<ul> |
63 |
<li>Extensibility - provide a way for adding new authorization |
64 |
schemes, new transport layers |
65 |
</li> |
66 |
<li>Predictibility - no hidden acctions (like unexpected |
67 |
connections initialization) |
68 |
</li> |
69 |
<li>Separatation between host (whatever it could be), user, |
70 |
authorization way and transport |
71 |
</li> |
72 |
<li>Clear error-flow</li> |
73 |
<li>Clear threading model</li> |
74 |
<li>Clear control over streams encodings</li> |
75 |
<li>Easy to use utilities</li> |
76 |
</ul> |
77 |
<p> |
78 |
The entity a user of this API starts with is a Connection. |
79 |
Any connection is identified by an URI. ConnectionManager is asked |
80 |
to give a connection for some URI and this Connection becames a |
81 |
provider of a NativeProcessBuilder which in turn can be used to |
82 |
start a NativeProcess in the context of that Connection. |
83 |
</p> |
84 |
<p> |
85 |
A scheme of an URI passed to the ConnectionManager is used to lookup |
86 |
an SPI implementor that can initiate, establish and provide a connection. |
87 |
All SPI implementors that deal with particular 'kind' of connections |
88 |
are registered in "ConnectionService/<scheme>" lookup path. |
89 |
</p> |
90 |
</answer> |
91 |
|
92 |
|
93 |
|
94 |
<!-- |
95 |
<question id="arch-quality" when="init"> |
96 |
How will the <a href="http://www.netbeans.org/community/guidelines/q-evangelism.html">quality</a> |
97 |
of your code be tested and |
98 |
how are future regressions going to be prevented? |
99 |
<hint> |
100 |
What kind of testing do |
101 |
you want to use? How much functionality, in which areas, |
102 |
should be covered by the tests? How you find out that your |
103 |
project was successful? |
104 |
</hint> |
105 |
</question> |
106 |
--> |
107 |
<answer id="arch-quality"> |
108 |
<p> |
109 |
There are already many users on an old API. The intention (and |
110 |
success metric) is to move all client of the old API to this one. |
111 |
<br/> |
112 |
Unit tests will be provided. Also there should be no regression in |
113 |
old API client's functionality. |
114 |
</p> |
115 |
</answer> |
116 |
|
117 |
|
118 |
|
119 |
<!-- |
120 |
<question id="arch-time" when="init"> |
121 |
What are the time estimates of the work? |
122 |
<hint> |
123 |
Please express your estimates of how long the design, implementation, |
124 |
stabilization are likely to last. How many people will be needed to |
125 |
implement this and what is the expected milestone by which the work should be |
126 |
ready? |
127 |
</hint> |
128 |
</question> |
129 |
--> |
130 |
<answer id="arch-time"> |
131 |
<p> |
132 |
This module should became a public replacement for dlight.nativeexecution module. |
133 |
<br/> |
134 |
As API is changed all friend-modules should be modified to use this new one. |
135 |
In most cases this should not be difficult, but taking into accont the |
136 |
number of 'old' API clients (100+ friend modules) this task could take a while. |
137 |
Estimation is two months. |
138 |
</p> |
139 |
</answer> |
140 |
|
141 |
|
142 |
|
143 |
<!-- |
144 |
<question id="arch-usecases" when="init"> |
145 |
<hint> |
146 |
Content of this answer will be displayed as part of page at |
147 |
http://www.netbeans.org/download/dev/javadoc/usecases.html |
148 |
You can use tags <usecase name="name> regular html description </usecase> |
149 |
and if you want to use an URL you can prefix if with @TOP@ to begin |
150 |
at the root of your javadoc |
151 |
</hint> |
152 |
|
153 |
Describe the main <a href="http://wiki.netbeans.org/API_Design#The_Importance_of_Being_Use_Case_Oriented"> |
154 |
use cases</a> of the new API. Who will use it under |
155 |
what circumstances? What kind of code would typically need to be written |
156 |
to use the module? |
157 |
</question> |
158 |
--> |
159 |
<answer id="arch-usecases"> |
160 |
<p> |
161 |
This module could be used for running external processes on a local and |
162 |
remote hosts. It is extendable and SPI implementors could provide different |
163 |
implementation of connections and processes... But at least two |
164 |
implementations are to be provided together with this module (in a |
165 |
separate implementation module). |
166 |
<br/> |
167 |
They are for starting local processes ("localhost" scheme) and remote |
168 |
processes using Jsch services ("ssh" scheme). |
169 |
<br/> |
170 |
Common usage is: |
171 |
<usecase id="simple-remote-process" name="Simple Remote Process"> |
172 |
<pre> |
173 |
try { |
174 |
URI uri = new URI("ssh://tester:tester@testmachine.com"); |
175 |
Connection connection = ConnectionManager.connect(uri); |
176 |
|
177 |
NativeProcessBuilder npb = connection.newProcessBuilder(); |
178 |
npb.setWorkingDirectory("/tmp/test").setCommand("my-command"); |
179 |
npb.getEnvironmentMap().prependPath("PATH", "/path/to/my-command"); |
180 |
|
181 |
ProcessUtils.ExitStatus result = ProcessUtils.execute(npb); |
182 |
if (result.isOK()) { |
183 |
System.out.println(result.output); |
184 |
} |
185 |
} catch (NativeExecutionException ex) { |
186 |
Exceptions.printStackTrace(ex); |
187 |
} catch (URISyntaxException ex) { |
188 |
Exceptions.printStackTrace(ex); |
189 |
} |
190 |
</pre> |
191 |
</usecase> |
192 |
</p> |
193 |
</answer> |
194 |
|
195 |
|
196 |
|
197 |
<!-- |
198 |
<question id="arch-what" when="init"> |
199 |
What is this project good for? |
200 |
<hint> |
201 |
Please provide here a few lines describing the project, |
202 |
what problem it should solve, provide links to documentation, |
203 |
specifications, etc. |
204 |
</hint> |
205 |
</question> |
206 |
--> |
207 |
<answer id="arch-what"> |
208 |
<p> |
209 |
This module provides an API/SPI be used for running external |
210 |
processes on a local or remote hosts. |
211 |
</p> |
212 |
</answer> |
213 |
|
214 |
|
215 |
|
216 |
<!-- |
217 |
<question id="arch-where" when="impl"> |
218 |
Where one can find sources for your module? |
219 |
<hint> |
220 |
Please provide link to the Hg web client at |
221 |
http://hg.netbeans.org/ |
222 |
or just use tag defaultanswer generate='here' |
223 |
</hint> |
224 |
</question> |
225 |
--> |
226 |
<answer id="arch-where"> |
227 |
<defaultanswer generate='here' /> |
228 |
</answer> |
229 |
|
230 |
|
231 |
|
232 |
<!-- |
233 |
<question id="compat-deprecation" when="init"> |
234 |
How the introduction of your project influences functionality |
235 |
provided by previous version of the product? |
236 |
<hint> |
237 |
If you are planning to deprecate/remove/change any existing APIs, |
238 |
list them here accompanied with the reason explaining why you |
239 |
are doing so. |
240 |
</hint> |
241 |
</question> |
242 |
--> |
243 |
<answer id="compat-deprecation"> |
244 |
<p> |
245 |
Process-related API from dlight.nativeexecution is planned to be |
246 |
first deprecated and then, when transition is done, demoved from |
247 |
the product. |
248 |
</p> |
249 |
</answer> |
250 |
|
251 |
|
252 |
|
253 |
<!-- |
254 |
<question id="compat-i18n" when="impl"> |
255 |
Is your module correctly internationalized? |
256 |
<hint> |
257 |
Correct internationalization means that it obeys instructions |
258 |
at <a href="http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/i18n-branding.html"> |
259 |
NetBeans I18N pages</a>. |
260 |
</hint> |
261 |
</question> |
262 |
--> |
263 |
<answer id="compat-i18n"> |
264 |
<p> |
265 |
Yes. Currently it has no UI except a ProgressBar which indicates a |
266 |
connection to a remote host progress. |
267 |
</p> |
268 |
</answer> |
269 |
|
270 |
|
271 |
|
272 |
<!-- |
273 |
<question id="compat-standards" when="init"> |
274 |
Does the module implement or define any standards? Is the |
275 |
implementation exact or does it deviate somehow? |
276 |
</question> |
277 |
--> |
278 |
<answer id="compat-standards"> |
279 |
<p> |
280 |
N/A |
281 |
</p> |
282 |
</answer> |
283 |
|
284 |
|
285 |
|
286 |
<!-- |
287 |
<question id="compat-version" when="impl"> |
288 |
Can your module coexist with earlier and future |
289 |
versions of itself? Can you correctly read all old settings? Will future |
290 |
versions be able to read your current settings? Can you read |
291 |
or politely ignore settings stored by a future version? |
292 |
|
293 |
<hint> |
294 |
Very helpful for reading settings is to store version number |
295 |
there, so future versions can decide whether how to read/convert |
296 |
the settings and older versions can ignore the new ones. |
297 |
</hint> |
298 |
</question> |
299 |
--> |
300 |
<answer id="compat-version"> |
301 |
<p> |
302 |
There is no any persistance in this module (at least for now). |
303 |
<br/> |
304 |
Module is extendable with SPI provided. |
305 |
</p> |
306 |
</answer> |
307 |
|
308 |
|
309 |
|
310 |
<!-- |
311 |
<question id="dep-jre" when="final"> |
312 |
Which version of JRE do you need (1.2, 1.3, 1.4, etc.)? |
313 |
<hint> |
314 |
It is expected that if your module runs on 1.x that it will run |
315 |
on 1.x+1 if no, state that please. Also describe here cases where |
316 |
you run different code on different versions of JRE and why. |
317 |
</hint> |
318 |
</question> |
319 |
--> |
320 |
<answer id="dep-jre"> |
321 |
<p> |
322 |
jre 1.6+ |
323 |
</p> |
324 |
</answer> |
325 |
|
326 |
|
327 |
|
328 |
<!-- |
329 |
<question id="dep-jrejdk" when="final"> |
330 |
Do you require the JDK or is the JRE enough? |
331 |
</question> |
332 |
--> |
333 |
<answer id="dep-jrejdk"> |
334 |
<p> |
335 |
JRE is enough. |
336 |
</p> |
337 |
</answer> |
338 |
|
339 |
|
340 |
|
341 |
<!-- |
342 |
<question id="dep-nb" when="init"> |
343 |
What other NetBeans projects and modules does this one depend on? |
344 |
<hint> |
345 |
Depending on other NetBeans projects influnces the ability of |
346 |
users of your work to customize their own branded version of |
347 |
NetBeans by enabling and disabling some modules. Too |
348 |
much dependencies restrict this kind of customization. If that |
349 |
is your case, then you may want to split your functionality into |
350 |
pieces of autoload, eager and regular modules which can be |
351 |
enabled independently. Usually the answer to this question |
352 |
is generated from your <code>project.xml</code> file, but |
353 |
if it is not guessed correctly, you can suppress it by |
354 |
specifying <defaultanswer generate="none"/> and |
355 |
write here your own. Please describe such projects as imported APIs using |
356 |
the <code><api name="identification" type="import or export" category="stable" url="where is the description" /></code>. |
357 |
By doing this information gets listed in the summary page of your |
358 |
javadoc. |
359 |
</hint> |
360 |
</question> |
361 |
--> |
362 |
<answer id="dep-nb"> |
363 |
<defaultanswer generate='here' /> |
364 |
</answer> |
365 |
|
366 |
|
367 |
|
368 |
<!-- |
369 |
<question id="dep-non-nb" when="init"> |
370 |
What other projects outside NetBeans does this one depend on? |
371 |
|
372 |
<hint> |
373 |
Depending on 3rd party libraries is always problematic, |
374 |
especially if they are not open source, as that complicates |
375 |
the licensing scheme of NetBeans. Please enumerate your |
376 |
external dependencies here, so it is correctly understood since |
377 |
the begining what are the legal implications of your project. |
378 |
Also please note that |
379 |
some non-NetBeans projects are packaged as NetBeans modules |
380 |
(see <a href="http://libs.netbeans.org/">libraries</a>) and |
381 |
it is preferred to use this approach when more modules may |
382 |
depend and share such third-party libraries. |
383 |
</hint> |
384 |
</question> |
385 |
--> |
386 |
<answer id="dep-non-nb"> |
387 |
<p> |
388 |
none. The default implementation of remote processes support uses jsch. |
389 |
But this is a different (implementation) module. |
390 |
</p> |
391 |
</answer> |
392 |
|
393 |
|
394 |
|
395 |
<!-- |
396 |
<question id="dep-platform" when="init"> |
397 |
On which platforms does your module run? Does it run in the same |
398 |
way on each? |
399 |
<hint> |
400 |
If you plan any dependency on OS or any usage of native code, |
401 |
please describe why you are doing so and describe how you envision |
402 |
to enforce the portability of your code. |
403 |
Please note that there is a support for <a href="http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/api.html#how-os-specific">OS conditionally |
404 |
enabled modules</a> which together with autoload/eager modules |
405 |
can allow you to enable to provide the best OS aware support |
406 |
on certain OSes while providing compatibility bridge on the not |
407 |
supported ones. |
408 |
Also please list the supported |
409 |
OSes/HW platforms and mentioned the lovest version of JDK required |
410 |
for your project to run on. Also state whether JRE is enough or |
411 |
you really need JDK. |
412 |
</hint> |
413 |
</question> |
414 |
--> |
415 |
<answer id="dep-platform"> |
416 |
<p> |
417 |
This module is almos a pure API/SPI so it is platform-independent. |
418 |
<br/> |
419 |
Implementation module with support of Windows, Linux, Solaris and MacOS |
420 |
will be provided. |
421 |
</p> |
422 |
</answer> |
423 |
|
424 |
|
425 |
|
426 |
<!-- |
427 |
<question id="deploy-dependencies" when="final"> |
428 |
What do other modules need to do to declare a dependency on this one, |
429 |
in addition to or instead of the normal module dependency declaration |
430 |
(e.g. tokens to require)? |
431 |
<hint> |
432 |
Provide a sample of the actual lines you would add to a module manifest |
433 |
to declare a dependency, for example OpenIDE-Module-Requires: some.token. |
434 |
If other modules should not depend on this module, or should just use a |
435 |
simple regular module dependency, you can just answer "nothing". If you |
436 |
intentionally expose a semistable API to clients using implementation |
437 |
dependencies, you should mention that here (but there is no need to give |
438 |
an example of usage). |
439 |
</hint> |
440 |
</question> |
441 |
--> |
442 |
<answer id="deploy-dependencies"> |
443 |
<p> |
444 |
This module needs implementation of the "localhost" scheme support.<br/> |
445 |
OpenIDE-Module-Needs: ConnectionService.localhost |
446 |
</p> |
447 |
</answer> |
448 |
|
449 |
|
450 |
|
451 |
<!-- |
452 |
<question id="deploy-jar" when="impl"> |
453 |
Do you deploy just module JAR file(s) or other files as well? |
454 |
<hint> |
455 |
Usually a module consist of one JAR file (perhaps with Class-Path |
456 |
extensions) and also a configuration file that enables it. If you |
457 |
have any other files, use |
458 |
<api group="java.io.File" name="yourname" type="export" category="friend">...</api> |
459 |
to define the location, name and stability of your files (of course |
460 |
changing "yourname" and "friend" to suit your needs). |
461 |
|
462 |
If it uses more than one JAR, describe where they are located, how |
463 |
they refer to each other. |
464 |
If it consist of module JAR(s) and other files, please describe |
465 |
what is their purpose, why other files are necessary. Please |
466 |
make sure that installation/uninstallation leaves the system |
467 |
in state as it was before installation. |
468 |
</hint> |
469 |
</question> |
470 |
--> |
471 |
<answer id="deploy-jar"> |
472 |
<p> |
473 |
just JAR. |
474 |
</p> |
475 |
</answer> |
476 |
|
477 |
|
478 |
|
479 |
<!-- |
480 |
<question id="deploy-nbm" when="impl"> |
481 |
Can you deploy an NBM via the Update Center? |
482 |
<hint> |
483 |
If not why? |
484 |
</hint> |
485 |
</question> |
486 |
--> |
487 |
<answer id="deploy-nbm"> |
488 |
<p> |
489 |
Yes. |
490 |
</p> |
491 |
</answer> |
492 |
|
493 |
|
494 |
|
495 |
<!-- |
496 |
<question id="deploy-packages" when="init"> |
497 |
Are packages of your module made inaccessible by not declaring them |
498 |
public? |
499 |
|
500 |
<hint> |
501 |
By default NetBeans build harness treats all packages are private. |
502 |
If you export some of them - either as public or friend packages, |
503 |
you should have a reason. If the reason is described elsewhere |
504 |
in this document, you can ignore this question. |
505 |
</hint> |
506 |
</question> |
507 |
--> |
508 |
<answer id="deploy-packages"> |
509 |
<p> |
510 |
There are several public API/SPI packages provided by this module. |
511 |
</p> |
512 |
</answer> |
513 |
|
514 |
|
515 |
|
516 |
<!-- |
517 |
<question id="deploy-shared" when="final"> |
518 |
Do you need to be installed in the shared location only, or in the user directory only, |
519 |
or can your module be installed anywhere? |
520 |
<hint> |
521 |
Installation location shall not matter, if it does explain why. |
522 |
Consider also whether <code>InstalledFileLocator</code> can help. |
523 |
</hint> |
524 |
</question> |
525 |
--> |
526 |
<answer id="deploy-shared"> |
527 |
<p> |
528 |
Installation location doesn't not matter, but as this module will |
529 |
become a part of the ide cluster, most likely it will be in a shared |
530 |
location. |
531 |
</p> |
532 |
</answer> |
533 |
|
534 |
|
535 |
|
536 |
<!-- |
537 |
<question id="exec-ant-tasks" when="impl"> |
538 |
Do you define or register any ant tasks that other can use? |
539 |
|
540 |
<hint> |
541 |
If you provide an ant task that users can use, you need to be very |
542 |
careful about its syntax and behaviour, as it most likely forms an |
543 |
API for end users and as there is a lot of end users, their reaction |
544 |
when such API gets broken can be pretty strong. |
545 |
</hint> |
546 |
</question> |
547 |
--> |
548 |
<answer id="exec-ant-tasks"> |
549 |
<p> |
550 |
No. |
551 |
</p> |
552 |
</answer> |
553 |
|
554 |
|
555 |
|
556 |
<!-- |
557 |
<question id="exec-classloader" when="impl"> |
558 |
Does your code create its own class loader(s)? |
559 |
<hint> |
560 |
A bit unusual. Please explain why and what for. |
561 |
</hint> |
562 |
</question> |
563 |
--> |
564 |
<answer id="exec-classloader"> |
565 |
<p> |
566 |
No. |
567 |
</p> |
568 |
</answer> |
569 |
|
570 |
|
571 |
|
572 |
<!-- |
573 |
<question id="exec-component" when="impl"> |
574 |
Is execution of your code influenced by any (string) property |
575 |
of any of your components? |
576 |
|
577 |
<hint> |
578 |
Often <code>JComponent.getClientProperty</code>, <code>Action.getValue</code> |
579 |
or <code>PropertyDescriptor.getValue</code>, etc. are used to influence |
580 |
a behavior of some code. This of course forms an interface that should |
581 |
be documented. Also if one depends on some interface that an object |
582 |
implements (<code>component instanceof Runnable</code>) that forms an |
583 |
API as well. |
584 |
</hint> |
585 |
</question> |
586 |
--> |
587 |
<answer id="exec-component"> |
588 |
<p> |
589 |
See ConnectionInfoProvider javadoc. |
590 |
</p> |
591 |
</answer> |
592 |
|
593 |
|
594 |
|
595 |
<!-- |
596 |
<question id="exec-introspection" when="impl"> |
597 |
Does your module use any kind of runtime type information (<code>instanceof</code>, |
598 |
work with <code>java.lang.Class</code>, etc.)? |
599 |
<hint> |
600 |
Check for cases when you have an object of type A and you also |
601 |
expect it to (possibly) be of type B and do some special action. That |
602 |
should be documented. The same applies on operations in meta-level |
603 |
(Class.isInstance(...), Class.isAssignableFrom(...), etc.). |
604 |
</hint> |
605 |
</question> |
606 |
--> |
607 |
<answer id="exec-introspection"> |
608 |
<p> |
609 |
There are connection-specific properties that could be of any kind. |
610 |
SPI implementor defines pairs of property name -- class and later |
611 |
API clients are expected to get/set defined properties of defined |
612 |
classes. Runtime type checking is performed in put/get methods. See |
613 |
javadoc for NativeProcessBuilder, AuthDataProvider. |
614 |
</p> |
615 |
</answer> |
616 |
|
617 |
|
618 |
|
619 |
<!-- |
620 |
<question id="exec-privateaccess" when="final"> |
621 |
Are you aware of any other parts of the system calling some of |
622 |
your methods by reflection? |
623 |
<hint> |
624 |
If so, describe the "contract" as an API. Likely private or friend one, but |
625 |
still API and consider rewrite of it. |
626 |
</hint> |
627 |
</question> |
628 |
--> |
629 |
<answer id="exec-privateaccess"> |
630 |
<p> |
631 |
No. |
632 |
</p> |
633 |
</answer> |
634 |
|
635 |
|
636 |
|
637 |
<!-- |
638 |
<question id="exec-process" when="impl"> |
639 |
Do you execute an external process from your module? How do you ensure |
640 |
that the result is the same on different platforms? Do you parse output? |
641 |
Do you depend on result code? |
642 |
<hint> |
643 |
If you feed an input, parse the output please declare that as an API. |
644 |
</hint> |
645 |
</question> |
646 |
--> |
647 |
<answer id="exec-process"> |
648 |
<p> |
649 |
Yes. This module is about starting external processes. It is up to |
650 |
client to work with a result of execution. |
651 |
</p> |
652 |
</answer> |
653 |
|
654 |
|
655 |
|
656 |
<!-- |
657 |
<question id="exec-property" when="impl"> |
658 |
Is execution of your code influenced by any environment or |
659 |
Java system (<code>System.getProperty</code>) property? |
660 |
On a similar note, is there something interesting that you |
661 |
pass to <code>java.util.logging.Logger</code>? Or do you observe |
662 |
what others log? |
663 |
<hint> |
664 |
If there is a property that can change the behavior of your |
665 |
code, somebody will likely use it. You should describe what it does |
666 |
and the <a href="http://wiki.netbeans.org/API_Stability">stability category</a> |
667 |
of this API. You may use |
668 |
<pre> |
669 |
<api type="export" group="property" name="id" category="private" url="http://..."> |
670 |
description of the property, where it is used, what it influence, etc. |
671 |
</api> |
672 |
</pre> |
673 |
</hint> |
674 |
</question> |
675 |
--> |
676 |
<answer id="exec-property"> |
677 |
<p> |
678 |
"ide.execution.logger.level" is used to define a logger level. |
679 |
</p> |
680 |
</answer> |
681 |
|
682 |
|
683 |
|
684 |
<!-- |
685 |
<question id="exec-reflection" when="impl"> |
686 |
Does your code use Java Reflection to execute other code? |
687 |
<hint> |
688 |
This usually indicates a missing or insufficient API in the other |
689 |
part of the system. If the other side is not aware of your dependency |
690 |
this contract can be easily broken. |
691 |
</hint> |
692 |
</question> |
693 |
--> |
694 |
<answer id="exec-reflection"> |
695 |
<p> |
696 |
No. |
697 |
</p> |
698 |
</answer> |
699 |
|
700 |
|
701 |
|
702 |
<!-- |
703 |
<question id="exec-threading" when="init"> |
704 |
What threading models, if any, does your module adhere to? How the |
705 |
project behaves with respect to threading? |
706 |
<hint> |
707 |
Is your API threadsafe? Can it be accessed from any threads or |
708 |
just from some dedicated ones? Any special relation to AWT and |
709 |
its Event Dispatch thread? Also |
710 |
if your module calls foreign APIs which have a specific threading model, |
711 |
indicate how you comply with the requirements for multithreaded access |
712 |
(synchronization, mutexes, etc.) applicable to those APIs. |
713 |
If your module defines any APIs, or has complex internal structures |
714 |
that might be used from multiple threads, declare how you protect |
715 |
data against concurrent access, race conditions, deadlocks, etc., |
716 |
and whether such rules are enforced by runtime warnings, errors, assertions, etc. |
717 |
Examples: a class might be non-thread-safe (like Java Collections); might |
718 |
be fully thread-safe (internal locking); might require access through a mutex |
719 |
(and may or may not automatically acquire that mutex on behalf of a client method); |
720 |
might be able to run only in the event queue; etc. |
721 |
Also describe when any events are fired: synchronously, asynchronously, etc. |
722 |
Ideas: <a href="http://core.netbeans.org/proposals/threading/index.html#recommendations">Threading Recommendations</a> (in progress) |
723 |
</hint> |
724 |
</question> |
725 |
--> |
726 |
<answer id="exec-threading"> |
727 |
<p> |
728 |
Some classes (most) are thread-safe, others are not. If class is not |
729 |
thread-safe, it is described in a javadoc. |
730 |
</p> |
731 |
</answer> |
732 |
|
733 |
<!-- |
734 |
<question id="format-clipboard" when="impl"> |
735 |
Which data flavors (if any) does your code read from or insert to |
736 |
the clipboard (by access to clipboard on means calling methods on <code>java.awt.datatransfer.Transferable</code>? |
737 |
|
738 |
<hint> |
739 |
Often Node's deal with clipboard by usage of <code>Node.clipboardCopy, Node.clipboardCut and Node.pasteTypes</code>. |
740 |
Check your code for overriding these methods. |
741 |
</hint> |
742 |
</question> |
743 |
--> |
744 |
<answer id="format-clipboard"> |
745 |
<p> |
746 |
N/A |
747 |
</p> |
748 |
</answer> |
749 |
|
750 |
|
751 |
|
752 |
<!-- |
753 |
<question id="format-dnd" when="impl"> |
754 |
Which protocols (if any) does your code understand during Drag & Drop? |
755 |
<hint> |
756 |
Often Node's deal with clipboard by usage of <code>Node.drag, Node.getDropType</code>. |
757 |
Check your code for overriding these methods. Btw. if they are not overridden, they |
758 |
by default delegate to <code>Node.clipboardCopy, Node.clipboardCut and Node.pasteTypes</code>. |
759 |
</hint> |
760 |
</question> |
761 |
--> |
762 |
<answer id="format-dnd"> |
763 |
<p> |
764 |
N/A |
765 |
</p> |
766 |
</answer> |
767 |
|
768 |
|
769 |
|
770 |
<!-- |
771 |
<question id="format-types" when="impl"> |
772 |
Which protocols and file formats (if any) does your module read or write on disk, |
773 |
or transmit or receive over the network? Do you generate an ant build script? |
774 |
Can it be edited and modified? |
775 |
|
776 |
<hint> |
777 |
<p> |
778 |
Files can be read and written by other programs, modules and users. If they influence |
779 |
your behaviour, make sure you either document the format or claim that it is a private |
780 |
api (using the <api> tag). |
781 |
</p> |
782 |
|
783 |
<p> |
784 |
If you generate an ant build file, this is very likely going to be seen by end users and |
785 |
they will be attempted to edit it. You should be ready for that and provide here a link |
786 |
to documentation that you have for such purposes and also describe how you are going to |
787 |
understand such files during next release, when you (very likely) slightly change the |
788 |
format. |
789 |
</p> |
790 |
</hint> |
791 |
</question> |
792 |
--> |
793 |
<answer id="format-types"> |
794 |
<p> |
795 |
N/A |
796 |
</p> |
797 |
</answer> |
798 |
|
799 |
|
800 |
|
801 |
<!-- |
802 |
<question id="lookup-lookup" when="init"> |
803 |
Does your module use <code>org.openide.util.Lookup</code> |
804 |
or any similar technology to find any components to communicate with? Which ones? |
805 |
|
806 |
<hint> |
807 |
NetBeans is build around a generic registry of services called |
808 |
lookup. It is preferable to use it for registration and discovery |
809 |
if possible. See |
810 |
<a href="http://www.netbeans.org/download/dev/javadoc/org-openide-util/org/openide/util/lookup/doc-files/index.html"> |
811 |
The Solution to Comunication Between Components |
812 |
</a>. If you do not plan to use lookup and insist usage |
813 |
of other solution, then please describe why it is not working for |
814 |
you. |
815 |
<br/> |
816 |
When filling the final version of your arch document, please |
817 |
describe the interfaces you are searching for, where |
818 |
are defined, whether you are searching for just one or more of them, |
819 |
if the order is important, etc. Also classify the stability of such |
820 |
API contract. Use <api group=&lookup& /> tag, so |
821 |
your information gets listed in the summary page of your javadoc. |
822 |
</hint> |
823 |
</question> |
824 |
--> |
825 |
<answer id="lookup-lookup"> |
826 |
<p> |
827 |
Yes, Lookup is in use. Connection has an associated Lookup that is |
828 |
explored to get implementations of some specific services |
829 |
(like ConnectionInfoProvider, SignalSupportProvider). |
830 |
Also AuthDataProvider, URIIdentifier and Connector implementations |
831 |
are registered in the global lookup within a "ConnectionService/<scheme>" |
832 |
path. |
833 |
</p> |
834 |
</answer> |
835 |
|
836 |
|
837 |
|
838 |
<!-- |
839 |
<question id="lookup-register" when="final"> |
840 |
Do you register anything into lookup for other code to find? |
841 |
<hint> |
842 |
Do you register using layer file or using a declarative annotation such as <code>@ServiceProvider</code>? |
843 |
Who is supposed to find your component? |
844 |
</hint> |
845 |
</question> |
846 |
--> |
847 |
<answer id="lookup-register"> |
848 |
<p> |
849 |
No. |
850 |
</p> |
851 |
</answer> |
852 |
|
853 |
|
854 |
|
855 |
<!-- |
856 |
<question id="lookup-remove" when="final"> |
857 |
Do you remove entries of other modules from lookup? |
858 |
<hint> |
859 |
Why? Of course, that is possible, but it can be dangerous. Is the module |
860 |
your are masking resource from aware of what you are doing? |
861 |
</hint> |
862 |
</question> |
863 |
--> |
864 |
<answer id="lookup-remove"> |
865 |
<p> |
866 |
No. |
867 |
</p> |
868 |
</answer> |
869 |
|
870 |
|
871 |
|
872 |
<!-- |
873 |
<question id="perf-exit" when="final"> |
874 |
Does your module run any code on exit? |
875 |
</question> |
876 |
--> |
877 |
<answer id="perf-exit"> |
878 |
<p> |
879 |
No. |
880 |
</p> |
881 |
</answer> |
882 |
|
883 |
|
884 |
|
885 |
<!-- |
886 |
<question id="perf-huge_dialogs" when="final"> |
887 |
Does your module contain any dialogs or wizards with a large number of |
888 |
GUI controls such as combo boxes, lists, trees, or text areas? |
889 |
</question> |
890 |
--> |
891 |
<answer id="perf-huge_dialogs"> |
892 |
<p> |
893 |
No. |
894 |
</p> |
895 |
</answer> |
896 |
|
897 |
|
898 |
|
899 |
<!-- |
900 |
<question id="perf-limit" when="init"> |
901 |
Are there any hard-coded or practical limits in the number or size of |
902 |
elements your code can handle? |
903 |
<hint> |
904 |
Most of algorithms have increasing memory and speed complexity |
905 |
with respect to size of data they operate on. What is the critical |
906 |
part of your project that can be seen as a bottleneck with |
907 |
respect to speed or required memory? What are the practical |
908 |
sizes of data you tested your project with? What is your estimate |
909 |
of potential size of data that would cause visible performance |
910 |
problems? Is there some kind of check to detect such situation |
911 |
and prevent "hard" crashes - for example the CloneableEditorSupport |
912 |
checks for size of a file to be opened in editor |
913 |
and if it is larger than 1Mb it shows a dialog giving the |
914 |
user the right to decide - e.g. to cancel or commit suicide. |
915 |
</hint> |
916 |
</question> |
917 |
--> |
918 |
<answer id="perf-limit"> |
919 |
<p> |
920 |
No. |
921 |
</p> |
922 |
</answer> |
923 |
|
924 |
|
925 |
|
926 |
<!-- |
927 |
<question id="perf-mem" when="final"> |
928 |
How much memory does your component consume? Estimate |
929 |
with a relation to the number of windows, etc. |
930 |
</question> |
931 |
--> |
932 |
<answer id="perf-mem"> |
933 |
<p> |
934 |
N/A |
935 |
</p> |
936 |
</answer> |
937 |
|
938 |
|
939 |
|
940 |
<!-- |
941 |
<question id="perf-menus" when="final"> |
942 |
Does your module use dynamically updated context menus, or |
943 |
context-sensitive actions with complicated and slow enablement logic? |
944 |
<hint> |
945 |
If you do a lot of tricks when adding actions to regular or context menus, you can significantly |
946 |
slow down display of the menu, even when the user is not using your action. Pay attention to |
947 |
actions you add to the main menu bar, and to context menus of foreign nodes or components. If |
948 |
the action is conditionally enabled, or changes its display dynamically, you need to check the |
949 |
impact on performance. In some cases it may be more appropriate to make a simple action that is |
950 |
always enabled but does more detailed checks in a dialog if it is actually run. |
951 |
</hint> |
952 |
</question> |
953 |
--> |
954 |
<answer id="perf-menus"> |
955 |
<p> |
956 |
No. |
957 |
</p> |
958 |
</answer> |
959 |
|
960 |
|
961 |
|
962 |
<!-- |
963 |
<question id="perf-progress" when="final"> |
964 |
Does your module execute any long-running tasks? |
965 |
|
966 |
<hint>Long running tasks should never block |
967 |
AWT thread as it badly hurts the UI |
968 |
<a href="http://performance.netbeans.org/responsiveness/issues.html"> |
969 |
responsiveness</a>. |
970 |
Tasks like connecting over |
971 |
network, computing huge amount of data, compilation |
972 |
be done asynchronously (for example |
973 |
using <code>RequestProcessor</code>), definitively it should |
974 |
not block AWT thread. |
975 |
</hint> |
976 |
</question> |
977 |
--> |
978 |
<answer id="perf-progress"> |
979 |
<p> |
980 |
Yes. They are run outside the ETD. |
981 |
</p> |
982 |
</answer> |
983 |
|
984 |
|
985 |
|
986 |
<!-- |
987 |
<question id="perf-scale" when="init"> |
988 |
Which external criteria influence the performance of your |
989 |
program (size of file in editor, number of files in menu, |
990 |
in source directory, etc.) and how well your code scales? |
991 |
<hint> |
992 |
Please include some estimates, there are other more detailed |
993 |
questions to answer in later phases of implementation. |
994 |
</hint> |
995 |
</question> |
996 |
--> |
997 |
<answer id="perf-scale"> |
998 |
<p> |
999 |
N/A |
1000 |
</p> |
1001 |
</answer> |
1002 |
|
1003 |
|
1004 |
|
1005 |
<!-- |
1006 |
<question id="perf-spi" when="init"> |
1007 |
How the performance of the plugged in code will be enforced? |
1008 |
<hint> |
1009 |
If you allow foreign code to be plugged into your own module, how |
1010 |
do you enforce that it will behave correctly and quickly and will not |
1011 |
negatively influence the performance of your own module? |
1012 |
</hint> |
1013 |
</question> |
1014 |
--> |
1015 |
<answer id="perf-spi"> |
1016 |
<p> |
1017 |
There is a code that can be plugged in and that can influence the |
1018 |
performance (like listeners implementations, as they are notified |
1019 |
synchroniously). But this is done outside the EDT... <br/> |
1020 |
</p> |
1021 |
</answer> |
1022 |
|
1023 |
|
1024 |
|
1025 |
<!-- |
1026 |
<question id="perf-startup" when="final"> |
1027 |
Does your module run any code on startup? |
1028 |
</question> |
1029 |
--> |
1030 |
<answer id="perf-startup"> |
1031 |
<p> |
1032 |
No. |
1033 |
</p> |
1034 |
</answer> |
1035 |
|
1036 |
|
1037 |
|
1038 |
<!-- |
1039 |
<question id="perf-wakeup" when="final"> |
1040 |
Does any piece of your code wake up periodically and do something |
1041 |
even when the system is otherwise idle (no user interaction)? |
1042 |
</question> |
1043 |
--> |
1044 |
<answer id="perf-wakeup"> |
1045 |
<p> |
1046 |
Yes. There is a thread that is started once a second to test if all |
1047 |
known connections are still alive. |
1048 |
<br/> |
1049 |
This thread exists only if there are listeners that are waiting for |
1050 |
"connection lost" event and only if there is at least one active |
1051 |
connection. |
1052 |
</p> |
1053 |
</answer> |
1054 |
|
1055 |
|
1056 |
|
1057 |
<!-- |
1058 |
<question id="resources-file" when="final"> |
1059 |
Does your module use <code>java.io.File</code> directly? |
1060 |
|
1061 |
<hint> |
1062 |
NetBeans provide a logical wrapper over plain files called |
1063 |
<code>org.openide.filesystems.FileObject</code> that |
1064 |
provides uniform access to such resources and is the preferred |
1065 |
way that should be used. But of course there can be situations when |
1066 |
this is not suitable. |
1067 |
</hint> |
1068 |
</question> |
1069 |
--> |
1070 |
<answer id="resources-file"> |
1071 |
<p> |
1072 |
No. |
1073 |
</p> |
1074 |
</answer> |
1075 |
|
1076 |
|
1077 |
|
1078 |
<!-- |
1079 |
<question id="resources-layer" when="final"> |
1080 |
Does your module provide own layer? Does it create any files or |
1081 |
folders in it? What it is trying to communicate by that and with which |
1082 |
components? |
1083 |
|
1084 |
<hint> |
1085 |
NetBeans allows automatic and declarative installation of resources |
1086 |
by module layers. Module register files into appropriate places |
1087 |
and other components use that information to perform their task |
1088 |
(build menu, toolbar, window layout, list of templates, set of |
1089 |
options, etc.). |
1090 |
</hint> |
1091 |
</question> |
1092 |
--> |
1093 |
<answer id="resources-layer"> |
1094 |
<p> |
1095 |
No. |
1096 |
</p> |
1097 |
</answer> |
1098 |
|
1099 |
|
1100 |
|
1101 |
<!-- |
1102 |
<question id="resources-mask" when="final"> |
1103 |
Does your module mask/hide/override any resources provided by other modules in |
1104 |
their layers? |
1105 |
|
1106 |
<hint> |
1107 |
If you mask a file provided by another module, you probably depend |
1108 |
on that and do not want the other module to (for example) change |
1109 |
the file's name. That module shall thus make that file available as an API |
1110 |
of some stability category. |
1111 |
</hint> |
1112 |
</question> |
1113 |
--> |
1114 |
<answer id="resources-mask"> |
1115 |
<p> |
1116 |
No. |
1117 |
</p> |
1118 |
</answer> |
1119 |
|
1120 |
|
1121 |
|
1122 |
<!-- |
1123 |
<question id="resources-preferences" when="final"> |
1124 |
Does your module uses preferences via Preferences API? Does your module use NbPreferences or |
1125 |
or regular JDK Preferences ? Does it read, write or both ? |
1126 |
Does it share preferences with other modules ? If so, then why ? |
1127 |
<hint> |
1128 |
You may use |
1129 |
<api type="export" group="preferences" |
1130 |
name="preference node name" category="private"> |
1131 |
description of individual keys, where it is used, what it |
1132 |
influences, whether the module reads/write it, etc. |
1133 |
</api> |
1134 |
Due to XML ID restrictions, rather than /org/netbeans/modules/foo give the "name" as org.netbeans.modules.foo. |
1135 |
Note that if you use NbPreferences this name will then be the same as the code name base of the module. |
1136 |
</hint> |
1137 |
</question> |
1138 |
--> |
1139 |
<answer id="resources-preferences"> |
1140 |
<p> |
1141 |
No. |
1142 |
</p> |
1143 |
</answer> |
1144 |
|
1145 |
|
1146 |
|
1147 |
<!-- |
1148 |
<question id="resources-read" when="final"> |
1149 |
Does your module read any resources from layers? For what purpose? |
1150 |
|
1151 |
<hint> |
1152 |
As this is some kind of intermodule dependency, it is a kind of API. |
1153 |
Please describe it and classify according to |
1154 |
<a href="http://wiki.netbeans.org/API_Design#What_is_an_API.3F"> |
1155 |
common stability categories</a>. |
1156 |
</hint> |
1157 |
</question> |
1158 |
--> |
1159 |
<answer id="resources-read"> |
1160 |
<p> |
1161 |
No. |
1162 |
</p> |
1163 |
</answer> |
1164 |
|
1165 |
|
1166 |
|
1167 |
<!-- |
1168 |
<question id="security-grant" when="final"> |
1169 |
Does your code grant additional rights to some other code? |
1170 |
<hint>Avoid using a class loader that adds extra |
1171 |
permissions to loaded code unless really necessary. |
1172 |
Also note that your API implementation |
1173 |
can also expose unneeded permissions to enemy code by |
1174 |
calling AccessController.doPrivileged().</hint> |
1175 |
</question> |
1176 |
--> |
1177 |
<answer id="security-grant"> |
1178 |
<p> |
1179 |
No. |
1180 |
</p> |
1181 |
</answer> |
1182 |
|
1183 |
|
1184 |
|
1185 |
<!-- |
1186 |
<question id="security-policy" when="final"> |
1187 |
Does your functionality require modifications to the standard policy file? |
1188 |
<hint>Your code might pass control to third-party code not |
1189 |
coming from trusted domains. This could be code downloaded over the |
1190 |
network or code coming from libraries that are not bundled |
1191 |
with NetBeans. Which permissions need to be granted to which domains?</hint> |
1192 |
</question> |
1193 |
--> |
1194 |
<answer id="security-policy"> |
1195 |
<p> |
1196 |
No. |
1197 |
</p> |
1198 |
</answer> |
1199 |
|
1200 |
</api-answers> |