Interface Session
- All Known Subinterfaces:
SessionExt
- All Known Implementing Classes:
BasicSession
public interface Session
An interface that encapsulates all properties required to run tests.
It's introduced to make it possible to get rid of such monsters as
InterviewParameters, Template and WorkDir.
It's assumed that components will communicate Session via Update and Event classes: those components which are aware how to modify the config will apply some Update object to the config, the config in its turn will send to all registered observers the corresponding Event object. Important note: JavaTest is not ready yet to operate with Session instances, therefore one should implement the SessionExt interface or extends BasicSession class to provide its own behavior.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceRoot interface for all events happened when state of Session changed.static classException signaling of the problem happened while dealing with Session.static interfaceInterface for observers of the Session state.static interfaceRoot interface for all updates to Session. -
Method Summary
Modifier and TypeMethodDescriptionvoidRegisters the observer.voiddispose()Disposes configuration.Data required to execute tests.Returns the config property namesbooleanisReady()voidDelivers events to the all registered observersvoidUnregisters the observer.voidRestores the config state from the mapvoidSaves the config state to the mapvoidMethod to be invoked from outside to change the state of the Session.voidupdate(Session.Update u, boolean updateConfig) Method to be invoked from outside to change the state of the Session.
-
Method Details
-
update
Method to be invoked from outside to change the state of the Session.- Parameters:
u- - object encapsulating data describing the change.- Throws:
Session.Fault- in case of any problem
-
update
Method to be invoked from outside to change the state of the Session.- Parameters:
u- - object encapsulating data describing the change.updateConfig- - hint whether to reload the configuration from disk- Throws:
Session.Fault- in case of any problem- Since:
- 4.4.1
-
addObserver
Registers the observer. Does nothing if the observer is null or already registered.- Parameters:
obs- - observer
-
removeObserver
Unregisters the observer. Does nothing if the observer is null or not registered.- Parameters:
obs- - observer
-
notifyObservers
Delivers events to the all registered observers- Parameters:
evn- - event to be sent out.
-
save
-
restore
Restores the config state from the map- Parameters:
map-- Throws:
Session.Fault
-
dispose
void dispose()Disposes configuration. Critical when heavy objects were used. -
getPropertyNames
-
getValue
- Returns:
- the value of property or null if unset
- Throws:
IllegalArgumentException- if case of unknown name- See Also:
-
isReady
boolean isReady()- Returns:
- true if configuration is ready for test execution
-
getParameters
Parameters getParameters()Data required to execute tests. In future - should be replaced.- Returns:
- The current parameters in use.
-