RMI-Server "checks" when Client closes RMI-Connection

Hi there!
I hope somebody can help me...
I'm developing a client/server application where my client calls a remote method and my server starts working (i.e. 5-7 minutes batch processing).
Is there a way my server "gets informed", when RMI connection is closed (network failure, client closes)? In this situation the server should perform a rollback, delete generated files, etc.
I don't know if there is thrown a exception inside the server method, which I can catch ....
Any suggestion is welcome ..
Best Regards
Anton

Thanks a lot, I will have a look at the tutorial.
Initially my thoughts on this issue were:
-) The Client-RMI call is made in an own Thread (There are several things to do before job processing can start on the remote machine).
-) when the RMI call is processed, the thread gets blocked, so doesn't add load to the machine (hope so).
-) RMI does the "alive-checking", when network connection fails the client can mark the job as failed. The called server should also do some rollback. So I do not have to implements callback-listeners to react on server callbacks
-) But I'm worried about open connections, running out of socket resources and that there is no way to abort a endless running job.
This is my first aproach to solve this problem, I would be very glad about any comment ...

Similar Messages

  • How to Check when the user is connected to different desktop.

    How to Check when the user is connected to different desktop.Sometimes the user maynot see the theme in the personalize theme list. In that case the person must be using different kind of desktop.How to check, I need a path.And how to apply the theme to that user?
    Thanks,
    Paturi

    Hi,
    you can create the new portal desktop from
    System Administration => Portal display => Desktop and Display Themes
    Select your folder from Portal Content and from its context create new Desktop.
    Add The Framework page and the theme to this desktop page.
    Go to your folder from Portal Content and from the context of the framework page select add framework page to portal desktop.
    Adding Theme to desktop
    From Portal content select Theme folder and select the theme right click it and select Add theme to Portal Desktop.
    Create rule for the Desktop.
    Navigate to System Administration => Portal Display => Desktop and Display Themes Portal Content => Portal Administrators => Super Administrators =>main_rules.
    Click Add IF Expression.
    create the expression if user = xyz then click on apply
    Select the then clause of the if and navigate to your folder where Desktop is created ,Add it and Click Apply.
    Save the Changes to the rule.
    Hope it helps you.
    (reward points if its helpful)
    Thanks,
    Gunjan

  • [SOLVED] Disconnecting session when client close browser's window or tab

    Hello,
    I'm looking for disconnect my database session and invalidate the session with the "onunload" af:document function. I think that is the same as the "onunload" in "body" html tag.
    I see some documentation about that, for example:
    http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/tagdoc/core/document.html
    and I see that is enable to put an EL Expression, so I try with this:
    <f:view>
    <af:document binding="#{backing_user.document_user}" id="document_user" onunload="#{backing_user.logout}">
    <af:form binding="#{backing_user.form_user}" id="form_user"/>
    </af:document>
    </f:view>
    and not works, then I try:
    <f:view>
    <af:document binding="#{backing_user.document_user}" id="document_user" onunload="return logout_function()">
    <af:form binding="#{backing_user.form_user}" id="form_user"/>
    </af:document>
    </f:view>
    and as this, I try a lot of combinations, with no result. I take my time searching in various browsers but, surprisingly, I fount not much information about this (rare, I think is a very interesting matter).
    What is the way to be able this funcionallity?
    Thanks,
    Westh
    Edit: obviusly, logout_function() is a correct javascript function :P

    Hello,
    I resolve my problem. Now I go to describe the steps in a little tutorial.
    Remmember that this is a very basic tutorial that only allow you to do this matter, but not in deep. See bottom links for more information.
    Step's list:
    1) Download Shale framework from http://shale.apache.org/index.html#download
    2) Import all .jar libraries in your application.
    3) Open your web.xml file and add this:
    <context-param>
    <param-name>org.apache.shale.remoting.DYNAMIC_RESOURCES</param-name>
    <param-value>/dynamic/*:org.apache.shale.remoting.impl.MethodBindingProcessor</param-value>
    </context-param>
    4) Consider this:
    4.1) Managed bean --> userBean.java that have this method:
    public void logout () {
    /* Your logout code */
    and this name in faces-config.xml:
    <managed-bean>
    <managed-bean-name>userBeanId</managed-bean-name>
    <managed-bean-class>userBean</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    4.2) JSP Page --> home.jsp that have this code:
    A clinet listener:
    <af:clientListener method="unloadEvent" type="load"/>
    and this javascript functions:
    <f:verbatim>
    <script type="text/javascript">
    function unloadEvent () {
    window.onunload = function () {
    processUnload();
    function processUnload () {
    var httpRequest;
    if (window.XMLHttpRequest) {
    httpRequest = new XMLHttpRequest();
    } else if (window.ActiveXObject) {
    httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
    httpRequest.overrideMimeType('text/xml');
    httpRequest.onreadystatechange = function() { alertContents(httpRequest); };
    httpRequest.open('GET', 'dynamic/userBeanId/logout.faces', false);
    httpRequest.send('');
    function alertContents(httpRequest) {
    if (httpRequest.readyState == 4) {
    if (!httpRequest.status == 200) {
    alert('There was a problem with the request. Http code: ' + httpRequest.status);
    </script>
    </f:verbatim>
    Assuming the suffix '.faces' is mapped to the JSF servlet.
    With this, you are able to acces to logout method of userBean (using ajax) when client closes window or tab. No servlets, no 'logout.jsp' pages, etc; and the most important thing: the code never be repeat! it's funny :)
    Westh
    Resources:
    http://thepeninsulasedge.com/blog/2007/06/22/adf-faces-rc-more-on-javascript/
    http://thepeninsulasedge.com/frank_nimphius/adf-faces-rich-client-javascript-programming/
    http://www.oracle.com/technology/products/adf/adffaces/11/doc/multiproject/adf-richclient-api/tagdoc/af_clientListener.html
    http://shale.apache.org/shale-remoting/apidocs/org/apache/shale/remoting/package-summary.html
    http://shale.apache.org/shale-remoting/index.html

  • Rmi server communicating with client

    Is there any way for an rmi server to communicate back to the client? What I mean is, the client connects to the server and calls some method x(). One of the arguments of x() is the client(x(AClient ac)). Assume that AClient is a JFrame and has a method y() which adds a button to the frame or something. If the server calls ac.y(), in my understanding/experience, the server would actually create a local copy of AClient and add the button to the local copy, not to the frame that the client user is looking at.Is this correct? { 
      If so, is there any way to have ac.y() add the button to the client user's frame?
        If not, does anyone have any ideas for how to implement something like this relatively easily? 
    If not, does anyone have any ideas why it's not responding that way for me?I'm trying to avoid programming socket connections for this, and would love to be able to do it with rmi.
    Thanks in advance,
    m

    Not sure exactly what your starting point is. But:
    1. The client must be a UnicastRemoteObject.
    2. If your client is behind a firewall, then the scheme probably won't work. (Explored exhaustively in this forum.)

  • How to interpret rmi log msgs when setting -Djava.rmi.server.logCalls=true

    i have set this property: -Djava.rmi.server.logCalls=true
    now i am getting the following rmi log msgs on the console:
    Tue Nov 12 15:38:08 PST 2002:RMI:RMI TCP Connection(4851)-172.16.103.94:[172.16.103.94: sun.rmi.transport.DGCImpl[0:0:0, 2]: java.rmi.dgc.Lease dirty(java.rmi.server.ObjID[], long, java.rmi.dgc.Lease)]
    Tue Nov 12 15:38:13 PST 2002:RMI:RMI TCP Connection(4852)-127.0.0.1:[127.0.0.1: sun.rmi.registry.RegistryImpl[0:0:0, 0]: java.rmi.Remote lookup(java.lang.String)]
    Tue Nov 12 15:38:20 PST 2002:RMI:RMI TCP Connection(4853)-172.16.103.94:[172.16.103.94: sun.rmi.transport.DGCImpl[0:0:0, 2]: void clean(java.rmi.server.ObjID[], long,java.rmi.dgc.VMID, boolean)]
    can some one pls tell me know to interpret the messages, what does the number 4853 in TCP Connection(4853) mean ? thanks a lot

    Basically it is:
    date:subsystem:threadid:[remote object[object-id]:method]The 4853 is part of the thread-id and it is something like an instance number of the thread class.
    EJP

  • When to close database connections

    Hi Guys
    If a user logs in I create a new DB connection and verify his password etc. Once verified I store his details in a session bean. Now, should I close the connection or leave it open so I can continue to use it later on in other servlets?

    -Kayaman- wrote:
    BigDaddyLoveHandles wrote:
    You are using connection pooling, eh?Well I am, and he'll be using too eventually. Even without connection pooling it's not a good idea to keep connections open for long periods of times.Indeed, but the OP used the phrase "new connection" in his question, where I would have written, "a connection from the pool".

  • When client send file  connection with server close

    please help me.
    i want to transfer a file via server - client model.
    Client send the file, server receive it.
    Then when i send a msg from server to client i have this error:
    java.net.SocketException: socket closed
    why the socket closed?

    client waiting for response. i don't know what to do.
    the client code is:
    import java.net.*;
    import java.io.*;                              
    class Client{               
         Socket clientSocket;               
           byte[] byteArray;                    
           BufferedInputStream bis;          
            BufferedOutputStream bos;          
           int in;                                   
           BufferedReader inm = null;
            PrintWriter outm = null;
           public Client(){
             try{
                    clientSocket = new Socket("localhost", 9632);
                   System.out.println("i am client & connect");
                   inm = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
                   outm = new PrintWriter(clientSocket.getOutputStream(), true);
                   System.out.println("------1--------" +clientSocket.isClosed());
                      outm.println("msg 1: hi");
                      System.out.println("from server__ " +inm.readLine());
                      outm.println("msg 2: now i will send you a file");
                      System.out.println("from server__ " +inm.readLine());
                      sendFile();
                     System.out.println("-------2-------" +clientSocket.isClosed());
                      System.out.println("from server__ " +inm.readLine());
             catch(IOException e){
                    e.printStackTrace();
           public void sendFile(){
                try{
                     bis = new BufferedInputStream(new FileInputStream("encryptAtmMsg.txt"));
                    bos = new BufferedOutputStream(clientSocket.getOutputStream());
                    byteArray = new byte[8192];
                    while ((in = bis.read(byteArray)) != -1){
                       bos.write(byteArray,0,in);
                        bis.close();
                      bos.close();
               catch(IOException e){
                    e.printStackTrace();
           public static void main(String[] args){
             new Client();
    }And server code is:
    import java.net.*;
    import java.io.*;
    class Server{
         BufferedInputStream bis;
           BufferedOutputStream bos;
           byte[] data;
           Socket socket;
           ServerSocket serverSocket;
           int in;
            BufferedReader inm = null;
            PrintWriter outm = null;
           public Server(){
             try{
                    serverSocket = new ServerSocket(9632);
                    System.out.println("i am server & listening...");
                   socket = serverSocket.accept();
                     System.out.println("a client connect");
                   System.out.println("------1--------" +socket.isClosed());
                    inm = new BufferedReader(new InputStreamReader(socket.getInputStream()));
                    outm = new PrintWriter(socket.getOutputStream(), true);
                   System.out.println("from client: " +inm.readLine());
                     outm.println("ack 1: hi....");
                     System.out.println("from client: " +inm.readLine());
                     outm.println("ack 2: ok....");
                    receiveFile();
                      System.out.println("------2--------" +socket.isClosed());
                   outm.println("ack 3: take the file");
             catch (IOException e){
                  e.printStackTrace();
         public void receiveFile(){
              try{
                  byte[] receivedData = new byte[8192];
                 bis = new BufferedInputStream(socket.getInputStream());
                   bos = new BufferedOutputStream(new FileOutputStream("encryptAtmMsg22.txt"));
                 while ((in = bis.read(receivedData)) != -1){
                       bos.write(receivedData,0,in);
                 bos.close();
             catch (IOException e){
                  e.printStackTrace();
         public static void main(String[] args){
             new Server();
    }any idea pls

  • Problem when client closes

    Here is my server side:
    import java.net.*;
    import java.io.*;
    public class server {
         private static ServerSocket serversocket = null;
         public static void main(String[] args) {
              //ServerSocket serversocket = null;
             try {
                  serversocket = new ServerSocket(11116);
             } catch (IOException e) {
                  System.out.println(e);
             while(true) {
                  ClientWorker clientworker;
                  try {
                       clientworker = new ClientWorker(serversocket.accept());
                       Thread thread = new Thread(clientworker);
                       thread.start();
                  } catch(IOException e){
                       System.out.println(e);
                       System.exit(-1);
         protected void finalize(){
              try{
                  serversocket.close();
              } catch (IOException e) {
                  System.out.println("Could not close socket");
                  System.exit(-1);
    class ClientWorker implements Runnable {
         private Socket socket;
         public ClientWorker(Socket socket) {
              this.socket = socket;
         public void run(){
              String strLine;
              BufferedReader input = null;
              PrintWriter output = null;
              try{
                   input = new BufferedReader(new InputStreamReader(socket.getInputStream()));
                   output = new PrintWriter(socket.getOutputStream(), true);
             } catch (IOException e) {
                  System.out.println(e);
             while(true){
                  try{
                       strLine = input.readLine();
                       output.println(strLine);
                       System.out.println(strLine);
                  } catch (IOException e) {
                        System.out.println(e);
                        System.exit(-1);
    and my client side
    import java.net.*;
    import java.io.*;
    public class client {
         public static void main(String[] args) {
              Socket socket = null;
              BufferedReader input = null;
              PrintWriter output = null;
              String strServer = "192.168.0.3";
              String strLine = "";
              try {
                   socket = new Socket(strServer, 11116);
                   input = new BufferedReader(new InputStreamReader(socket.getInputStream()));
                   output = new PrintWriter(socket.getOutputStream(),true);
              } catch(UnknownHostException e) {
                   System.out.println("Couldn't get I/O for the connection to: " + strServer);
              } catch(IOException e) {
                   System.out.println(e);
              BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
              if(socket!=null && input!=null && output!=null) {
                   while(!strLine.equals("quit")) {
                        try {
                             System.out.print("Output: ");
                             strLine = stdIn.readLine();
                             output.println(strLine);
                             System.out.println("Server: " + input.readLine());
                        } catch(UnknownHostException e) {
                             System.out.println("Couldn't get I/O for the connection to: " + strServer);
                        } catch(IOException e) {
                             System.out.println(e);
              try {
                   output.close();
                   input.close();
                   socket.close();
              } catch(UnknownHostException e) {
                   System.out.println("Couldn't get I/O for the connection to: " + strServer);
              } catch(IOException e) {
                   System.out.println(e);
         } //end main method
    }Seems like everytime I close my client, the server crashes which is "java.net.SocketException: Connection reset"
    A little info about the program, it's just a multi-threaded server where clients can connect to it.
    How do i fix it?
    Thanks

    Really? :)
    strLine = stdIn.readLine(); // user
    output.println(strLine); // send to serverYes, really. That 'strLine' is null if the client has closed. The OP is not checking for this condition so he is writing the null after the client has already closed, and this happens in a hard loop from which there is no escape until the exception.
    So this happens because you are reading from the client after the client has closed its socket.That would cause readLine() to return a null. It wouldn't cause an IOException.
    Message was edited by:
    ejp

  • Applocker policies are not refreshed when client is not connected to the domain

    Hello all,
    We have a customized solution where a domain gpo applies applocker rules to block almost all applications. We have a software to enable some features on the client computer's (Win8.1) local policy, whenever it is needed. The enabling process is executed
    through powershell commandlets. So far there is no problem we can manage these points very well.
    The problem is, when this software enables access to a software on the client, if the user disables the network connection, our software cannot switch the local applocker policy back to the blocked state. Actually the local policy will not be re-evaluated
    by Applocker services on the client, so the application cannot be blocked again until client is connected back to the domain.
    Is this the designed behaviour of Applocker? Do we always need to have a domain connection, even to apply the modified local security policies on the client?

    http://technet.microsoft.com/zh-cn/library/ee449480(v=ws.10).aspx
    We don't need to have a domain connection, even to apply the modified local security policies on the client.
    Please check event view to se if ther is any erros in it.

  • Lion Server: iOS 5 clients can't connect to Address Card Server

    I have set up shared accounts on the server for Calendar and Address Book (family) sharing. Although I can add and use the Address Book shared account on OS X Lion clients, I can't get this to work on iOS 5 clients (iPhone nor iPad). I keep on getting "CardDAV account verification failed".
    Calendar sharing works just fine on both OS X and iOS5 clients
    Let me briefly describe my setup and observations:
    Server:
    Running Lion Server 10.7.2 on Mac Mini (server)
    Using SSL connections with keys generated during set-up of the server
    Portforwarding in router (ao) for 8008 and 8843 (iCal and Address Book)
    Created  shared accounts on server for Calendar ("sharedcalendar") and Address Book ("sharedcontacts")
    In the DNS server I created services in my primary zone for "_caldavs._tcp." and "_carddavs._tcp." both on port 8443
    OS X Client (Calendar)
    Created additional CalDAV account in preferences (user "sharedcalendar")
    Left the server settings untouched (server path, port "auto" and using SSL but not Kerberos)
    Created in "sharedcalendar" different calendars and reminder lists for the family members which each can access from their OS X client
    This account is now set-up through Profile Manager (tried this with Address Book as well but didn't make any difference)
    iOS 5 Client (Calendar)
    Once tested on standalone and got this working I'm now using the Profile Manager to push the definition of the shared account to all clients
    Hostname with port 8443 (default)
    Left Principal URL blank since it was optional
    User "shared calendar" with the appropriate password
    Ticked "Use SSL"
    OS X client (Address Book)
    Created additional CardDAV account in preferences (user "sharedcontacts").
    Left the server settings untouched (port 443 using SSL)
    iOS 5 client (Address Book)
    In the settings add a CardDAV account (server, user "sharedcontacts", password, description).
    First error message "Cannot connect Using SSL. Do you want to try setting up the account without SSL?". When I press continue I get the error "CardDAV account verification failed"
    If I then save the account details still and edit the account I can access the "advanced settings". When I change to SSL I have tried port 0 (default value), 8443 (the one that's listed in the documentation) and 8843 (which is used by default if you try to set up the
    account in Profile Manager). All to no avail, including Profile Manager
    Observations:
    Lion Server app nicely lists both Calendar and Address Book Server as active (plus Profile Manager, File Server, Web server and Wiki server)
    When I access my server home page, Calendar is listed in addition to other services (Mail | Calendar | Change Password | Profile Manager) but not Address Book. Is this normal behaviour? i.e. can't Address Book entries be changed through a web interface?
    Address Book on OS X client uses 443 for SSL but does not require me to define port 8443 for secure iCal or Address Book server communications
    Lion Server Profile Manager specifies port 8843 as port for SSL communication. I only saw 8443 listed in documentation
    The response "can't connect .." or "account verification failed" happens very quick which make me think either the verification doesn't even leave the iPad or there is something wrong in the SSL connection
    Since iCal set-up works nicely using the same ports I am puzzled why it doesn't work for Address Book
    Your solutions or suggestions how to investigate are most welcome,
    Erik

    Thanks for joining the discussion.
    Although port 8443 is mosten quoted as correct port for CalDAV and CardDAV, port 8843 can be found both on Apple's website and other places:
    see Technical Note 1649 to find port 8443 listed for iCal and port 8843 for Address Book
    Mac OS X Lion Server for Dummies (sic) lists port 8843 on pages 236 and 238 but port 8443 in many other places
    when you want to push iCal and Address Book information with Profile Manager, Profile Manager lists port 8443 for iCal but port 8843 for Address Book as default:
    So I hope you understand I'm somewhat puzzled.
    I did get the Address Book working for my Lion desktops with the all the necessary certificates as far as I know, just not for the iOS devices (iPhone and IpPad). iCal sharing from Lion Server works fine on both Lion and iOS devices.

  • Server Exception when using JDBC to Connect with SAP

    Hello,
    I am trying to connect to a view in an external database using JDBC. When I run the TestJDBC Tool, I get the following server exception:
    com.microsoft.sqlserver.jdbc.SQLServerException: ?? ?? '<view_name>'?(?) ???????.
        at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(Unknown Source)
        at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeQuery(Unknown Source)
        at com.sap.ip.bi.sdk.trialarea.connector.servlet.model.JDBCModel.getColumns(JDBCModel.java:202)
        at com.sap.ip.bi.sdk.trialarea.connector.servlet.controller.Control3.doPost(Control3.java:25)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
        at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
        at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
        at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
        at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
        at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
        at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
        at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
        at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
        at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
        at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:104)
        at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:176)
    The question marks really make it difficult to determine exactly what the issue is.
    Is there a way to perform a trace or to determine what is going on? Our third party provider has already confirmed that the authorization they provided is correct and is working.
    Thanks!

    Yes you can run a profiler trace on the SQL Server and include the "User Error Message" event under "Errors and Warnings".  This will show you the error message that SQL Server is sending to the client.
    When you get it, post it here because this is might be a bug in our JDBC driver that it does not turn that error into a sensible com.microsoft.sqlserver.jdbc.SQLServerException.
    David
    David http://blogs.msdn.com/b/dbrowne/

  • When to close database connection

    I'm working on an application that reads a customer number from an Access database and returns the name, address, etc of the customer number.
    My question is the following, is it best practice to close the database each time the request has been processed, and open it every time a request is made?

    Hai
    If u r sure that the application is a single user, then go for the singleton pattern. In that case u will be creating a single instance of the java.sql.Connection class. Before doing any DB operation check whether the connection is null or not, if its null create a new connection.
    If the application is a multi user one, go for connection pooling.
    Close the DB connection before exiting the application.

  • How to find client disconnected when client lost net connection?

    Hi,
         Can anyone help how can I find on fms server that client disconnected if if client disconnected due to power cut off. I client manually close the application then onDisconnect on server is called but if due to power cut off it does not called.
    Thanks

    See if this article is any kind of help : http://www.flashcomguru.com/forum/forum_posts.asp?TID=2848

  • Can I be notified when client closes?

    Hi all,
    Is there any way for a Flash client to be notified when it is
    about to be terminated by the browser (e.g. because the user closes
    the window)?
    Thanks in advance!
    Barry

    Not with ARD.

  • How to keep track of client in rmi server

    how can I keep track of a disconnected client in a rmi server ?
    And what logic do I use to disconnect a client fro mthe server ?

    When a RMI client receives a stub to the remote object, RMI client runtime sends a dirty() call to the RMI server runtime which in turn helps the RMI server runtime in updating the client references to the remote object. Client reference is nothing but a unique identification generated by client RMI runtime for that instance of JVM. RMI uses a reference counting algorithm for destroying unreferenced remote objects. Once all references (all clients who are holding the stub to this remote object) to a remote object drops to zero, local garbage collector takes care of freeing this remote object.
    RMI client runtime initiates a TCP connection with the remote object only when a method is invoked on the stub. RMI transport layer uses a simple connection pooling mechanism to use already established TCP connections with server objects in further remote method invocations. Let's say the client is invoking a remote method on the remote object's stub fetched from the registry service. Now RMI transport layer initiates a TCP connection with the remote object (exported at ("host1", 4567)). After completion of the remote method, RMI client's transport layer keeps the connection open for some time (some configurable value) to take the advantage of the already established TCP connection in future remote method invocations on remote objects exported on the same host and port ("Host1", 4567"). RMI transport layer also takes care of closing these connections if the connections are idle more than configured value of connection open time.
    From the RMI server's perspective, once the RMI server runtime receives a remote method invocation request from the RMI client, it creates a new thread and try to dispatch the method on the designated remote object. After returning the results of the remote method to the client, RMI client's transport layer may not end this conservation with this remote object to take the advantage of this TCP connection in future remote method invocations. So the same thread may be used for dispatching another remote method in future. This is actually the side effect of re-using the established TCP connections on the client side.
    RMI server maintains client's reference in the client's reference set of the remote object as long as the client holds a normal reference to remote object's stub in its JVM. Once the client relinquishes the reference to the stub (goes out of the scope or setting it to the null), RMI client automatically sends clean() call to the RMI server runtime to update client reference set of the remote object. There is no public API to lookup or manipulate the client references for a given remote object, but you can always unexport the remote object even some clients are holding stubs to the remote object. Next time when the client invokes the remote method using this stub, client will receive a "connection refused exception" from the server because the remote object is already unexported. Let's say if the RMI server is started again (remote object is exported and registered with registry service), the client once again obtains the stub to the remote object from the registry service instead of using earlier stale stub. (This time remote object may have been exported on different port, so the port details in the old stub may not be valid any more).
    At any point of time there can be more than one established TCP connection with the RMI client. This may be the temporary condition; RMI client's transport layer automatically closes these connections if it does not receive any remote method invocation requests with in a pre-determined interval of time (default: 2 min). You can always find out RMI client's host in a given remote invocation by using getClientHost(), but how can you semantically define a "disconnected client in a rmi server" in your application context ? You can always force all the clients to fetch the stub again in future remote method invocations by unexporting the remote object in RMI server. I hope this information helps ...
    -- Srinath Mandalapu

Maybe you are looking for

  • Can't open camera RAW image in CS4/Bridge with Win 8.1.  Worked fine with XP

    I upgraded from Win XP to 8.1 and got a new computer in the process.  I'm using CS4, and I think that works okay, except it does not recognize a RAW file.  Bridge won't open thumbnails for RAW files, and if I try to open one it doesn't open it in Bri

  • Installing software for my HP psc 1210 all-in-one printer on to my Mac?

    I have downloaded new software and drivers for my all-in-one printer. I am running OS X 10.5.2 on a 20" 2.16 GHz Intel Core 2 Duo. The computer recognises that a printer is present and I can print with no problems. The problem that I'm having is with

  • InDesign CS6 crashes when editing TOC

    I have an INDD C6 file with a TOC that I created for a print book. I am now making the eBook version of the file. I saved the print book file under a new name. Please note, this is a regular InDesign file (INDD) -- not a Book file (INDB). I am trying

  • Pricing Procedure question

    Hello forum contributors, In a Sales Order, can i have both tax included and tax excluded in a pricing procedure? for example Selling Price      - $12 Card Value     - $ 7 (no tax) Card Cost     - $ 5 (7% tax is included into $5 amount) Service Charg

  • Child panel -how to put him at specific place in Parent panel

    Hello I created program with main panel which other panels as tabs. I need to put child panel on on of the tab panels . How can i do that and obtain view of the child panel only on the right panel? I'm attach a picture to describe. Thank you for your