Clone
Dan Haywood <dan@haywood-associates.co.uk>
committed
on 31 May 16
ISIS-1419: simplified Session management.
The exception resulting, I believe, from lack of symmetry in the integ tests: they set up a single… Show more
ISIS-1419: simplified Session management.

The exception resulting, I believe, from lack of symmetry in the integ tests: they set up a single session for all tests, but in the shutdown (called by a Runtime hook), create a different session again to perform the @PreDestroy stuff.  In this commit, I've decided to get rid of this shutdown stuff, basically orphaning that initial session (it is never closed down, but then the JVM quits anyway, and this is for an inmemory databases so no real harm).

A subsequent commit will take look to close the session in the teardown of each test.

In detail:

- in IsisContext, change the Map<Thread,IsisSession> into a simple ThreadLocal.  remove the logic to save every IsisSession in this map, and remove the closeAllSessionsInstance().  In IsisSession, remove the id() and sessionOpenTime properties (now unused), and remove closeAll() - was now just the same as close();

- in PersistenceSession, split out calling of __isis_startRequest/__isis_postConstruct and then __isis_preDestroy/__isis_endRequest into two loops, just so easier to move around if need be.  (Currently, calling one after the other, so no functional change here).

Also:

- no longer allow the ProgrammingModel to be overridden (in IsisComponentProviderDefault, IsisComponentProviderDefault2, IsisSystemForTest, IsisMojoAbstract)

- reformatted IsisSystemForTest (comments), also WebRequestCycleForIsis

- ServiceInitializer, introduced constructor for state (rather than pass into validate(...)); updated IsisSystem correspondingly

- removed unused method in DeploymentType

Show less

master + 32 more