# US 2017/0286140 A1 · Java-based offload service in a mainframe environment

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

- Number: US 2017/0286140 A1
- Document ID: US20170286140A1
- Status: Published application
- Kind: A1
- Application number: 15/087,924
- Filed: 2016-03-31
- Published: 2017-10-05
- Earliest claimed: 2016-03-31
- Assignees: CA, Inc.
- Applicants: CA, Inc.
- Inventors: Janet Pauline Eva Lowry; Frederic Armand Honore Duminy; Howard Israel Nayberg; Christopher Jamie Varughese
- Web page: https://patentgrep.com/patent/US20170286140A1

## CPC

- G06F 9/548: {Object oriented; Remote method invocation [RMI] (non-remote method invocation G06F9/449)}
- G06F 2209/509: Offload
- G06F 2209/549: Remote execution
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A JVM can be used as a conduit for transferring work items and results for work items between different processes/processors for a mainframe environment. The JVM provides infrastructure that allows a Java program running within the JVM to invoke native methods (e.g., assembly code methods) with a Java Native Interface (JNI). The Java program invokes a native method with the JNI to begin monitoring for work items and passes detected work items for processing to an appropriate resource, which was likely previously established. To pass a work item to a Java program, a native program code invokes Java code via the JNI that inserts a work item into the JVM address space (e.g., put the work item into a byte buffer). When the Java program obtains a work item result, the Java program invokes the native method via the JNI that writes a work item result to common storage.

## Claims

### Claim 1

A method comprising:
detecting, by an invoked first native program code previously invoked via an interface between the first native program code and a first process executing in a Java virtual machine, a computing task in common storage of a mainframe environment, wherein the computing task is associated with a first address space;
retrieving, by the invoked first native program code, the computing task from the common storage into a second address space of the mainframe environment, wherein the Java virtual machine executes within the second address space;
passing the computing task from the invoked first native program code to the first process via a buffer of the Java virtual machine;
communicating, by the first process, the computing task to a resource that will process the computing task;
in response to receipt of a result for the computing task, the first process invoking a second native program code via the interface to return the result to the first address space associated with the computing task; and
in response to invocation of the second native program code, the invoked second native program code writing the result to the common storage.

### Claim 2 (depends on 1)

The method of claim 1 further comprising the invoked second native program code notifying a native process in the first address space of the result.

### Claim 3 (depends on 1)

The method of claim 1, wherein writing the result to the common storage comprises updating the computing task in the common storage with the result.

### Claim 4 (depends on 1)

The method of claim 1, wherein passing the computing task comprises:
the invoked first native program code copying the computing task into a region of the second address space; and
the invoked first native program code invoking, via the interface, a Java method that indicates insertion of an item into the buffer, wherein the buffer corresponds to the region of the second address space.

### Claim 5 (depends on 1)

The method of claim 1, wherein the buffer is a Java char buffer.

### Claim 6 (depends on 1)

The method of claim 1, wherein the interface is a Java Native Interface.

### Claim 7 (depends on 1)

The method of claim 1 further comprising:
invoking a third native program code, by the first process via the interface, to establish an anchor in the common storage for computing tasks to be offloaded through the Java virtual machine; and
the invoked third native program code creating a storage anchor block in the common storage and creating a control block to be updated when a computing task is written to the anchor.

### Claim 8 (depends on 1)

The method of claim 1, wherein passing the computing task comprises:
transforming the computing task to be compatible with the first process.

### Claim 9 (depends on 1)

The method of claim 1 further comprising transforming the result to be compatible with the mainframe environment prior to the invoked second native program code writing the result to the common storage.

### Claim 10 (depends on 1)

The method of claim 1, wherein the first and second native program codes and the interface are within the second address space.

### Claim 11 (depends on 1)

The method of claim 1, wherein the interface comprises mappings between Java methods of the first process and the native program codes.

### Claim 12

One or more non-transitory machine readable media comprising program code for a Java-based offload service in a mainframe environment, the program code comprising:
a first native program code to,
detect a computing task written to a region of mainframe common storage allocated for computing tasks to be offloaded via a Java virtual machine, and
retrieve the computing task into a first address space that is in the mainframe environment and that is associated with the Java virtual machine;
a second native program code to,
return a result of a computing task from the first address space to the region of the mainframe common storage; and
Java program code to,
invoke the first native program code via a native interface to retrieve a computing task pending in the region of the mainframe common storage;
offload a computing task provided by an invocation of the first native program code to a resource for processing; and
invoke the second native program code via the native interface in response to receipt of a result for an offloaded computing task.

### Claim 13 (depends on 12)

The one or more non-transitory machine readable media of claim 12 further comprising native interface code to map methods of the Java program code to methods of the first and second native program codes.

### Claim 14 (depends on 12)

The one or more non-transitory machine readable media of claim 12 further comprising a third native program code to establish a queue in the mainframe common storage for the computing tasks to be offloaded by the Java program code.

### Claim 15

A mainframe comprising:
a plurality of processors;
common storage; and
a machine readable medium comprising,
a first native program code to executable by at least one of the plurality of processors to cause the mainframe to,
detect a computing task written to a region of the common storage allocated for computing tasks to be offloaded via a Java virtual machine,
retrieve the computing task into a first address space of the mainframe and that is associated with the Java virtual machine;
a second native program code executable by at least one of the plurality of processors to cause the mainframe to,
return a result of a computing task from the first address space to the region of the common storage;
Java program code executable within the Java virtual machine to cause the mainframe to,
invoke the first native program code via a native interface to retrieve a computing task pending in the region of the common storage;
offload a computing task provided by an invocation of the first native program code to a resource for processing; and
invoke the second native program code via the native interface in response to receipt of a result for an offloaded computing task.

### Claim 16 (depends on 15)

The mainframe of claim 15, wherein the machine readable medium further comprises program code of the native interface code to map methods of the Java program code to methods of the first and second native program codes.

### Claim 17 (depends on 16)

The mainframe of claim 16, wherein the program code of the native interface comprises program code to transform computing tasks from being compatible with an environment of the mainframe to being compatible with the Java virtual machine and to transform results of offloaded computing tasks from being compatible with the Java virtual machine to being compatible with the environment of the mainframe.

### Claim 18 (depends on 15)

The mainframe of claim 15, wherein the machine readable medium further comprises a third native program code to establish an anchor in the common storage for the computing tasks to be offloaded by the Java program code.

### Claim 19 (depends on 15)

The mainframe of claim 15, wherein the Java program code to offload the computing task comprises the Java program code to communicate the computing task to a resource external to the mainframe or to a specialized resource of the mainframe.

### Claim 20 (depends on 15)

The mainframe of claim 15, wherein the native interface complies with the Java Native Interface.
