answersLogoWhite

0


Best Answer

Develop a middleware component for retrieving Weather Forecast information using CORBA

Program Code:

IDL Class:-

module Hello1

{

interface Hello

{

string sayHello();

};

};

Client Class:-

import Hello1.*;

import org.omg.CosNaming.*;

import org.omg.CosNaming.NamingContextPackage.*;

import org.omg.CORBA.*;

public class HelloClient

{

static Hello helloImpl;

public static void main(String args[])

{

try

{

// create and initialize the ORB

ORB orb = ORB.init(args, null);

// get the root naming context

org.omg.CORBA.Object objRef = orb.resolve_initial_references("NameService");

NamingContext ncRef = NamingContextHelper.narrow(objRef);

// resolve the Object Reference in Naming

NameComponent nc=new NameComponent ("Hello","");

NameComponent path[] = {nc};

helloImpl = HelloHelper.narrow(ncRef.resolve(path));

System.out.println(helloImpl.sayHello());

}

catch (Exception e)

{

System.out.println("ERROR : " + e) ;

}

}

}

Implement Class:

import Hello1.*;

import org.omg.CosNaming.*;

import org.omg.CosNaming.NamingContextPackage.*;

import org.omg.CORBA.*;

import java.util.Properties;

class HelloImpl extends _HelloImplBase

{

// implement sayHello() method

public String sayHello()

{

return "\nHello world !!\n";

}

}

Server Class:-

import Hello1.*;

import org.omg.CosNaming.*;

import org.omg.CosNaming.NamingContextPackage.*;

import org.omg.CORBA.*;

public class HelloServer {

public static void main(String args[]) {

try

{

// create and initialize the ORB

ORB orb = ORB.init(args, null);

// create servant and register it with the ORB

HelloImpl helloImpl = new HelloImpl();

orb.connect(helloImpl);

// get object reference from the servant

org.omg.CORBA.Object objRef =orb.resolve_initial_references("NameService");

// Use NamingContext

NamingContext ncRef = NamingContextHelper.narrow(objRef);

// bind the Object Reference in Naming

NameComponent nc=new NameComponent ("Hello","");

NameComponent path[] = {nc};

ncRef.rebind(path, helloImpl);

System.out.println("HelloServer ready and waiting ...");

// wait for invocations from clients

orb.run();

}

catch (Exception e)

{

System.err.println("ERROR: " + e);

}

System.out.println("HelloServer Exiting ...");

}

}

Output:

Impl Side:

Z:\Middle ware\corba1>idlj -fclient -fserver -implBase hello.idl

Z:\Middle ware\corba1>cd hello1

Z:\Middle ware\corba1\Hello1>javac *.java

Z:\Middle ware\corba1>tnameserv

Initial Naming Context:

IOR:000000000000002849444c3a6f6d672e6f72672f436f734e616d696e672f4e616d696e

67436f6e746578743a312e3000000000010000000000000054000101000000000d313732

2e31362e312e3130380000041f00000018afabcafe00000002584b271b000000080000000

000000000000000010000000100000014000000000001002000000000000101000000000

TransientNameServer: setting port for initial object references to: 900

Ready.

Server Side:

Z:\Middle ware\corba1>javac *.java

Z:\Middle ware\corba1>java HelloServer

HelloServer ready and waiting...

Client Side:

Z:\Middle ware\corba1>java HelloClient

Hello world!!

User Avatar

Wiki User

13y ago
This answer is:
User Avatar
More answers
User Avatar

AnswerBot

3mo ago

To develop a middleware component for retrieving Weather Forecast information using CORBA, you can create an interface that defines methods for fetching weather data from a remote server. Implement this interface in a CORBA object that handles communication with the server. Use the CORBA IDL to define the interface and then generate language-specific stubs and skeletons for communication. Finally, deploy the component on the server and client machines to enable remote method invocations for retrieving weather forecast information.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Develop a middleware component for retrieving Weather Forecast information using CORBA?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Where can you find information about forecast?

If you would like information about forecast you can go to The website for The National Weather Service, or The Weather Channel. Your local area news channel would also have forecast information.


Where can someone find information on the Harmon Forecast?

One can find information on the Harmon Forecast on the CBS Sports website. It is a forecast that predicts the outcome of college football games each week.


What information can be given by looking at a seismogram?

A forecast for Earthquack


How do you choose appropriate forecasting model?

1) Who will be using the forecast and what information do they require? 2) How relevant is historical data, and what is its availability? 3) How accurate does the forecast have to be? 4) What is the time period of the forecast? 5) How much time do we have to develop the forecast? 6) What is the cost or benefit (value) of this forecast to our company?


Which primary source should information be obtained regarding expected weather at the estimated time of arrival if your destination has no Terminal Forecast?

Area Forecast.


Where is it possible for me to check the weather forecast in Mexico?

You can check the weather forecast in Mexico at several sites. However, the bes site to do this is the Weather Channel's website which gives you up to date information and the weekend forecast.


Which website has the most accurate Forex forecast?

The most accurate Forex forecast was the USD/JPY Forecast on May 1st. The website containing this information was Forex Cycle: Free Forex Market Analysis.


What is data predicted outside the given information or graph?

"Extrapolation" or "forecast".


What important information does weather forecast give you?

you should bring umbrella to be safe


What is the TV weather forecast?

I don't have real-time information on TV weather forecasts. You can check the weather forecast on a local news station or a weather website for updated information.


Where can a person find forecast information on the Australian dollar?

There are many resources available to those who wish to find out the forecast information on the Australian dollar. Yahoo provides a financial guide to the AUD, as well as currency from all over the world.


Where can someone find information on how to make a shipping forecast?

You can find information on how to create a shipping forecast by accessing guides from maritime organizations or government websites that specialize in weather forecasting for maritime operations. Additionally, books or online resources on marine meteorology can also provide valuable insights into how to prepare a shipping forecast. Observing and analyzing weather patterns locally can also help improve forecasting skills.