Org.enhydra.shark.sharkengineManager
SharkengineManager is the SHARK engine control room, which is used inside the Shark engine, and all managers of the Shark engine are generated by it.
SharkenGineManager uses the Singleton mode to ensure that only one of its instance throughout the system.
// the one and only instance of this class
Private static sharkenginemanageManager;
STATIC SharkengineManager getInstance () {
IF (EngineManager == NULL) {
EngineManager = New SharkenGineManager ();
}
Return EngineManager;
}
The role of all the Get () methods of SharkengineManager is an instantiated manager when it is initialized. These managers are also Singleton, so that through a class, the Singleton mode of infinite class is implemented, which can be drawn on our usual system. .
When the system starts, Shark.conf () will be called, and the SHARKENGINEMANAGER's INIT (Properties Properties) method will be called, which is as follows:
Void Init (Properties Properties) {
String ObjectFactoryClassName = Properties.getProperty
("ObjectFactoryClassName",
"org.enhydra.shark.sharkObjectFactory";
String amclassname = property.getproperty
("AssignmentManagerClassName);
..........
}
As shown above, first read ObjectFactoryClassName from Properties, if there is, use the configuration file; if not, use org.enhydra.shark.sharkObjectFactory. AssignmentManagerClassName is also read from the configuration file.
The next step in INIT () is to instantiate each manager with a read configuration or by default configuration, and use it directly when running, as follows:
Try {
Callbackutilities = (Callbackutil) cl.loadclass (cbuclassname) .newinstance ();
Callbackutilities.SetProperties (Properties);
ObjectFactory = (SharkObjectFactory) Cl.loadClass (ObjectFactoryClassName) .newinstance ();
ToolagentManager = (ToolAgentManager) cl.loadclass (tamclassname) .newinstance ();
Xmlinterface = new xmlinterfaceforjdk13 ();
} catch (throwable ex) {
Throw New Error ("Problems Instantiating Core Managers");
}
Of course, it is all interfaces, so we can easily expand it, just write your own class inherit these interfaces, and then configure it in the configuration file, you can do its code to achieve the purpose of expanding its code. HONGBO781202, also known as hongsoft, professional programmer, research area: 1) Based on workflow 2) Java-based information security
Technology. Http://blog.9cbs.net/hongbo781202/
HONGBOSoftware@163.com