How to use Shark
The article written in front of two SHARK source code analysis, but there are many peers to discuss how to use Shark, so this article first uses Shark's source code to discuss how to use Shark.
SHARK has two ways: as a CORBA service and calling the API. In fact, after we installing the Shark installation version, there are multiple batch files in the root directory, where runall.bat is started as a CORBA service, and Runsa is called an API as follows:
Runall.bat is as follows
{@Echo off
CD D: / Program Files / Shark-1.0
Find "NameserverHost"
FOR / F "tokens = 1, 2 * delims ==" %% I in (nshost.txt) do set ns_host = %% J
Del
NSHOST.TXT> NUL
Find "Nameserverport"
FOR / F "tokens = 1, 2 * delims ==" %% I in (nsport.txt) do set ns_port = %% j
Del
NSport.txt> NUL
Set OldClassPath =% ClassPath%
SET CLASSPATH =
// Start the name service
Start "Name Server" "D: /J2SDK1.4.2/bin/tnameserv" -orbinitialport 10123
// Start Shark Server
Start "Shark Server" "D: /J2SDK1.4.2/bin/java" -djava.ext.dirs = lib org.enhydra.shark.corba.sharkcorbaser loading.conf
// Start the management console
START "Shark Admin" "D: /J2SDK1.4.2/bin/java" -jar lib / sharkcorbaadmin.jar
Set classpath =% OldClassPath%
}
Runsa.bat is as follows:
{
@echo off
CD D: / Program Files / Shark-1.0
Set OldClassPath =% ClassPath%
SET CLASSPATH =
START "Shark Admin" "D: /J2SDK1.4.2/bin/java" -djava.ext.dirs = lib org.enhydra.shark.swingclient.workflowadmin.sharkadmin
Set classpath =% OldClassPath%
}
Source Code Analysis The Shark class represents the Shark engine, so it only needs to be configured, the code is as follows:
// the one and only instance of this class
Private static sad shark;
STATIC {
Shark = new shark ();
}
Public static shark getInstance () {
IF (! isconfigured) {
Throw New Error ("Shark Need to Be Configured Properly !!!");
}
Return Shark;
}
From the above code, Shark.conf () simply calls once; then you can get Shark.GetInstance () every time you access Shark.GetInstance (). After the server DOWN is turned off, you should call Shark.conf () again; but the LOAD function for the XPDL file is the system Persistence, which will be saved to the database, so general to the XPDL process, we do WEB page, upload, modify, and download, etc., even if the server Down is dropped, no LOAD process is required.
Processing to XPDL is the issue of our next article to be discussed.
Author's name HONGSOFT, research area: 1) Research Based on Workflow 2) Based on Java-based information security technology. Welcome to discuss Java-related issues hongbosoftware@163.com