Learn some of Shark's understanding

xiaoxiao2021-03-06  84

1. Regarding the memory of its API, why not in a whole SRC directory, but a lot of separate directories

It is now looking that in order to store these large API slots, it is used to indicate which part of the API is used where the user is used, such as the API directory provides users with programmable Interface, CORBA-related services.

2, frequent use of Adapter mode in Shark

In Shark's design ideas, I understand is based on a Meta-Data Framework framework, which is a conceptual model, and there are some things that are not exactly the same as the concept model, so the author writes a concept model, and implementation. Model, then bond these two parts with Adapter mode, which is a large number of XXXXIMPL classes, the reason for the XXXXWraper class in the Shark model. (For details, please refer to my other article Shark concept model and implementation model)

3, how to use the API to call the Shark engine

First, you need to introduce all JARs under Shark's lib into the classpath of this project (it seems that the hibernate package is missing in the original package, you can download the corresponding),

Then use the SRC in the modules directory so that you can combine the source files in each separate directory, copy all search results to a directory SRC, introduced into JB or Eclipse, compile, you can easily see SHARK source code.

Mainly use org.enhydra.shark.api.client packages.

1: Shark.configure (), generally need to specify its Shark.conf position, which is mainly configured by SharkenGineManager, and you can extend Shark's framework, use your own Manager class to achieve special features, After completing, write in a Shark.conf configuration file.

2: Shark.GetInstance (), return a SHARKINTERFACE instance

Since then, you need to decide to get a task that is assigned to the SHARK server (requires the server to run) or get an admininterFace to manage users, groups, packages.

For example, check the implementation code of several agent projects:

Shark.configure ("Shark.conf");

Sharkinterface Si = Shark.getInstance ();

SharkConnection sc = si.getsharkconnection ();

Try {

Sc.Connect ("Leo", "L", "Shark", "");

System.out.println ("You have" sc.getResourceObject (). How_many_work_item () "task");

} catch (exception e) {

E.PrintStackTrace ();

}

转载请注明原文地址:https://www.9cbs.com/read-108520.html

New Post(0)