Embodiment
Below in conjunction with accompanying drawing and embodiment the present invention is described in further detail: as seen: find all component automatically: comprise rule/flow system assembly, M other system component and N standard package by the center driven disposal system by Fig. 1, Fig. 2, Fig. 3; Described M, N are positive integers 1; Have special life cycle, system component started automatically after core started during operation, and system component was closed automatically when core was closed during operation, and core must restart when system component upgraded the back operation;
Load and initialization rule/flow system assembly, and create-rule/flow process storehouse 2;
Load and initialization M other system component and N standard package 3;
M other system component and N standard package are sent registered events message 4 to rule/flow system assembly respectively; Described registered events message is made up of two parts, and a part is an Event Description; Another part is executing rule or flow process; For example---" if standard package is unusual, just write abnormal log earlier, report an error again." this incident is after registration, rule/flow system assembly writes " standard package is unusual " to event base earlier, writes " write abnormal log, report an error " to rule/flow process storehouse again;
Rule/flow system assembly adds event base 5 after with message sequence;
The assembly more than two or two in M other system component and N standard package is after center driven disposal system transmission services request, and described center driven disposal system can handle 6 according to event base and rule/flow process storehouse;
By rule/flow system assembly to service requester feedback information needed 7; Described feedback information needed: if standard package is unusual, the center driven disposal system hands over rule/flow system assembly to mate anomalous event, rule/flow system assembly searched events storehouse, find " standard package is unusual " incident, matched rule/flow process in rule/flow process storehouse---" write abnormal log, report an error " then, this message is returned the center driven disposal system, call corresponding assembly by the center driven disposal system and finish " write abnormal log, report an error "; Because registered one group of service interface object that the service object is relevant with a group to the center driven disposal system when assembly starts, so the center driven disposal system can know that calling which assembly comes processing rule/flow process;
Described each assembly or center driven disposal system are when other assembly or center driven disposal system are sent services request, can realize by following state in the time of can carrying out this group job of services request: wait---indicate modulated degree job run, but its off-duty still; Moving---the indication operation moves; Just in dormancy---the indication operation is because sleep request or dispatch it and just move after through certain delay and just in dormancy; Do not have---the indication operation is not in wait, operation or dormancy; But when having created operation not dispatched it as yet, operation will be in this state; After operation is finished operation or has been cancelled, it also will be in this state 11;
In the step 6,7: when needs were visited and handled same object, described object was awarded the agreement to the exclusive reference of shared object;
Core (being called the center driven disposal system again) when principal feature of the present invention is embodied in based on a small efficiently operation, expand various plug-in units flexibly, be combined into various systems longitudinally, and be aided with rule/flow engine and other system component, the various application of horizontal composition.
When native system starts, core operation earlier during operation, core is found all component automatically when moving subsequently, and loading system assembly at first; When all system component loads and after initialization finishes, system loads and initialization standard package; When all component loads and after initialization finished, vertical combination of system was finished; Any assembly can be to other component passes message, and for example standard package G can send registered events message to rule/flow system assembly, and rule/flow system assembly adds event base after with message sequence; The rest may be inferred, and system promptly finishes horizontal combination.Initialization of the present invention this moment is finished, any assembly (for example assembly G) can send services request, after corresponding assembly (for example rule/flow system assembly) is received services request, can according to corresponding configuration (for example event base and rule/flow process storehouse) handle and generate the service feedback information and, reply to the requestor by corresponding assembly (for example rule/flow system assembly).
Each assembly among the present invention all is the component object of a standard, the life cycle that they can manage them by an administration agent.
Each assembly all must be one of following state:
● loading---assembly is by the state after successfully installing;
● ready---assembly initialization finishes, and can enter the state of starting or stoping;
● starting---assembly enters starting state, starts attribute and is activated;
● stopping---assembly is out of service;
● activating---assembly starts successfully, enters operational mode;
● unloading---assembly is excluded from system.
After at first core starts when operation, the assembly that the automatic discovery of its meeting will be loaded, and handle component is set as loading condition; Successfully just change ready state automatically over to if assembly loads, if having unusually, core just triggers anomalous event during operation, and handle component changes unloaded state over to; If having unusual is system component, core just triggers anomalous event during operation, and writing daily record unusually, core withdraws from unusually during operation; Ready assembly can make it enter unloaded state, upgrade and reload later on or starting state (after the system component renewal, core must restart during operation) by Event triggered at any time; Core can activate it automatically during assembly operating after the startup; The assembly that activates can make it stop (system component can not be stopped) by Event triggered; Core is set to ready state to it automatically during assembly operating after stopping.
Core kept communicating by letter when assembly passed through the assembly context object with operation; The assembly context object by when operation core when assembly starts, create.Can not the transmitting assembly context object between the assembly, they are privately owned.After assembly stops, the assembly context object can not be accessed, if attempt to visit a context object that is stopped assembly, core will be dished out unusually during operation.
Each assembly all can provide one group of co-operating service, and the developer of an assembly provides one group of service interface object that the service object is relevant with a group.The service object of assembly core registration oneself when operation will have a service registry object after the registration, each service registry object all comprises one or more service objects.Core allows the dynamic registration and unregistration service object of assembly during operation, each registration service object, and core all will be made corresponding License Check during operation, to guarantee service object's legitimacy.
Can call the service object who has registered by the context object of assembly, and obtain service by the service object.
Can service be configured by service object's configuration attribute.
Incident of the present invention mainly is divided three classes:
● Service events---report service object's incidents such as registration, unloading and attribute change;
● assembly incident---incidents such as reporting component state change;
● core event---the state of report core, abnormality warnings, incident such as make mistakes.
The present invention finds incident by a listening components, by log component (or other self-defined assembly) recording events.
When assembly sends services request, the assembly that accepts request can be carried out services request, and this is to produce a group job, this group job be exactly one group can asynchronous execution the working cell.
When carrying out service, assembly will be created operation, dispatch it then.In case dispatched operation, the job queue of hard core control in the time of it will being added into by operation.Core uses the backstage scheduling thread to manage all pending operations during operation.When the operation of operation is finished, will from formation, remove it, which operation will be core will determine next to move during operation.When operation became active state, core will be called operation method to it during operation.
If dispatched an operation, decision no longer needs it again then, then can use the method for abandoning to stop this operation.If cancellation during operation this operation do not bring into operation as yet, then can abandon immediately and can bootup window.On the other hand, if operation brings into operation, then will decide it whether to want echo canceling by operation.When attempting the cancellation operation, use method of attachment to wait for the cancellation operation.Than the light slightly method of cancellation operational degree is the sleep method.For the method, if operation does not bring into operation as yet, then the method will cause this operation to be hung up by indefinite duration.Core will still be remembered this operation during operation, and awakening method calls and will this operation be added into waiting list, finally still will carry out this operation.
Operation will be experienced several states in its life cycle.Not only can be by waiting and handle it such as abandoning method and sleep method, and in the platform operation with when finishing this operation, its state also can be changed.Operation can be experienced following state:
● wait for---indicate modulated degree job run, but its off-duty still.
● moving---the indication operation moves.
● just in dormancy---the indication operation is because sleep request or dispatch it and just move after through certain delay and just in dormancy.
● do not have---the indication operation is not in wait, operation or dormancy.But when having created operation not dispatched it as yet, operation will be in this state.After operation is finished operation or has been cancelled, it also will be in this state.
If the current waiting status that is in of operation then can only place dormant state with it.The operation that just wakes up in dormancy will make it come back to waiting status.To make it turn back to stateless during the cancellation operation.
Job priority can be used for determining the importance of an operation with respect to other operation in the system.The priority that operation is set will not influence the operation in operation, but it can influence the operation the waited for dispatching sequence with respect to other operation.The priority of operation can be one of them of predefined several priority constants:
● moment operation---operation has precedence over other operation usually.They should be the operations of short time operation or less use processor, and therefore, they can not hinder other job run moment.
● short operation---operation can be finished in a second usually, but also may the time a little long a little.They are at running background, and have precedence over the All Jobs except the moment operation.
● long operation---the background job of longer time operation is represented in operation.They are just operation after moment operation and short operation have moved only.
● making up operation---the operation that is associated with the structure task is represented in operation.They are lower than the priority of long operation.Make up only just operation after all long operations are finished of operation.
● operation---the priority of operation in system is minimum in modification.But those tasks of providing the information user that can help the replenish user interface can not wait for usually are provided for they.
The default priorities of operation is long operation.
Can when schedule job, specify dispatch delay.Before schedule job, operation will postpone the millisecond number of appointment.Scheduling wait for or the operation of dormancy without any effect.But scheduling reschedules it after the operation of operation will cause finishing this operation.If operation is repeatedly rescheduled when operation, then it will only reschedule once according to the delay that provides recently.
A plurality of operations among the present invention might need visit and handle same object.The present invention's definition is used to authorize the agreement to the exclusive reference of shared object.When operation need be visited shared object, it can obtain the locking to this object.When it handled this object, it will discharge this locking.
Suppose " operation A " acquisition " locking A ", attempt obtaining " locking B " subsequently.Simultaneously, " locking B " quilt " operation B " hung up, and " operation B " got clogged now, and it waits for " locking A ".This situation is deadlock, is illustrated in to have the bottom-layer design problem when using locking between the operation.Core will help to find deadlock during operation.When the operation manager detected deadlock situation, it will be presented at diagnostic message in the daily record, and can describe deadlock situation.Then, it removes deadlock by the following method: the access right of the locking that will have the operation that gets clogged is authorized to other operation of waiting for these lockings temporarily.
Rule/flow system assembly is an important system assembly of finishing horizontal combination in the native system.Owing to itself be exactly assembly, as long as so its implementation meet above-mentioned component object definition, can select different instruments self-defined with system requirements.
Incident and rule/flow process storehouse selects for use the XML standard to be described, and the user can be self-defined as required.The user can work out self-defining XML resolution component and be articulated on when operation product platform, comes parsing incident and rule/flow process storehouse.
After standard package A transmission event registration information was to rule/flow system assembly, rule/flow system assembly was registered the incoming event storehouse with event information.When Event triggered, rule/flow system assembly mates according to the information in event base and rule/flow process storehouse, and matching result is returned to standard package A.
So just can change the logical relation between the assembly at any time by Configuration events and rule/flow process storehouse, thus the purpose that reaches flexible configuration, freely expands.