This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 182772
Collapse All | Expand All

(-)a/j2eeserver/arch.xml (-3 / +84 lines)
Lines 71-79 Link Here
71
<answer id="arch-overall">
71
<answer id="arch-overall">
72
72
73
<p>
73
<p>
74
    There are two separate api/spi sets in j2eeserver. The devmodules
74
    There are three separate api/spi sets in j2eeserver. The devmodules
75
    api/spi is for j2ee development modules (web, j2ee app, etc). The
75
    api/spi is for j2ee development modules (web, j2ee app, etc). The
76
    plugins api/spi is for server plugins.
76
    plugins api/spi is for server plugins. The profiler api/spi is for
77
    profiler J2EE integration plugins.
77
</p>
78
</p>
78
79
79
<api name="J2EEServer-devmodules" type="export" category="friend" group="java">
80
<api name="J2EEServer-devmodules" type="export" category="friend" group="java">
Lines 92-97 Link Here
92
  </ul>
93
  </ul>
93
</api>
94
</api>
94
    
95
    
96
<api name="J2EEProfilerAPI" type="export" category="friend" group="java">
97
	J2EE Profiler api/spi is an intergation bridge between J2EE servers registered in IDE 
98
	and pluggable profiling capability .
99
</api>
100
95
<api type="export" group="layer" name="PluginRegistration" category="friend" url="@TOP@/org/netbeans/modules/j2ee/deployment/plugins/api/doc-files/plugin-layer-file.html">
101
<api type="export" group="layer" name="PluginRegistration" category="friend" url="@TOP@/org/netbeans/modules/j2ee/deployment/plugins/api/doc-files/plugin-layer-file.html">
96
    XML layer contract for registration of server plugins and instances that implement 
102
    XML layer contract for registration of server plugins and instances that implement 
97
    optional capabilities of server plugins.  Plugins with
103
    optional capabilities of server plugins.  Plugins with
Lines 327-332 Link Here
327
    </p>
333
    </p>
328
</usecase>
334
</usecase>
329
335
336
<usecase id="j2ee-profiler-api" name="J2EE Profiler Plugin">
337
	J2EE application profiling capability could be integrated in to IDE.
338
	In order to do this plugin needs to implement interface <a href="@TOP@/org/netbeans/modules/j2ee/deployment/profiler/spi/ProfilerProvider.html">
339
	ProfilerProvider</a> and register it as ProfilerProvider service in default lookup.
340
	It is important to note that J2EE profiler plugin doesn't provide profiling functionality.
341
	This plugin just manage J2EE server registered in IDE for profiling purpose.
342
	It allows to start/stop J2EE server instance and tracks its state.
343
	There are should be also functionality which allows to <b>profile</b>. But this is not covered here.
344
	This functionality is separate module.
345
</usacese>
346
347
<usecase id="profiler-distinguish" name="J2EE Profiler Plugin Identifier">
348
	IDE could have several Profiler providers registered. In order to distinguish them based on some id there is a ProfilerProvider method 
349
	<code>isApplicable()</code>.  As already was mentioned <b>profiling</b> is functionality of different module. This module
350
	should be host profiling module with some unique identifier which distinguish it among other plugins.
351
	Using <code>isApplicable()</code> method one can identify J2EE profiler plugin as related to host profiling module.
352
</usacese>
353
354
<usecase id="profiler-start" name="Start J2EE server in profiling mode">
355
	There are two ways to start J2EE server in profiling mode:
356
	<ul>
357
		<li>Ant task <code>nbstartprofiledserver</code> </li>
358
		<li>"Start in Profile Mode" action for J2EE server instance ( currently this is AWT Action)</li>
359
	</ul>
360
	The first one uses ant task properties configured based on project. 
361
	<a href="@TOP@/org/netbeans/modules/j2ee/deployment/profiler/api/ProfilerServerSettings.html">ProfilerServerSettings</a> class is instantiated 
362
	based on this properties . 
363
	Method "getDefaultServerSettings()" is used in case of starting J2EE server in profile mode without original project properties 
364
	( case when server is started via AWT Action ).
365
	<a href="@TOP@/org/netbeans/modules/j2ee/deployment/profiler/spi/ProfilerSession.html">ProfilerSession</a> created by
366
	<a href="@TOP@/org/netbeans/modules/j2ee/deployment/profiler/spi/ProfilerProvider.html">ProfilerProvider</a>  is used for managing
367
	profiling of J2EE server instance.
368
369
	Profiler provider could support singleton/several simultaneous sessions . In order to handle this situation there is a method
370
	<code>canConfigure()</code>. User will be asked to stop profiling sessions in case of requested session can't be configured 
371
	to start till <code>canConfigure</code> return <code>true</code>.
372
373
	New session start could require to modify java arguments in 
374
	<a href="@TOP@/org/netbeans/modules/j2ee/deployment/profiler/api/ProfilerServerSettings.html">ProfilerServerSettings</a> 
375
	( f.e. network port change , etc. ). This can be done via method <code>configureSession()</code>.
376
377
	When session is configured for starting class <a href="@TOP@/org/netbeans/modules/j2ee/deployment/plugins/spi/StartServer">StartServer</a>
378
	is used for starting J2EE server in profiling mode. Each J2EE server plugin is responsible for implementing 
379
	profiling functionality implementing.
380
</usacese>
381
382
<usecase id="state-tracking" name="J2EE server state tracking">
383
	There is a need to track state of J2EE server instance .
384
	In order to do this <a href="@TOP@/org/netbeans/modules/j2ee/deployment/profiler/spi/ProfilerSession.html">ProfilerSession</a> has
385
	ability to register listeners.
386
</usacese>
387
388
<usecase id="stop-profiling" name="J2EE server stop">
389
	There are two ways to stop profiling J2EE server:
390
	<ul>
391
		<li>"Stop" action for J2EE server ( currently AWT Action )</li>
392
		<li>Stop profling with stop profiled application option ( currently this is Stop Profile Button )</code>
393
	</ul>
394
395
	The first one is controlled by J2EE server instance class which has a knowledge about profiling session . There is a session method
396
	<code>requestStop()</code>. Implementation of this method is responsible for notifying listeners with <code>STATE_STOPPING</code>
397
	profiling state change. Also it can provide some additional clean up code for profiling stop.
398
399
	Other way to stop : Profiler stop with profiled application option .  In this case ProfilerSession implelentation should notify 
400
	its listeners about state change.
401
402
	So in both cases ProfilerSession listeners will be notified by <code>STATE_STOPPING</code> state .
403
	J2EE server instance class is registered as ProfilerSession listener . So it is able to stop server carefully .
404
</usacese>
405
330
</answer>
406
</answer>
331
<!--         
407
<!--         
332
        <question id="arch-time" when="init">
408
        <question id="arch-time" when="init">
Lines 1152-1158 Link Here
1152
-->
1228
-->
1153
 <answer id="compat-deprecation">
1229
 <answer id="compat-deprecation">
1154
  <p>
1230
  <p>
1155
   No change to existing APIs.
1231
	  Class <a href="@TOP@/org/netbeans/modules/j2ee/deployment/profiler/api/ProfilerSupport.html">ProfilerSupport</a> is removed.
1232
	  It have not been required from very beggining. It is just container for constants which are now are moved into 
1233
	  <a href="@TOP@/org/netbeans/modules/j2ee/deployment/profiler/spi/ProfilerSession.html">ProfilerSession</a>. It's single static 
1234
	  method is just duplication of method in 
1235
	  <a href="@TOP@/org/netbeans/modules/j2ee/deployment/profiler/spi/ProfilerSession.html">ProfilerSession</a>.
1236
	  Mentioned method cannot be used with current profiler privider concept ( there is no singleton provider and session ).
1156
  </p>
1237
  </p>
1157
 </answer>
1238
 </answer>
1158
1239

Return to bug 182772