Created
May 11, 2010 02:46
-
-
Save brian428/396855 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.swizframework.quickswiz.controller | |
{ | |
import org.swizframework.quickswiz.service.UserService; | |
public class UserController | |
{ | |
[Inject] | |
public var userService : UserService; | |
[PostConstruct] | |
/** | |
* [PostConstruct] methods are invoked after all dependencies are injected. | |
*/ | |
public function createDefaultUser() : void | |
{ | |
userService.loadDefaultUser(); | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.swizframework.quickswiz.controller | |
{ | |
import org.swizframework.quickswiz.service.UserService; | |
public class UserController | |
{ | |
[Inject] | |
public var userService : UserService; | |
[PreDestroy] | |
/** | |
* [PreDestroy] methods are invoked when a bean is destroyed. | |
*/ | |
public function clearPollingTimer() : void | |
{ | |
userService.stopPolling(); | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Dispatcher] | |
public var dispatcher : IEventDispatcher; | |
private function createNewBean() : void | |
{ | |
userModel : UserModel = new UserModel(); | |
// Swiz will create a bean for the userModel, and process any metadata in it. | |
dispatcher.dispatchEvent( new BeanEvent( BeanEvent.SET_UP_BEAN, userModel ) ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function destroyBean() : void | |
{ | |
// Swiz will destroy the userModel bean, clean up any injected objects, and delete any injection bindings. | |
dispatcher.dispatchEvent( new BeanEvent( BeanEvent.TEAR_DOWN_BEAN, userModel ) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment