Patent ID: 8615734

Claim:
A method for dynamically redefining classes in an application server environment operating in one or more microprocessors comprising: detecting redefinable classes wherein each redefinable class has a shape and includes one or more redefinable class members; wherein the shape includes one or more fields or methods of the redefinable class; storing the redefinable classes in a metadata structure, wherein the metadata structure can store versions of the redefinable classes; indexing each of the one or more redefinable class members of each redefinable class in the metadata structure, wherein the class members of each version of each redefinable class can be indexed in the metadata structure; detecting changes to a redefinable class including changes to existing methods in the redefinable class and newly added methods to the redefinable class; transforming the redefinable class according to the changes detected to the redefinable class, wherein transforming can include adding and updating synthetic members to the redefinable class; wherein adding synthetic method includes, adding a first synthetic method to the redefinable class, wherein the first synthetic method can access a field using the metadata structure; creating an inner class for the redefinable class, wherein the inner class contains copies of methods of the redefinable class and the newly added methods; and editing methods of the redefinable class to call the inner class; wherein when a quantity of declared fields and/or methods in the redefinable class changes, the transforming step maintains the shape of the redefinable class via one or more of the synthetic members; receiving a call to a particular redefinable class member of a particular redefinable class; redirecting the call to a particular synthetic member of the particular redefinable class; and invoking the particular synthetic member using an index value associated with the particular redefinable class member in the metadata structure.