Solved

Load balancing in rmi

Posted on 2000-04-24
3
451 Views
Last Modified: 2013-12-29
Hello,
Suppose a rmi server is running and an object is instantiaated. now clients over internet can invoke methods on that object. when number of hits is low then it's ok. but when it's huge things may not work as desired. so i want to load balance. may be, more than one rmi server will be running and some one will decide which server to contact to. Is there any statnadard method to do it? any tool which can help it?
0
Comment
Question by:dipak_kr_ghosh
  • 2
3 Comments
 
LVL 3

Expert Comment

by:ovidiucraciun
ID: 2743273
You can do that on your server.
You build an dispacther server that only forward messages to child servers that do the task. When last child server created is to busy then it will create another one (with another thread of execution of course) and schedule the task to the new child server. And so on ...
0
 

Expert Comment

by:sajal_s
ID: 2743331
In Java1.2 one option is there i.e
Step 1:
Make the appropriate imports in the implementation class
import java.rmi.*;
import java.rmi.activation.*;
Step 2:
Extend your class from java.rmi.activation.Activatable

public class ActivatableImplementation extends Activatable
    implements examples.activation.MyRemoteInterface {

Step 3:
Declare a two-argument constructor in the implementation class
public ActivatableImplementation(ActivationID id, MarshalledObject data)
    throws RemoteException {
    // Register the object with the activation system
    // then export it on an anonymous port
    super(id, 0);
}

Step 4:
Implement the remote interface method(s)

public Object callMeRemotely() throws RemoteException {
    return "Success";
}



run rmid (rmi deamon) on server machine

This process uses the concept of lazy activation .
0
 

Accepted Solution

by:
sajal_s earned 100 total points
ID: 2743333
In Java1.2 one option is there i.e
Step 1:
Make the appropriate imports in the implementation class
import java.rmi.*;
import java.rmi.activation.*;
Step 2:
Extend your class from java.rmi.activation.Activatable

public class ActivatableImplementation extends Activatable
    implements examples.activation.MyRemoteInterface {

Step 3:
Declare a two-argument constructor in the implementation class
public ActivatableImplementation(ActivationID id, MarshalledObject data)
    throws RemoteException {
    // Register the object with the activation system
    // then export it on an anonymous port
    super(id, 0);
}

Step 4:
Implement the remote interface method(s)

public Object callMeRemotely() throws RemoteException {
    return "Success";
}



run rmid (rmi deamon) on server machine

This process uses the concept of lazy activation .


0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
split53 challenge 7 97
use lov values 2 50
servlet example 17 32
How to execute a Python program and gather return output in Java 2 31
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question