Skip to Content
Former Member
Feb 19, 2004 at 12:19 PM

Closing resources in a JCO.Server



I developed a server application using Java Connector that listens to calls from a SAP system. What I did was extend class JCO.Server and implement method handleRequest.

My problem is that I need to close some resources when the server goes down (caused by an error) or when I shut down the server. I have tried to override the run method like this (see below) but it doesn't seems to work because the method never returns... does anyone have an ideia?



public class MyServer extends JCO.Server {

public MyServer(String gwhost,

String gwserv,

String program_id,

IRepository repos) {

//init code here


protected void handleRequest(JCO.Function function) {

//do stuff


public synchronized void run () {;

//close resources after this