diff -r 177e5db417f9 j2eeserver/arch.xml --- a/j2eeserver/arch.xml Wed Apr 14 18:11:50 2010 +0400 +++ b/j2eeserver/arch.xml Mon Apr 19 14:24:52 2010 +0400 @@ -71,9 +71,10 @@

- There are two separate api/spi sets in j2eeserver. The devmodules + There are three separate api/spi sets in j2eeserver. The devmodules api/spi is for j2ee development modules (web, j2ee app, etc). The - plugins api/spi is for server plugins. + plugins api/spi is for server plugins. The profiler api/spi is for + profiler J2EE integration plugins.

@@ -92,6 +93,11 @@ + + J2EE Profiler api/spi is an intergation bridge between J2EE servers registered in IDE + and pluggable profiling capability . + + XML layer contract for registration of server plugins and instances that implement optional capabilities of server plugins. Plugins with @@ -327,6 +333,77 @@

+ + J2EE application profiling capability could be integrated in to IDE. + In order to do this plugin needs to implement interface + ProfilerProvider and register it as ProfilerProvider service in default lookup. + It is important to note that J2EE profiler plugin doesn't provide profiling functionality. + This plugin just manages J2EE server registered in IDE for profiling purpose. + It allows to start/stop J2EE server instance and tracks its state. + There are should be also functionality which allows to profile. But this is not covered here. + This functionality is separate module. + + + + IDE could have several Profiler providers registered. In order to distinguish them based on some id there is + ProfilerRegistry class. + Method getId() allows to get identifier for profiler provider implementation which could be used + for passing futher by client ( into Ant task f.e. ). It allows to request proiling via chosen profiler. + Method getProvider() should be used on J2EE server instance side to access chosen J2EE profiler. + + + + There are two ways to start J2EE server in profiling mode: +
    +
  • Ant task nbstartprofiledserver
  • +
  • "Start in Profile Mode" action for J2EE server instance ( currently this is AWT Action)
  • +
+ The first one uses ant task properties configured based on project. + ProfilerServerSettings class is instantiated + based on this properties . + Method "getDefaultServerSettings()" is used in case of starting J2EE server in profile mode without original project properties + ( case when server is started via AWT Action ). + ProfilerSession created by + ProfilerProvider is used for managing + profiling of J2EE server instance. + + Profiler provider could support singleton/several simultaneous sessions . In order to handle this situation there is a method + canConfigure(). User will be asked to stop profiling sessions in case of requested session can't be configured + to start till canConfigure return true. + + New session start could require to modify java arguments in + ProfilerServerSettings + ( f.e. network port change , etc. ). This can be done via method configureSession(). + + When session is configured for starting class StartServer + is used for starting J2EE server in profiling mode. Each J2EE server plugin is responsible for implementing + profiling functionality implementing. + + + + There is a need to track state of J2EE server instance . + In order to do this ProfilerSession has + ability to register listeners. + + + + There are two ways to stop profiling J2EE server: +
    +
  • "Stop" action for J2EE server ( currently AWT Action )
  • +
  • Stop profling with stop profiled application option ( currently this is Stop Profile Button ) +
+ + The first one is controlled by J2EE server instance class which has a knowledge about profiling session . There is a session method + requestStop(). Implementation of this method is responsible for notifying listeners with STATE_STOPPING + profiling state change. Also it can provide some additional clean up code for profiling stop. + + Other way to stop : Profiler stop with profiled application option . In this case ProfilerSession implelentation should notify + its listeners about state change. + + So in both cases ProfilerSession listeners will be notified by STATE_STOPPING state . + J2EE server instance class is registered as ProfilerSession listener . So it is able to stop server carefully . + +

- No change to existing APIs. + Class ProfilerSupport is deprecated. + It has not been required from very beggining. It is just container for constants which are now are moved into + ProfilerSession. It's single static + method is just duplication of method in + ProfilerSession. + Mentioned method has ambiguity becuase of current profiler privider concept ( there is no singleton provider and session ).