Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Real World State And Notification Broker
1. Real World State and Notification Broker Michele Locuratolo In collaborazione con
2. Agenda What is the State and Notification Broker Reading a System State Reacting to changes Application launcher
3. What is the State and Notification Broker: Il a set of API which allow developers to: Monitoring the System State in managed code: We have more then 100 states exposed React on system state changes Create custom states
4. Now we have: A consistent model to access and manage the system states No P/Invoke! 100% Managed code! A lot of states exposed (more then 100)
11. Behind the scenes: The Windows Mobile Registry is the central repository: SystemState: for the predefined states RegistryState: for the custom state
12. Creating your own state: Crate an instance of the RegistryState Class React to the changes like the classic SystemState
14. Application Launcher Start an application when a monitored state changes StateBase implements IApplicationLaucher interface The IApplicationLaucher has the capability to start an application Information about the application to start are stored in the Registry
16. Remarks You can start directly when a state changes… SystemStatemonitoredState = newSystemState(SystemProperty.PowerBatteryBackupStrength); monitoredState.EnableApplicationLauncher("MyCoolApp"); …or when a state arrives to a specified value SystemStatemonitoredState = new SystemState(SystemProperty.PowerBatteryBackupStrength); monitoredState.ComparisonType = StatusComparisonType.Less; monitoredState.ComparisonValue = BatteryLevel.Low; monitoredState.EnableApplicationLauncher("MyCoolApp"); The second application is not running before the state value doesn’t match with the criteria
17. In conclusion…. Windows Mobile exposes more then 100 different states When you need to interact with any kind of system notifications, check the System States You can create your own state Use the S&N API to produce a better software Check out this open source application which uses this APIs http://www.codeplex.com/MobilePhoneAssistant