Develop a middleware component for retrieving Stock Market Exchange information
#1

Develop a middleware component for retrieving Stock Market Exchange information using CORBA

Code:
Stock Market.idl
module SimpleStocks{
interface StockMarket
{
  float get_price(in string symbol);
};
};

StockMarketClient.java
import org.omg.CORBA.*;
import org.omg.CosNaming.*;
import SimpleStocks.*;


public class StockMarketClient
{

  public static void main(String[] args)
  {
  try
  {
      ORB orb=ORB.init(args,null);
      NamingContext ncRef=NamingContextHelper.narrow(orb.resolve_initial_references("NameService"));
      NameComponent path[]={new NameComponent("NASDAQ","")};
      StockMarket market=StockMarketHelper.narrow(ncRef.resolve(path));
System.out.println("Price of My company is"+market.get_price("My_COMPANY"));
}
catch(Exception e){
e.printStackTrace();
}
}
}
StockMarketImpl
import org.omg.CORBA.*;
import SimpleStocks.*;


public class StockMarketImpl extends _StockMarketImplBase
{
  public float get_price(String symbol)
{
   float price=0;
for(int i=0;i<symbol.length();i++)
{
  price+=(int)symbol.charAt(i);}
price/=5;
return price;
}
public StockMarketImpl(){super();}
}
StockMarketServer

import org.omg.CORBA.*;
import org.omg.CosNaming.*;
import SimpleStocks.*;


public class StockMarketServer
{

  public static void main(String[] args)
  {
  try
  {
      ORB orb=ORB.init(args,null);
StockMarketImpl stockMarketImpl=new StockMarketImpl();
orb.connect(stockMarketImpl);
org.omg.CORBA.Object objRef=orb.resolve_initial_references("NameService");
      NamingContext ncRef=NamingContextHelper.narrow(objRef);
      NameComponent nc=new NameComponent("NASDAQ","");
      NameComponent path[]={nc};
      ncRef.rebind(path,stockMarketImpl);

    
System.out.println("StockMarket server is ready");
Thread.currentThread().join();                                                
}
catch(Exception e){
e.printStackTrace();
}
}
}

EXECUTION STEPS
1.cREATE A INTERFACE(idl,CPP)
2.Create IMPLEMENTATION PROGRAM
3.sERVER PROGRAM
4.Client program
5.cOMMAND
idltojava -fno-cpp interfacename.idl
javac servant
javac server
javac client
tnameserv -ORBInitialPort 900
java HelloServer in another window
cmd
java StockMarketClient
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Popular Searches: impact of fii on indian stock market ppt, e r digram of stock market, class 12 business project on stock exchange, business studies project on stock exchange, retrieving stock market information using corba, middleware best practices, operational aspects of stock exchange ppt,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  Study Skills Information astru 2 3,108 02-01-2015, 07:13 PM
Last Post: seminar report asees
  To develop an Activex control document and perform the various file operations smart paper boy 0 1,203 21-07-2011, 09:45 AM
Last Post: smart paper boy
  To develop an Enterprise Java Bean for Library operations smart paper boy 0 1,159 21-07-2011, 09:45 AM
Last Post: smart paper boy
  To develop an Enterprise Java Bean for banking operations smart paper boy 0 1,468 21-07-2011, 09:44 AM
Last Post: smart paper boy

Forum Jump: