# US 2014/0157231 A1 · Modifying a Middleware

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2014/0157231 A1
- Document ID: US20140157231A1
- Status: Published application
- Kind: A1
- Application number: 14/073,569
- Filed: 2013-11-06
- Published: 2014-06-05
- Earliest claimed: 2012-11-30
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: JunJie Cai; San Hong Li; Jing Lv; Wei Wei Gao; Chen Lei
- Web page: https://patentgrep.com/patent/US20140157231A1

## CPC

- G06F 8/30: Creation or generation of source code
- G06F 8/656: while running
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

The present disclosure discloses a method and apparatus for modifying a middleware shared by multiple tenants by preparing a data packet comprising modification information and tenant information, the modification information comprising information of a specific class to be modified in the middleware as well as modification content for the specific class, the tenant information indicating a specific tenant of the plurality of tenants to which the modification content is directed; and in response to acquisition of the data packet: modifying the specific class in the middleware in runtime according to the modification information to create a modified specific class; and applying the modified content only to the specific tenant. When multiple tenants share a same middleware, different versions of the middleware may be provided for respective tenants, without affecting the use by other tenants, thereby satisfying sharing and customization requirements of each of the multiple tenants.

## Claims

### Claim 1

A method for modifying a middleware shared by a plurality of tenants, the method comprising:
preparing a data packet comprising modification information and tenant information, the modification information comprising information of a specific class to be modified in the middleware as well as modification content for the specific class, the tenant information indicating a specific tenant of the plurality of tenants to which the modification content is directed; and
in response to acquisition of the data packet:
modifying the specific class in the middleware in runtime according to the modification information to create a modified specific class; and
applying the modified content only to the specific tenant.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the information of the specific class comprises identification information of the specific class as well as metadata associated with the specific class.

### Claim 3 (depends on 1)

The method according to claim 1, wherein preparing the data packet comprises:
obtaining a customization request of the specific tenant;
preparing the modification information and the tenant information according to the customization request; and
packing the modification information and tenant information into the data packet according to a predetermined format.

### Claim 4 (depends on 3)

The method according to claim 3, wherein:
the customization request indicates one or more modifications to a specific function part of the specific class of the middleware; and
preparing the modification information further comprises obtaining a class corresponding to the specific function part of the specific class and transforming the specific function part via the one or more modifications to the specific class.

### Claim 5 (depends on 1)

The method according to claim 1, wherein preparing the data packet further comprises reporting the data packet to a runtime environment running the middleware.

### Claim 6 (depends on 1)

The method according to claim 1, wherein modifying the specific class further comprises modifying the specific class through a class transformer in runtime.

### Claim 7 (depends on 1)

The method according to claim 1, wherein modifying the specific class further comprises:
extracting the modification information and the tenant information from the data packet;
locating the specific class;
modifying the specific class according to the modification content; and
adding an execution condition for the modification content that is associated with the specific tenant in the specific class.

### Claim 8 (depends on 7)

The method according to claim 7, wherein:
the modification content further comprises content of an updated version of the specific class; and
modifying the specific class according to the modification content further comprises:
comparing content of an original version of the specific class with content of the updated version of the specific class to determine a content of difference; and
modifying the specific class according to the content of difference.

### Claim 9 (depends on 8)

The method according to claim 8, wherein modifying the specific class according to the content of difference further comprises adding, into the specific class, at least one item contained in the content of difference, the at least one item comprising one or more of: a re-defined variable, a re-defined method, a newly added variable, and a newly added method.

### Claim 10 (depends on 1)

The method according to claim 1, further comprising storing the modified specific class.

### Claim 11

An apparatus for modifying a middleware shared by multiple tenants, comprising:
a processing unit;
a memory; and
program code that when executed by the processing unit enables the apparatus to:
prepare a data packet comprising modification information and tenant information, the modification information comprising information of a specific class to be modified in the middleware as well as modification content for the specific class, the tenant information indicating a specific tenant of the plurality of tenants to which the modification content is directed; and
in response to acquisition of the data packet:
modify the specific class in the middleware in runtime according to the modification information to create a modified specific class; and
apply the modified content only to the specific tenant.

### Claim 12 (depends on 11)

The apparatus according to claim 11, wherein the information of the specific class comprises identification information of the specific class as well as metadata associated with the specific class.

### Claim 13 (depends on 11)

The apparatus according to claim 11, wherein the program code to prepare the data packet further comprises program code that enables the apparatus to:
obtain a customization request of the specific tenant;
prepare the modification information and the tenant information according to the customization request; and
pack the modification information and tenant information into the data packet according to a predetermined format.

### Claim 14 (depends on 13)

The apparatus according to claim 13, wherein:
the customization request indicates one or more modifications to a specific function part of the specific class of the middleware; and
the program code to prepare the modification information further comprises program code that enables the apparatus to obtain a class corresponding to the specific function part of the specific class and transforming the specific function part via the one or more modifications to the specific class.

### Claim 15 (depends on 11)

The apparatus according to claim 11, wherein the program code to prepare the data packet further comprises program code that enables the apparatus to report the data packet to a runtime environment running the middleware.

### Claim 16 (depends on 11)

The apparatus according to claim 11, wherein the program code to modify the specific class further comprises program code that enables the apparatus to modify the specific class through a class transformer in runtime.

### Claim 17 (depends on 11)

The apparatus according to claim 11, wherein the program code to modify the specific class further comprises program code that enables the apparatus to:
extract the modification information and the tenant information from the data packet;
locate the specific class;
modify the specific class according to the modification content; and
add an execution condition for the modification content that is associated with the specific tenant in the specific class.

### Claim 18 (depends on 17)

The apparatus according to claim 17, wherein:
the modification content further comprises content of an updated version of the specific class; and
the program code to modify the specific class according to the modification content further comprises program code that enables the apparatus to:
compare content of an original version of the specific class with content of the updated version of the specific class to determine a content of difference; and
modify the specific class according to the content of difference.

### Claim 19 (depends on 18)

The apparatus according to claim 18, wherein the program code to modify the specific class according to the content of difference further comprises program code that enables the apparatus to add, into the specific class, at least one item contained in the content of difference, the at least one item comprising one or more of: a re-defined variable, a re-defined method, a newly added variable, and a newly added method.

### Claim 20 (depends on 11)

The apparatus according to claim 11, the program code further comprising program code that enables the apparatus to store the modified specific class.
