
Classes | |
| class | Observer |
Public Member Functions | |
| void | didFinishInitialization () |
| ERXFrameworkPrincipal () | |
| abstract void | finishInitialization () |
| static< T extends ERXFrameworkPrincipal > T | sharedInstance (Class< T > c) |
| String | toString () |
Static Public Member Functions | |
| static void | setUpFrameworkPrincipalClass (Class c) |
Protected Member Functions | |
| void | initialize () |
Protected Attributes | |
| final Logger | log = Logger.getLogger(getClass()) |
Static Protected Attributes | |
| static final NSMutableDictionary | initializedFrameworks = new NSMutableDictionary() |
| static final NSMutableArray | launchingFrameworks = new NSMutableArray() |
Static Private Attributes | |
| static Observer | observer |
initialize() method will be called directly after your principal is instantiated.finishInitialization() method will be called when the app finishes startup but before it will begin to process requests.If you define
public static Class[] REQUIRES = Class[] {...} all the classes (which must be assignable from this class) will get loaded before your principal.
NOTE: try to avoid putting code in static initializers. These may lead to unpredictable behaviour when launching. Use one of the methods above to do what you need to do.
Here is an example:
public class ExampleFrameworkPrincipal extends ERXFrameworkPrincipal {
public static final Logger log = Logger.getLogger(ExampleFrameworkPrincipal.class);
protected static ExampleFrameworkPrincipal sharedInstance;
public final static Class REQUIRES[] = new Class[] {ERXExtensions.class, ERDirectToWeb.class, ERJavaMail.class};
// Registers the class as the framework principal
static {
setUpFrameworkPrincipalClass(ExampleFrameworkPrincipal.class);
}
public static ExampleFrameworkPrincipal sharedInstance() {
if (sharedInstance == null) {
sharedInstance = (ExampleFrameworkPrincipal)sharedInstance(ExampleFrameworkPrincipal.class);
}
return sharedInstance;
}
public void initialize() {
// code during startup
}
public void finishInitialization() {
// Initialized shared data
}
}
| void didFinishInitialization | ( | ) |
Overridden by subclasses to finalize framework initialization.
Reimplemented in BTBusinessLogic.
| abstract void finishInitialization | ( | ) | [pure virtual] |
Overridden by subclasses to provide framework initialization.
Implemented in Ajax, ERIUI, GCGoogleChart, BTBusinessLogic, ERAttachmentPrincipal, ERCoreBusinessLogic, ERMoviesLogic, ERTaggablePrincipal, ERDirectToWeb, ERXExtensions, ERJavaMail, ERPrototypes, ERCaching, ERIndexing, ERDirectToRest, EROpenID, ERSelenium, and ERPlot.
| void initialize | ( | ) | [protected] |
Called directly after the contructor.
Reimplemented in ERXExtensions.
| static void setUpFrameworkPrincipalClass | ( | Class | c | ) | [static] |
Sets up a given framework principal class to recieve notification when it is safe for the framework to be initialized.
| c | principal class |
| static<T extends ERXFrameworkPrincipal> T sharedInstance | ( | Class< T > | c | ) |
Gets the shared framework principal instance for a given class.
| c | principal class for a given framework |
| String toString | ( | ) |
final NSMutableDictionary initializedFrameworks = new NSMutableDictionary() [static, protected] |
holds the mapping between framework principals classes and ERXFrameworkPrincipal objects
final NSMutableArray launchingFrameworks = new NSMutableArray() [static, protected] |
final Logger log = Logger.getLogger(getClass()) [protected] |
logging support
Reimplemented in Ajax, ERCoreBusinessLogic, ERDirectToWeb, ERJavaMail, ERCaching, ERIndexing, and ERPlot.
1.5.8