Examples of TradeHome


Examples of org.apache.geronimo.samples.daytrader.ejb.TradeHome


  private static boolean initialized = false;
  public static synchronized void init() 
  {
    TradeHome tradeHome=null;
    if (initialized) return;
    if (Log.doTrace())
      Log.trace("TradeDirect:init -- *** initializing");   
    try
    {
      if (Log.doTrace())
        Log.trace("TradeDirect: init");     
      context = new InitialContext();
      datasource = (DataSource) context.lookup(dsName);     
     
      tradeHome = (TradeHome) ( javax.rmi.PortableRemoteObject.narrow(
      context.lookup("java:comp/env/ejb/Trade"), TradeHome.class));
     
    }
    catch (Exception e)
    {
      Log.error("TradeDirect:init -- error on JNDI lookups of DataSource -- TradeDirect will not work", e);
      return;
    }     
    try
    {
      qConnFactory = (ConnectionFactory) context.lookup("java:comp/env/jms/QueueConnectionFactory");
      queue = (Queue) context.lookup("java:comp/env/jms/TradeBrokerQueue");
      tConnFactory = (ConnectionFactory) context.lookup("java:comp/env/jms/TopicConnectionFactory");
      streamerTopic = (Topic) context.lookup("java:comp/env/jms/TradeStreamerTopic");
    }
    catch (Exception e)
    {
      Log.error("TradeDirect:init  Unable to lookup JMS Resources\n\t -- Asynchronous mode will not work correctly and Quote Price change publishing will be disabled",e);
      publishQuotePriceChange = false;     
    }   
    try
    {
      tradeEJB = (Trade) tradeHome.create();         
    }
    catch (Exception e)
    {
      Log.error("TradeDirect:init -- error looking up TradeEJB -- Asynchronous 1-phase will not work", e);
    }         
View Full Code Here

Examples of org.apache.geronimo.samples.daytrader.ejb.TradeHome


  private static boolean initialized = false;
  public static synchronized void init() 
  {
    TradeHome tradeHome=null;
    if (initialized) return;
    if (Log.doTrace())
      Log.trace("TradeDirect:init -- *** initializing");   
    try
    {
      if (Log.doTrace())
        Log.trace("TradeDirect: init");     
      context = new InitialContext();
      datasource = (DataSource) context.lookup(dsName);     
        }
        catch (Exception e)
        {
            Log.error("TradeDirect:init -- error on JNDI lookups of DataSource -- TradeDirect will not work", e);
            return;
        }          
     
    try {

             tradeHome = (TradeHome) ( javax.rmi.PortableRemoteObject.narrow(
      context.lookup("java:comp/env/ejb/Trade"), TradeHome.class));
        }
        catch (Exception e)
        {
            Log.error("TradeDirect:init -- error on JNDI lookup of Trade Session Bean -- TradeDirect will not work", e);
            return;
        }          
       
        try
        {
            qConnFactory = (ConnectionFactory) context.lookup("java:comp/env/jms/QueueConnectionFactory");
        }
        catch (Exception e)
        {
            Log.error("TradeDirect:init  Unable to locate QueueConnectionFactory.\n\t -- Asynchronous mode will not work correctly and Quote Price change publishing will be disabled");
            publishQuotePriceChange = false;           
        }      
       
        try
        {
            queue = (Queue) context.lookup("java:comp/env/jms/TradeBrokerQueue");
        }
        catch (Exception e)
        {
            Log.error("TradeDirect:init  Unable to locate TradeBrokerQueue.\n\t -- Asynchronous mode will not work correctly and Quote Price change publishing will be disabled");
            publishQuotePriceChange = false;           
        }      
       
        try
        {
            tConnFactory = (ConnectionFactory) context.lookup("java:comp/env/jms/TopicConnectionFactory");
        }
        catch (Exception e)
        {
            Log.error("TradeDirect:init  Unable to locate TopicConnectionFactory.\n\t -- Asynchronous mode will not work correctly and Quote Price change publishing will be disabled");
            publishQuotePriceChange = false;           
        }
       
        try
        {
            streamerTopic = (Topic) context.lookup("java:comp/env/jms/TradeStreamerTopic");
        }
        catch (Exception e)
        {
            Log.error("TradeDirect:init  Unable to locate TradeStreamerTopic.\n\t -- Asynchronous mode will not work correctly and Quote Price change publishing will be disabled");
            publishQuotePriceChange = false;           
        }      
       
       
    try
    {
      tradeEJB = (Trade) tradeHome.create();         
    }
    catch (Exception e)
    {
      Log.error("TradeDirect:init -- error looking up TradeEJB -- Asynchronous 1-phase will not work", e);
    }         
View Full Code Here

Examples of org.apache.geronimo.samples.daytrader.ejb.TradeHome


  private static boolean initialized = false;
  public static synchronized void init() 
  {
    TradeHome tradeHome=null;
    if (initialized) return;
    if (Log.doTrace())
      Log.trace("TradeDirect:init -- *** initializing");   
    try
    {
      if (Log.doTrace())
        Log.trace("TradeDirect: init");     
      context = new InitialContext();
      datasource = (DataSource) context.lookup(dsName);     
        }
        catch (Exception e)
        {
            Log.error("TradeDirect:init -- error on JNDI lookups of DataSource -- TradeDirect will not work", e);
            return;
        }          
     
    try {

             tradeHome = (TradeHome) ( javax.rmi.PortableRemoteObject.narrow(
      context.lookup("java:comp/env/ejb/Trade"), TradeHome.class));
        }
        catch (Exception e)
        {
            Log.error("TradeDirect:init -- error on JNDI lookup of Trade Session Bean -- TradeDirect will not work", e);
            return;
        }          
       
        try
        {
            qConnFactory = (ConnectionFactory) context.lookup("java:comp/env/jms/QueueConnectionFactory");
        }
        catch (Exception e)
        {
            Log.error("TradeDirect:init  Unable to locate QueueConnectionFactory.\n\t -- Asynchronous mode will not work correctly and Quote Price change publishing will be disabled");
            publishQuotePriceChange = false;           
        }      
       
        try
        {
            queue = (Queue) context.lookup("java:comp/env/jms/TradeBrokerQueue");
        }
        catch (Exception e)
        {
            Log.error("TradeDirect:init  Unable to locate TradeBrokerQueue.\n\t -- Asynchronous mode will not work correctly and Quote Price change publishing will be disabled");
            publishQuotePriceChange = false;           
        }      
       
        try
        {
            tConnFactory = (ConnectionFactory) context.lookup("java:comp/env/jms/TopicConnectionFactory");
        }
        catch (Exception e)
        {
            Log.error("TradeDirect:init  Unable to locate TopicConnectionFactory.\n\t -- Asynchronous mode will not work correctly and Quote Price change publishing will be disabled");
            publishQuotePriceChange = false;           
        }
       
        try
        {
            streamerTopic = (Topic) context.lookup("java:comp/env/jms/TradeStreamerTopic");
        }
        catch (Exception e)
        {
            Log.error("TradeDirect:init  Unable to locate TradeStreamerTopic.\n\t -- Asynchronous mode will not work correctly and Quote Price change publishing will be disabled");
            publishQuotePriceChange = false;           
        }      
       
       
    try
    {
      tradeEJB = (Trade) tradeHome.create();         
    }
    catch (Exception e)
    {
      Log.error("TradeDirect:init -- error looking up TradeEJB -- Asynchronous 1-phase will not work", e);
    }         
View Full Code Here

Examples of org.apache.geronimo.samples.daytrader.ejb.TradeHome

      objref = initial.lookup("java:comp/env/ejb/Trade");
    }
    else {
      objref = initial.lookup("ejb/TradeEJB");
    }
    TradeHome home = (TradeHome)PortableRemoteObject.narrow(objref, TradeHome.class);
    trade = home.create();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.