CN109683992A - Method and apparatus for managing object - Google Patents
Method and apparatus for managing object Download PDFInfo
- Publication number
- CN109683992A CN109683992A CN201710971306.5A CN201710971306A CN109683992A CN 109683992 A CN109683992 A CN 109683992A CN 201710971306 A CN201710971306 A CN 201710971306A CN 109683992 A CN109683992 A CN 109683992A
- Authority
- CN
- China
- Prior art keywords
- called
- target control
- broker
- inversion container
- control inversion
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Landscapes
- Stored Programmes (AREA)
Abstract
The embodiment of the present application discloses the method and apparatus for managing object.One specific embodiment of this method includes: during the starting of target control inversion container, instantiation creation object broker is carried out by the class to object broker, target control inversion container is for storing object broker and object, and object broker is for the object in management objectives control inversion container;After the starting of target control inversion container, in response to receiving object reference request, determined in target control inversion container by object broker with the presence or absence of called object;And it is not present in response to called object, called object is created by object broker.The embodiment reduces the maintenance cost of target inversion container.
Description
Technical field
The invention relates to field of computer technology, and in particular to Internet technical field is more particularly, to managed
The method and apparatus for managing object.
Background technique
Spring is the Java Development Framework an of lightweight, for solving the complexity of enterprise's application and development.Spring
Control reversion (Inversion of Control, the IOC) container of offer is using dependence injection (Dependency
Injection, DI) mode the use of the creation of Java object and Java object is mutually separated so that using height may be implemented
The modularization and serviceization of degree, are widely used in the exploitation of Web application.
In general, the statement for the object being injected into control inversion container depends on static compilation, for example, passing through configuration file
Or the mode of note (Annotation) states injection object.
Summary of the invention
The purpose of the embodiment of the present application is to propose a kind of method and apparatus for managing object.
In a first aspect, the embodiment of the present application provides a kind of method for managing object, this method comprises: in target control
During inversion container starting processed, instantiation creation object broker, target control inversion container are carried out by the class to object broker
For storing object broker and object, object broker is for the object in management objectives control inversion container;It is anti-in target control
After turning container starting, in response to receiving object reference request, being determined in target control inversion container by object broker is
It is no to there is called object, and be not present in response to called object, called object is created by object broker.
In some embodiments, it is not present in response to called object and called object is created by object broker, comprising:
Exist in response to the class file for the object that is called, the Classloader of inversion container, load are controlled by object broker invocation target
The class file of called object creates called object.
In some embodiments, it is not present in response to called object and called object is created by object broker, comprising:
It is not present in response to the class file for the object that is called, downloads the class file of called object;Pass through object broker invocation target control
The Classloader of inversion container processed loads downloaded class file, creates called object.
In some embodiments, method further include: exist in response to called object and occupied, pass through object broker
Increase the quantity of called object.
In some embodiments, method further include: after the starting of target control inversion container, in response to receiving object
Modification request, parsing object modification request to pass through object to obtain the parameter to be modified of object to be modified and parameter value to be modified
The value of the parameter to be modified of object to be modified is set parameter value to be modified by agency.
In some embodiments, method further include: after the starting of target control inversion container, by object broker with pre-
Fixed time interval scanning target control inversion container is to obtain the object set and each object in target control inversion container
Recalls information, determine the load of target control inversion container;And it is greater than threshold in response to the load of target control inversion container
Value load, the recalls information based on object set and each object destroy pair that maximum duration is not called upon by object broker
As.
Second aspect, the embodiment of the present application provide a kind of for managing the device of object, which includes: that initialization is single
Member is configured to starting target control inversion container and carries out instantiation creation object broker by the class to object broker,
In, target control inversion container is for storing object broker and object, and object broker is in management objectives control inversion container
Object;Object Creation unit is configured to after target control inversion container starts, asks in response to receiving object reference
It asks, is determined by object broker with the presence or absence of called object in target control inversion container, and in response to the object that is called
It is not present, called object is created by object broker.
In some embodiments, Object Creation unit includes: the first instantiation module, is configured in response to called pair
The class file of elephant exists, and the Classloader of inversion container is controlled by object broker invocation target, loads the class of called object
File creates called object.
In some embodiments, Object Creation unit further include: download module is configured in response to the object that is called
Class file is not present, and downloads the class file of called object;Second instantiation module, is configured to object broker and calls mesh
The Classloader of mark control inversion container, loads downloaded class file, creates called object.
In some embodiments, device further include: object adding unit is configured to exist simultaneously in response to called object
And it is occupied, increase the quantity of called object by object broker.
In some embodiments, device further include: object updating unit is configured to start in target control inversion container
Later, in response to receive object modification request, parsing object modification request with obtain object to be modified parameter to be modified and
Parameter value to be modified sets parameter value to be modified for the value of the parameter to be modified of object to be modified by object broker.
In some embodiments, device further include: load determining unit is configured to start in target control inversion container
Later, target control inversion container is scanned at predetermined intervals by object broker to obtain in target control inversion container
Object set and each object recalls information, determine the load of target control inversion container;Object destroys unit, and configuration is used
In the load in response to target control inversion container greater than threshold load, the recalls information based on object set and each object,
The object that maximum duration is not called upon is destroyed by object broker.
The third aspect, the embodiment of the present application provide a kind of server, comprising: one or more processors;Storage device,
For storing one or more programs, when one or more programs are executed by one or more processors, so that one or more
Processor realizes the method such as any embodiment in the method for managing object.
Fourth aspect, the embodiment of the present application provide a kind of computer readable storage medium, are stored thereon with computer journey
Sequence realizes the method such as any embodiment in the method for managing object when the program is executed by processor.
Method and apparatus provided by the embodiments of the present application for managing object, by starting in target control inversion container
Period creates object broker, and is based on object reference request creation not by object broker after the starting of target control inversion container
The called object being injected into target control inversion container, can in the case where not restarting target inversion container Dynamic Maintenance
Object in target control inversion container, to reduce the maintenance cost of target inversion container.
Detailed description of the invention
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, the application's is other
Feature, objects and advantages will become more apparent upon:
Fig. 1 is that this application can be applied to exemplary system architecture figures therein;
Fig. 2 is the flow chart according to one embodiment of the method for managing object of the application;
Fig. 3 is the schematic diagram according to an application scenarios of the method for managing object of the application;
Fig. 4 is the structural schematic diagram according to one embodiment of the device for managing object of the application;
Fig. 5 is adapted for the structural schematic diagram for the computer system for realizing the server of the embodiment of the present application.
Specific embodiment
The application is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched
The specific embodiment stated is used only for explaining related invention, rather than the restriction to the invention.It also should be noted that in order to
Convenient for description, part relevant to related invention is illustrated only in attached drawing.
It should be noted that in the absence of conflict, the features in the embodiments and the embodiments of the present application can phase
Mutually combination.The application is described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
Fig. 1 is shown can be using the application for managing the method for object or the example of the device for managing object
Property system architecture 100.
As shown in Figure 1, system architecture 100 may include management server 101, terminal device 103 and network 102, terminal
Equipment 103 may include the target control inversion container 1031 for storing object broker 10311 and object 10312.Object generation
The example that reason 10311 can be the static statement during target control inversion container 1031 starts, is used for the control of dynamic management objectives
Object in inversion container processed.Network 102 between management server 101 and terminal device 103 to provide communication link
Medium.Network 102 may include various connection types, such as wired, wireless communication link or fiber optic cables etc..
User (for example, application developer or maintenance personnel) can be used terminal device 103 and pass through network 102 and management
The interaction of server 101, is sended and received message etc. according to scheduled agreement (for example, TR069 agreement etc.), is set with complete paired terminal
Standby 103 various operations, for example, automatically configuring, diagnosing, upgrading.
Management server 101 can be to provide the server of various management services, such as carry out automatically to terminal device 103
The Automatic Configuration Server of configuration.Automatic Configuration Server can carry out the data such as the service request received analyzing etc.
Reason, and based on processing result (for example, configuration information of terminal device 103 corresponding with user information) to terminal device 103 into
Row automatically configures.
Terminal device 103 can be various terminals electronic equipment, including but not limited to set-top box, router, smart phone,
Tablet computer, E-book reader, MP3 player (Moving Picture Experts Group Audio Layer III,
Dynamic image expert's compression standard audio level 3), MP4 (Moving Picture Experts Group Audio Layer
IV, dynamic image expert's compression standard audio level 4) player, pocket computer on knee and desktop computer etc..This
Outside, terminal device 103 is also possible to application end server, for example, front-end Web server etc..
It should be noted that for managing the method for object generally by terminal device 103 provided by the embodiment of the present application
It executes, correspondingly, the device for managing object is generally positioned in terminal device 103.
It should be understood that the number of terminal device, network in Fig. 1 and management server is only schematical.According to reality
It now needs, can have any number of management server, terminal device and network.
With continued reference to Fig. 2, the process of one embodiment of the method for managing object according to the application is shown
200.Method includes the following steps:
Step 201, during the starting of target control inversion container, instantiation creation pair is carried out by the class to object broker
As agency, target control inversion container is held for storing object broker and object, object broker for management objectives control reversion
Object in device.
In the present embodiment, the method for managing object runs electronic equipment thereon (for example, end shown in FIG. 1
End equipment 103) it can star target control inversion container, and to object broker during the starting of target control inversion container
Class carries out instantiation to obtain object broker, wherein instantiating to the class of object broker can be by configuration file, note
The mode of the static statement such as solution is realized.
Here, target control inversion container can be integrated in the container assemblies in above-mentioned electronic equipment, for storage pair
As agency and object.Object broker is for the object in dynamic management objectives control inversion container, for example, object is injected into mesh
Mark controls in inversion container, modification has been injected into object, deletes the object having been injected into from target control inversion container etc..In this way,
Only statement object is needed to act on behalf of during the starting of target control inversion container, to inject target control inversion container without stating
All objects.
Step 202, after the starting of target control inversion container, in response to receiving object reference request, pass through object
It acts on behalf of and determines in target control inversion container with the presence or absence of called object;And it is not present, passes through in response to called object
Object broker creates called object.
In the present embodiment, after the starting of target control inversion container (that is, during target control inversion container is run),
Above-mentioned electronic equipment (such as terminal device 103 shown in FIG. 1) can receive outside (for example, management server shown in FIG. 1
101) object reference request, and parsing to object reference request, obtains the mark of called object, be then based on by
The mark of object is called to inquire in target control inversion container by the object broker created in step 210 with the presence or absence of called
Object, and there is no create called object by object broker when called object in target control inversion container.Also
It is to say, the needs that above-mentioned electronic equipment can be requested according to object reference are dynamically injected called object by object broker
Into target control inversion container, from without frequently restarting target control inversion container, and target control inversion container
It need not be once the resource overhead for starting maintenance fixation.
Here, object reference request can be call special object execute specific operation request, object reference request in
Be packaged with called object the mark title of object (for example, called) and called object operation to be performed (for example, by
The method for calling object).
In some optional implementations of the present embodiment, when the electronics of method operation thereon for managing object
It, can be straight by object broker when there is the class file of called object in equipment (for example, terminal device 103 shown in FIG. 1)
Connect the called object of creation.For example, by the Classloader in object broker invocation target control inversion container.Called pair of load
The class file of elephant instantiates the class of called object, obtains called object.
In some optional implementations of the present embodiment, when the electronics of method operation thereon for managing object
There is no when the class file of called object in equipment (for example, terminal device 103 shown in FIG. 1), can first download called
The class file of object, then called object is created by object broker.For example, from remote server (for example, pipe shown in FIG. 1
Manage server 101) class file of downloading called object, then loaded by the class of object broker invocation target control inversion container
Device loads downloaded class file, instantiates to the class of called object, obtains called object.It follows that this reality
Apply example for manage the method for object not only can class file to the called object being present in above-mentioned electronic equipment into
Row instantiation from the external class file for obtaining called object and can also be instantiated.
In some optional implementations of the present embodiment, when called object is occupied (for example, being asked by other calling
Seek calling) when, increase the quantity of called object by object broker.Hold for example, controlling reversion by object broker invocation target
The Classloader of device loads the class file of called object again, instantiates again to the class of called object, obtains another
One called object.By increasing the quantity of called object, the waiting time of object reference request can be reduced, target control is improved
The response speed of inversion container processed.
In some optional implementations of the present embodiment, this method further include: start in target control inversion container
Later, in response to receive object modification request, parsing object modification request with obtain object to be modified parameter to be modified and
Parameter value to be modified sets parameter value to be modified for the value of the parameter to be modified of object to be modified by object broker.
In some optional implementations of the present embodiment, this method further include: start in target control inversion container
Later, target control inversion container is scanned at predetermined intervals by object broker to obtain in target control inversion container
Object set and each object recalls information, it is negative to determine whether the load of target control inversion container is greater than preset threshold value
It carries, wherein the recalls information of object may include the call number of object, the last called time etc.;And in mesh
When the load of mark control inversion container is more than threshold load, the recalls information based on object set and each object passes through object
Agency destroys the object that maximum duration is not called upon.Since the object in object set can be injected based on object reference request
Into target control inversion container, therefore it can determine object not according to current time and object the last time called time
The called time is ranked up the object in object set according to the length for the time being not called upon, and successively deletes most
The object being not called upon for a long time, until the load of target control inversion container is lower than threshold load, to optimize note
Enter the utilization rate of the object into target control inversion container, and the load of target control inversion container is made to maintain reasonable model
In enclosing,
With continued reference to the signal that Fig. 3, Fig. 3 are according to the application scenarios of the method for managing object of the present embodiment
Figure.In the application scenarios of Fig. 3, during the starting of target control inversion container, terminal device starts target control inversion container
And the object broker of target control inversion container is created, complete the initialization to target control inversion container;It is anti-in target control
After turning container starting, terminal device can receive the object reference from Automatic Configuration Server and request and obtain called pair
The mark of elephant, the mark based on called object are searched in target control inversion container by object broker with the presence or absence of called
Object;When called object is not present in target control inversion container, passes through object broker and create called object.
The method provided by the above embodiment of the application base after the starting of target control inversion container by object broker
The unimplanted called object into target control inversion container is created in object reference request, the initial of inversion container will be controlled
Change mutually separated with the injection of object, can in the case where not restarting target inversion container Dynamic Maintenance target control inversion container
In object, to reduce the maintenance cost of target inversion container.
With further reference to Fig. 4, as the realization to method shown in above-mentioned each figure, this application provides one kind for management pair
One embodiment of the device of elephant, the Installation practice is corresponding with embodiment of the method shown in Fig. 2, which can specifically answer
For in various electronic equipments.
As shown in figure 4, the present embodiment includes: initialization unit 401 and Object Creation for managing the device 400 of object
Unit 402.
Wherein, initialization unit 401 be configured to starting target control inversion container and by the class to object broker into
Row instantiation creation object broker, wherein for storing object broker and object, object broker is used for target control inversion container
Management objectives control the object in inversion container;Object Creation unit 402 is configured to start it in target control inversion container
Afterwards, it in response to receiving object reference request, is determined in target control inversion container by object broker with the presence or absence of called
Object, and be not present in response to called object, called object is created by object broker.
In some optional implementations of the present embodiment, Object Creation unit 402 includes the first instantiation module.Its
In, the first instantiation module is configured to exist in response to the class file for the object that is called, and passes through object broker invocation target control
The Classloader of inversion container processed loads the class file of called object, creates called object.
In some optional implementations of the present embodiment, Object Creation unit 402 further includes download module and second
Instantiate module.Wherein, download module is configured to be not present in response to the class file for the object that is called, and downloads called object
Class file;Second instantiation module is configured to the Classloader of object broker invocation target control inversion container, adds
Downloaded class file is carried, called object is created.
In some optional implementations of the present embodiment, the device 400 for managing object of the present embodiment is also wrapped
Include object adding unit.Wherein, object adding unit is configured to increase when called object is occupied by object broker
The quantity of called object.
In some optional implementations of the present embodiment, the device 400 for managing object of the present embodiment is also wrapped
Include object updating unit.Wherein, object updating unit is configured to after target control inversion container starts, in response to receiving
It is requested to object modification, parsing object modification requests to lead to obtain the parameter to be modified of object to be modified and parameter value to be modified
It crosses object broker and sets parameter value to be modified for the value of the parameter to be modified of object to be modified.
In some optional implementations of the present embodiment, the device 400 for managing object of the present embodiment is also wrapped
It includes load determining unit and object destroys unit.Wherein, load determining unit is configured to start in target control inversion container
Later, target control inversion container is scanned at predetermined intervals by object broker to obtain in target control inversion container
Object set and each object recalls information, determine the load of target control inversion container;Object is destroyed unit configuration and is used
When the load in target control inversion container is greater than threshold load, the recalls information based on object set and each object is led to
It crosses object broker and destroys the object that maximum duration is not called upon.
It should be appreciated that all units recorded in device 400 are corresponding with each step in the method with reference to Fig. 2 description.
It is equally applicable to device 400 and unit wherein included above with respect to the operation and feature of method description as a result, it is no longer superfluous herein
It states.
The device 400 provided by the embodiments of the present application for being used to manage object, is inverted in target control by object broker and is held
The unimplanted called object into target control inversion container is created based on object reference request after device starting, control is anti-
The initialization for turning container is mutually separated with the injection of object, can in the case where not restarting target inversion container Dynamic Maintenance target
The object in inversion container is controlled, to reduce the maintenance cost of target inversion container.
Below with reference to Fig. 5, it illustrates the computer systems 500 for the terminal device for being suitable for being used to realize the embodiment of the present application
Structural schematic diagram.Terminal device shown in Fig. 5 is only an example, function to the embodiment of the present application and should not use model
Shroud carrys out any restrictions.
As shown in figure 5, computer system 500 includes central processing unit (CPU) 501, it can be read-only according to being stored in
Program in memory (ROM) 502 or be loaded into the program in random access storage device (RAM) 503 from storage section 508 and
Execute various movements appropriate and processing.In RAM 503, also it is stored with system 500 and operates required various programs and data.
CPU 501, ROM 502 and RAM 503 are connected with each other by bus 504.Input/output (I/O) interface 505 is also connected to always
Line 504.
I/O interface 505 is connected to lower component: the importation 506 including keyboard, mouse etc.;It is penetrated including such as cathode
The output par, c 507 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 508 including hard disk etc.;
And the communications portion 509 of the network interface card including LAN card, modem etc..Communications portion 509 via such as because
The network of spy's net executes communication process.Driver 510 is also connected to I/O interface 505 as needed.Detachable media 511, such as
Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 510, in order to read from thereon
Computer program be mounted into storage section 508 as needed.
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description
Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be carried on computer-readable medium
On computer program, which includes the program code for method shown in execution flow chart.In such reality
It applies in example, which can be downloaded and installed from network by communications portion 509, and/or from detachable media
511 are mounted.When the computer program is executed by central processing unit (CPU) 501, limited in execution the present processes
Above-mentioned function.It should be noted that computer-readable medium described herein can be computer-readable signal media or
Computer readable storage medium either the two any combination.Computer readable storage medium for example can be --- but
Be not limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.
The more specific example of computer readable storage medium can include but is not limited to: have one or more conducting wires electrical connection,
Portable computer diskette, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only deposit
Reservoir (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory
Part or above-mentioned any appropriate combination.In this application, computer readable storage medium, which can be, any include or stores
The tangible medium of program, the program can be commanded execution system, device or device use or in connection.And
In the application, computer-readable signal media may include in a base band or the data as the propagation of carrier wave a part are believed
Number, wherein carrying computer-readable program code.The data-signal of this propagation can take various forms, including but not
It is limited to electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be computer
Any computer-readable medium other than readable storage medium storing program for executing, the computer-readable medium can send, propagate or transmit use
In by the use of instruction execution system, device or device or program in connection.Include on computer-readable medium
Program code can transmit with any suitable medium, including but not limited to: wireless, electric wire, optical cable, RF etc., Huo Zheshang
Any appropriate combination stated.
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the application, method and computer journey
The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation
A part of one module, program segment or code of table, a part of the module, program segment or code include one or more use
The executable instruction of the logic function as defined in realizing.It should also be noted that in some implementations as replacements, being marked in box
The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually
It can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it to infuse
Meaning, the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart can be with holding
The dedicated hardware based system of functions or operations as defined in row is realized, or can use specialized hardware and computer instruction
Combination realize.
Being described in unit involved in the embodiment of the present application can be realized by way of software, can also be by hard
The mode of part is realized.Described unit also can be set in the processor, for example, can be described as: a kind of processor packet
Include initialization unit and Object Creation unit.Wherein, the title of these units is not constituted under certain conditions to the unit sheet
The restriction of body, for example, initialization unit is also described as " carrying out target control inversion container and its object broker initial
The unit of change ".
As on the other hand, present invention also provides a kind of computer-readable medium, which be can be
Included in device described in above-described embodiment;It is also possible to individualism, and without in the supplying device.Above-mentioned calculating
Machine readable medium carries one or more program, when said one or multiple programs are executed by the device, so that should
Device: during the starting of target control inversion container, instantiation creation object broker, target are carried out by the class to object broker
Control inversion container is for storing object broker and object, and object broker is for the object in management objectives control inversion container;
After the starting of target control inversion container, in response to receiving object reference request, target control is determined by object broker
With the presence or absence of called object in inversion container;And it is not present in response to called object, is adjusted by object broker creation
Use object.
Above description is only the preferred embodiment of the application and the explanation to institute's application technology principle.Those skilled in the art
Member is it should be appreciated that invention scope involved in the application, however it is not limited to technology made of the specific combination of above-mentioned technical characteristic
Scheme, while should also cover in the case where not departing from foregoing invention design, it is carried out by above-mentioned technical characteristic or its equivalent feature
Any combination and the other technical solutions formed.Such as features described above has similar function with (but being not limited to) disclosed herein
Can technical characteristic replaced mutually and the technical solution that is formed.
Claims (14)
1. a kind of method for managing object, which is characterized in that the described method includes:
During the starting of target control inversion container, instantiation is carried out by the class to object broker and creates the object broker,
The target control inversion container is for storing the object broker and object, and the object broker is for managing the target control
The object in inversion container processed;
After target control inversion container starting, in response to receiving object reference request, pass through the object broker
It determines with the presence or absence of called object in the target control inversion container, and is not present in response to the called object,
The called object is created by the object broker.
2. the method according to claim 1, wherein described, in response to the called object, there is no pass through institute
It states object broker and creates the called object, comprising:
Exist in response to the class file of the called object, the target control inversion container is called by the object broker
Classloader, load the class file of the called object, create the called object.
3. the method according to claim 1, wherein described, in response to the called object, there is no pass through institute
It states object broker and creates the called object, comprising:
It is not present in response to the class file of the called object, downloads the class file of the called object;
The Classloader of the target control inversion container is called by the object broker, loads downloaded class file, wound
Build the called object.
4. the method according to claim 1, wherein the method also includes:
Exist in response to the called object and occupied, increases the number of the called object by the object broker
Amount.
5. the method according to claim 1, wherein the method also includes:
After target control inversion container starting, in response to receiving object modification request, the object modification is parsed
It requests to obtain the parameter to be modified of object to be modified and parameter value to be modified, it will be described to be modified right by the object broker
The value of the parameter to be modified of elephant is set as the parameter value to be modified.
6. the method according to claim 1, wherein the method also includes:
After target control inversion container starting, the mesh is scanned by the object broker at predetermined intervals
Mark controls inversion container to obtain the recalls information of object set and each object in the target control inversion container, determines
The load of the target control inversion container;And it is greater than threshold load in response to the load of the target control inversion container,
The recalls information based on the object set and each object is destroyed maximum duration by the object broker and is not called upon
Object.
7. a kind of for managing the device of object, which is characterized in that described device includes:
Initialization unit is configured to starting target control inversion container and carries out instantiation creation by the class to object broker
The object broker, wherein the target control inversion container is for storing the object broker and object, the object broker
For managing the object in the target control inversion container;
Object Creation unit is configured to after the target control inversion container starts, in response to receiving object reference
It requests, is determined by the object broker with the presence or absence of called object in the target control inversion container, and in response to
The called object is not present, and creates the called object by the object broker.
8. device according to claim 7, which is characterized in that the Object Creation unit includes:
First instantiation module is configured to exist in response to the class file of the called object, passes through the object broker
The Classloader of the target control inversion container is called, the class file of the called object is loaded, is created described called
Object.
9. device according to claim 7, which is characterized in that the Object Creation unit further include:
Download module is configured to be not present in response to the class file of the called object, downloads the called object
Class file;
Second instantiation module, is configured to the object broker and the class of the target control inversion container is called to load
Device loads downloaded class file, creates the called object.
10. device according to claim 7, which is characterized in that described device further include:
Object adding unit is configured to exist in response to the called object and occupied, passes through the object broker
Increase the quantity of the called object.
11. device according to claim 7, which is characterized in that described device further include:
Object updating unit is configured to after the target control inversion container starts, in response to receiving object modification
Request parses the object modification request to obtain the parameter to be modified of object to be modified and parameter value to be modified, by described
The value of the parameter to be modified of the object to be modified is set the parameter value to be modified by object broker.
12. device according to claim 7, which is characterized in that described device further include:
Load determining unit is configured to after the target control inversion container starts, by the object broker with pre-
Fixed time interval scan the target control inversion container with obtain the object set in the target control inversion container with
And the recalls information of each object, determine the load of the target control inversion container;
Object destroys unit, is configured to be greater than threshold load in response to the load of the target control inversion container, is based on institute
The recalls information for stating object set and each object destroys pair that maximum duration is not called upon by the object broker
As.
13. a kind of server, comprising:
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processors are real
Now such as method as claimed in any one of claims 1 to 6.
14. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is by processor
Such as method as claimed in any one of claims 1 to 6 is realized when execution.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710971306.5A CN109683992B (en) | 2017-10-18 | 2017-10-18 | Method and apparatus for managing objects |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710971306.5A CN109683992B (en) | 2017-10-18 | 2017-10-18 | Method and apparatus for managing objects |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109683992A true CN109683992A (en) | 2019-04-26 |
CN109683992B CN109683992B (en) | 2022-06-07 |
Family
ID=66182922
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710971306.5A Active CN109683992B (en) | 2017-10-18 | 2017-10-18 | Method and apparatus for managing objects |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109683992B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110597493A (en) * | 2019-08-22 | 2019-12-20 | 深圳市元征科技股份有限公司 | Control method of Internet of vehicles development system and related products |
CN111522535A (en) * | 2020-03-26 | 2020-08-11 | 杭州数跑科技有限公司 | Data source aggregation method and device, storage medium and computer equipment |
CN112667324A (en) * | 2020-12-30 | 2021-04-16 | 凌云光技术股份有限公司 | Method and device for calling command class in command mode |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102591710A (en) * | 2010-12-16 | 2012-07-18 | 微软公司 | Sharing object representations |
WO2013049406A1 (en) * | 2011-10-01 | 2013-04-04 | Oracle International Corporation | Moving an object about a display frame by combining classical mechanics of motion |
CN103425532A (en) * | 2013-08-27 | 2013-12-04 | 北京京东尚科信息技术有限公司 | JAVA stateless object management method and device |
CN103677975A (en) * | 2013-12-09 | 2014-03-26 | 北京恒华伟业科技股份有限公司 | System and method for having access to internal objects of application systems |
CN106940714A (en) * | 2017-03-06 | 2017-07-11 | 掌阅科技股份有限公司 | A kind of data processing method, device and electronic equipment |
-
2017
- 2017-10-18 CN CN201710971306.5A patent/CN109683992B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102591710A (en) * | 2010-12-16 | 2012-07-18 | 微软公司 | Sharing object representations |
WO2013049406A1 (en) * | 2011-10-01 | 2013-04-04 | Oracle International Corporation | Moving an object about a display frame by combining classical mechanics of motion |
CN103425532A (en) * | 2013-08-27 | 2013-12-04 | 北京京东尚科信息技术有限公司 | JAVA stateless object management method and device |
CN103677975A (en) * | 2013-12-09 | 2014-03-26 | 北京恒华伟业科技股份有限公司 | System and method for having access to internal objects of application systems |
CN106940714A (en) * | 2017-03-06 | 2017-07-11 | 掌阅科技股份有限公司 | A kind of data processing method, device and electronic equipment |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110597493A (en) * | 2019-08-22 | 2019-12-20 | 深圳市元征科技股份有限公司 | Control method of Internet of vehicles development system and related products |
CN110597493B (en) * | 2019-08-22 | 2023-06-30 | 深圳市元征科技股份有限公司 | Control method of Internet of vehicles development system and related products |
CN111522535A (en) * | 2020-03-26 | 2020-08-11 | 杭州数跑科技有限公司 | Data source aggregation method and device, storage medium and computer equipment |
CN112667324A (en) * | 2020-12-30 | 2021-04-16 | 凌云光技术股份有限公司 | Method and device for calling command class in command mode |
CN112667324B (en) * | 2020-12-30 | 2023-12-05 | 凌云光技术股份有限公司 | Method and device for calling command class in command mode |
Also Published As
Publication number | Publication date |
---|---|
CN109683992B (en) | 2022-06-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108962244A (en) | Method and apparatus for sending information | |
CN108052340A (en) | A kind of application upgrade method, apparatus | |
CN109683992A (en) | Method and apparatus for managing object | |
CN107835181A (en) | Right management method, device, medium and the electronic equipment of server cluster | |
CN113760324A (en) | Method and device for constructing micro front-end application | |
CN111818194A (en) | Domain name based access system and method | |
CN112269565A (en) | Container-based edge device operation method, device and system | |
CN104133676A (en) | Function execution method and function execution device based on scripts | |
CN109343970B (en) | Application program-based operation method and device, electronic equipment and computer medium | |
CN111338666A (en) | Method, device, medium and electronic equipment for realizing application program upgrading | |
CN113204425B (en) | Method, device, electronic equipment and storage medium for process management internal thread | |
CN112529711B (en) | Transaction processing method and device based on block chain virtual machine multiplexing | |
CN109800020A (en) | A kind of code automatic adjusting method, device, equipment and the medium of program development | |
CN109947423A (en) | Code generating method, device, terminal and medium | |
CN109491721A (en) | Method and apparatus for load information | |
CN113535220B (en) | Code packet management method and device | |
CN113535419A (en) | Service arranging method and device | |
CN113722007B (en) | Configuration method, device and system of VPN branch equipment | |
CN109145591A (en) | The plug-in loading method of application program | |
CN108804088A (en) | Protocol processes method and apparatus | |
CN115167874A (en) | Automatic driving software mirror image deployment method and device, electronic equipment and readable medium | |
CN113312900A (en) | Data verification method and device | |
CN113626001A (en) | API dynamic editing method and device based on script | |
CN113448679A (en) | Method and device for processing call request | |
CN110086880A (en) | The method and apparatus for creating the example of network request |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |