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: project done in stock exchange by students, middleware, ppt for embedded middleware and software development kit for area based distributed mobile cache system, middleware wireless, retrieving the files using content based search, latest technical seminar topics related to middleware, free stock market seminar mumbai,

[-]
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)

Messages In This Thread
Develop a middleware component for retrieving Stock Market Exchange information - by smart paper boy - 21-07-2011, 09:50 AM

Possibly Related Threads...
Thread Author Replies Views Last Post
  Study Skills Information astru 2 3,110 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,208 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,164 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,473 21-07-2011, 09:44 AM
Last Post: smart paper boy

Forum Jump: