Object session1 = new Object();
workContext.setIdentifier(HttpSessionScopeContainer.HTTP_IDENTIFIER, session1);
scope.onEvent(new HttpSessionStart(this, session1));
final OutboundWire wire = getWire(scope);
Target service = (Target) wireService.createProxy(wire);
Target target = (Target) wireService.createProxy(wire);
assertNotNull(service);
service.setString("foo");
assertEquals("foo", service.getString());
assertEquals("foo", target.getString());
workContext.clearIdentifier(HttpSessionScopeContainer.HTTP_IDENTIFIER);
//second session
Object session2 = new Object();
workContext.setIdentifier(HttpSessionScopeContainer.HTTP_IDENTIFIER, session2);
scope.onEvent(new HttpSessionStart(this, session2));
Target service2 = (Target) wireService.createProxy(wire);
assertNotNull(service2);
assertNull(service2.getString());
Target target2 = (Target) wireService.createProxy(wire);
service2.setString("bar");
assertEquals("bar", service2.getString());
assertEquals("bar", target2.getString());
scope.onEvent(new HttpSessionEnd(this, session2));
workContext.clearIdentifier(HttpSessionScopeContainer.HTTP_IDENTIFIER);
workContext.setIdentifier(HttpSessionScopeContainer.HTTP_IDENTIFIER, session1);