Skip navigation links
oracle.adfmf.application
Interface LifeCycleListener
-
public interface LifeCycleListener
The application life cycle listener provides the basic structure for developers needing to include their own functionality during the different stages of the application life cycle. Please note that there is no user associated with any of the following methods.
Common examples of functionality that might be added:
start:
- determine if the application has updates
- determine if there already exists a local application database image
- setup any one time state for the application
activate:
- read any application cache stores and re-populate state (if needed)
- establish/re-establish any database connections and cursors
- process any pending web-service requests
- obtain any required resources
deactivate:
- write any restorable state to an application cache store
- close any database cursors and connections
- defer any pending web-service requests
- release held resources
stop:
- logoff any remote services
NOTE:
- In order for the system to recognize an application life cycle listener it must be registered in the adfmf-application.xml file.
- Application assemblers must implement this interface if they would like to receive notification of application start, hibernation, and application resume.
- If a secure web service is need, you will need to do this from your 'default' feature where you will have an associated user.
- See Also:
LifeCycleListener
Method Summary |
void |
activate()
The activate method will be called when the application is started (post the start method) and when an application is resumed by the operating system. |
void |
deactivate()
The deactivate method will be called as part of the application shutdown process or when the application is being deactivated/hibernated by the operating system. |
void |
start()
The start method will be called at the start of the application. |
void |
stop()
The stop method will be called at the termination of the application. |
start
void start()
- The start method will be called at the start of the application.
NOTE:
- This is a blocking call and will freeze the user interface while the method is being executed. If you have any longer running items you should create a background thread and do the work there.
- Only the application controller's classes will be available in this method.
- At this stage, only an anonymous user is associated with the application so do not attempt to call any secure web services in this method.
stop
void stop()
- The stop method will be called at the termination of the application.
NOTE:
- Depending on how the application is being shutdown, this method may or may not be called. For example, if a user kills the Application from the iOS multitask UI then stop will not be called. Because of this, each feature should save off their state in the deactivate handler.
- Only the application controller's classes will be available in this method.
- At this stage, only an anonymous user is associated with the application so do not attempt to call any secure web services in this method.
activate
void activate()
- The activate method will be called when the application is started (post the start method) and when an application is resumed by the operating system. If the application supports checkpointing, this is a place where the application should read the checkpoint information and resume the process.
NOTE:
- This is a blocking call and will freeze the user interface while the method is being executed. If you have any longer running items you should create a background thread and do the work there.
- Only the application controller's classes will be available in this method.
- At this stage, only an anonymous user is associated with the application so do not attempt to call any secure web services in this method.
- Once an application is activated, the visible feature's activate lifecycle method will be executed (if configured) post this method being called.
-
- See Also:
oracle.adfmf.feature.LifeCycleListener.activate()
deactivate
void deactivate()
- The deactivate method will be called as part of the application shutdown process or when the application is being deactivated/hibernated by the operating system. This is the place where application developers would write application checkpoint information in either a database or a "device only" file so if the application is terminated while in the background the application can resume the process when the application is reactivated.
NOTE:
- This is a blocking call and will freeze the user interface while the method is being executed. If you have any longer running items you should create a background thread and do the work there.
- Only the application controller's classes will be available in this method.
- At this stage, only an anonymous user is associated with the application so do not attempt to call any secure web services in this method.
- When an application is being deactivated, the visible feature's deactivate lifecycle method will be executed (if configured) prior to this method being called.
-
- See Also:
oracle.adfmf.feature.LifeCycleListener.deactivate()
Skip navigation links
Copyright © 2012, 2013 Oracle. All Rights Reserved.