|
Project Wonder 5.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecter.extensions.ERXFrameworkPrincipal
public abstract class ERXFrameworkPrincipal
Designated starter class for frameworks, adds support for dependency management.
Allows you to disregard your framework order in the class path (at least where
startup is concerned, if you override actual classes you still need to take care.)
The initialize()
method will be called directly after your principal
is instantiated.
The 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.
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
}
}
Nested Class Summary | |
---|---|
static class |
ERXFrameworkPrincipal.Observer
|
Field Summary | |
---|---|
protected static com.webobjects.foundation.NSMutableDictionary |
initializedFrameworks
holds the mapping between framework principals classes and ERXFrameworkPrincipal objects |
protected static com.webobjects.foundation.NSMutableArray |
launchingFrameworks
|
protected org.apache.log4j.Logger |
log
logging support |
Constructor Summary | |
---|---|
ERXFrameworkPrincipal()
|
Method Summary | ||
---|---|---|
void |
didFinishInitialization()
Overridden by subclasses to finalize framework initialization. |
|
abstract void |
finishInitialization()
Overridden by subclasses to provide framework initialization. |
|
protected void |
initialize()
Called directly after the contructor. |
|
static void |
setUpFrameworkPrincipalClass(java.lang.Class c)
Sets up a given framework principal class to recieve notification when it is safe for the framework to be initialized. |
|
static
|
sharedInstance(java.lang.Class<T> c)
Gets the shared framework principal instance for a given class. |
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final org.apache.log4j.Logger log
protected static final com.webobjects.foundation.NSMutableDictionary initializedFrameworks
protected static final com.webobjects.foundation.NSMutableArray launchingFrameworks
Constructor Detail |
---|
public ERXFrameworkPrincipal()
Method Detail |
---|
public static <T extends ERXFrameworkPrincipal> T sharedInstance(java.lang.Class<T> c)
c
- principal class for a given framework
public static void setUpFrameworkPrincipalClass(java.lang.Class c)
c
- principal classprotected void initialize()
public abstract void finishInitialization()
public void didFinishInitialization()
public java.lang.String toString()
toString
in class java.lang.Object
|
Last updated: Tue, Feb 21, 2017 05:45 PM CET | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |