Skip to Content
author's profile photo
Former Member

Closing resources in a JCO.Server

Hello,

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 super.run() method never returns... does anyone have an ideia?

thanks,

Vasco

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 () {

super.run();

//close resources after this

}

}

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Feb 23, 2004 at 10:08 AM

    Hello Vasco,

    sorry that I have to tell you that what you developing is already there. On the other hand this means that you don't have toi finish this. the R/3 service does exctly what you want.

    To do the things you want to do, you had to develop exactly a service for the Java Engine. Well, that is much more work.

    Regards,

    Benny

    Add comment
    10|10000 characters needed characters exceeded