Results 1 to 7 of 7
  1. #1

    How can I set the listener in the Data adapter?

    Hey,

    So from what I have read, the listener is set by the LightStreamer Kernel (correct me if I am wrong), but if I wish to configure the listener in the data adapter, how can I do it? So far when I am debugging the Lightstreamer-example-StockList-adapter-java it takes null for a listener, so how can I change it?

  2. #2
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    541
    Hi Priyanka,

    I confirm that the listener is provided by the Lightstreamer server to your Adapter with the setListener method call. The listener is set just after the init method and before any subscribe is called.
    The listener never changes throughout the entire life of the adapter, then neither the Lightstreamer server nor the code of your adapter can change it in any way.

    Please could you confirm that your setListener implementation properly stores the received object in some private variable, and never overwrite it?
    Could you confirm that the init method terminates successfully.

    Regards,
    Giuseppe

  3. #3
    Hey Giuseppe,

    Thanks for the prompt reply.

    1) Could you please let me know how to initialize the LightStreamer server? I read on a blog that an instance of a Remote Data Adapter is supplied to Lightstreamer through a lightstreamer_adapter.server.DataProviderServer instance. Where can I find this lightstreamer_adapter.server.DataProviderServer class in my LS_Home folder?

    2)I tried debugging the Lightstreamer-example-StockList-adapter-java project. This is how my Main.java code looks like :

    public class Main {

    public static void main(String[] args) {
    // TODO Auto-generated method stub
    DataAdapter dataAdapter = new DataAdapter();
    Map params = new HashMap<String,String>();
    params.put("log_config", "../adapters_log_conf.xml");
    params.put("log_config_refresh_seconds", "10");
    params.put("adapters_conf.id", "WELCOME");

    File configDir = new File("../adapters_log_conf.xml");
    ItemEventListener listener ;


    dataAdapter.setListener(new ItemEventListener());

    dataAdapter.init(params, configDir);

    }

    }

    Could you please let me know if there is some key-value pair that I have missed adding to my params map which is why my init is not working properly?

    Please do help.

    Thank you,
    Priyanka

  4. #4
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    541
    Hi Priyanka,

    Please let me clarify that if your intention is to test the Stock-List Demo Java Adapter you do not have anything to deal with remote adapters.
    Furthermore, the code you're writing is going in the wrong direction, you have no need of a Main java program that initializes the adapter, it is a tasks that is performed by the Lightstreamer server.

    Please follow the instructions of the install section of this README. Basically you have to copy the stocklist folder, you can find in the deploy.zip file, to the adapters folder under your LS_HOME and then start the server, launching the script located under "LS_HOME\bin", according to your operating system.

    At the start, the Lightstreamer server initialize the Adapter that is ready to be used by one of the demo client provided: Complete list of clients using this Adapter.

    Regards,
    Giuseppe

  5. #5
    Hey,

    So now I understand that I do not have to write a Main java program. So could you please help me with debugging of the Stock-List Demo Java Adapter? I have followed the steps posted by "Mone" in the following thread: http://forums.lightstreamer.com/show...-Lightstreamer. But once I remove the lib folder from the adapters/welcome_res/StockList folder in order to debug, do I have to make changes to the <adapter_class> inside my adapters.xml file since my path of the StockList project has now changed to my workspace of Eclipse?

    Sorry for the trouble. This is my first time with LighStreamer.

    Thank you,
    Priyanka

  6. #6
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    541
    Hi Priyanka,

    We have an updated post for how "Developing & Running an Adapter Set Using Eclipse".
    It refers to a new project for the Adapter, instead in your case, you should refer to your already existing eclipse project.

    Regards,
    Giuseppe

  7. #7
    Hey,

    Issue sorted finally!

    Thank you,
    Priyanka

 

 

Similar Threads

  1. Developing & Running an Adapter Set Using Eclipse [Java]
    By gianluca.finocchiaro in forum Adapter APIs
    Replies: 26
    Last Post: July 8th, 2019, 01:10 PM
  2. Replies: 1
    Last Post: April 17th, 2015, 10:59 AM
  3. bubbling exceptions from table listener?
    By sky.sanders@gmail.com in forum Client APIs
    Replies: 1
    Last Post: June 11th, 2012, 10:45 AM
  4. how to create Adapter Set
    By msgiribabu in forum Adapter APIs
    Replies: 2
    Last Post: January 31st, 2011, 12:32 PM
  5. non-display listener
    By EWANG in forum Client APIs
    Replies: 1
    Last Post: October 9th, 2009, 11:46 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 03:36 AM.