Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Oct 2007
    Location
    Chattanooga
    Posts
    12

    Server.AdapterConfig

    To my custom Dataadapter, I need to pass in some parameters.
    So I use Server.AdapterConfig
    What is the format for the AdapterConfig file?
    Can I use the pass the below XML file to Server.AdapterConfig?
    <?xml version="1.0"?>

    <adapters_conf id="DWJMS">


    <metadata_provider>
    <adapter_class>com.lightstreamer.adapters.metadata .LiteralBasedProvider</adapter_class>
    </metadata_provider>


    <data_provider>
    <adapter_class> LSAdapters.Test.Lightstreamer.Adapters.DatawareAda pter</adapter_class>
    <param name="loggerName">c:\temp\StatusLog.txt</param>
    <param name="msgPoolSize">15</param>
    <param name="recoveryPauseMillis">2000</param>

    <!--EMS example configuration -->
    <param name="jmsUrl">tcp://dev:7222</param>
    <param name="initialContextFactory">com.tibco.tibjms.nami ng.TibjmsInitialContextFactory</param>
    <param name="topicConnectionFactory">TopicConnectionFacto ry</param>
    <param name="queueConnectionFactory">QueueConnectionFacto ry</param>
    <param name="topicName">topic.sample</param>
    <param name="queueName">tro.tibco.usage</param>

    <!-- JBoss Messaging example configuration -->
    <!--
    <param name="jmsUrl">jnp://localhost:1099</param>
    <param name="initialContextFactory">org.jnp.interfaces.Na mingContextFactory</param>
    <param name="topicConnectionFactory">ConnectionFactory</param>
    <param name="queueConnectionFactory">ConnectionFactory</param>
    <param name="topicName">topic/stocksTopic</param>
    <param name="queueName">queue/stocksQueue</param>
    -->

    </data_provider>

    </adapters_conf>

  2. #2
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    Hello,

    the AdapterConfig property of the MetadataProviderServer (in your example Server.AdapterConfig) is used to pass a configuration file to the init of the MetadataProviderAdapter instance but no operations are performed on that file.
    The AdapterConfig is expected to be a file path (but it could be any string) and it is passed as is to the MetadataProviderAdapter.
    So the MetadataProviderAdapter will receive a string containing the path passed as AdapterConfig. This means that the file should be parsed by custom code.

    An idea could be to parse the file early (eg in the StandaloneLauncher.cs) and pass it to the MetadataProviderServer instance (Server) as a list of properties in the AdapterParams property.

    Obviously this means that you can use any kind of file as the reading of it is up to your code.

    HTH.

  3. #3
    Member
    Join Date
    May 2010
    Location
    Belgaum
    Posts
    9

    How to read config file

    Hi Mone,
    We are using ibatis to persist data in database before pushing it to lightstreaner,
    but when i deploy adapter, i am getting following error, I think lightstreamer is not reading any config xmls, Please suggest how to go for this.

    Exception in thread "Thread-13" java.lang.NoClassDefFoundError: org/apache/ibatis/io/Resources
    at com.marketnews.mni.common.db.MyBatisInitializer.<c linit>(Unknown Source)
    at com.marketnews.mni.common.db.NewsItemDao.createNew sItem(Unknown Source)


    Even i tried to read Properties from .properties file, lightstreamer did not recognise the .properties file eventhogh the file was mentioned in classpath.

  4. #4
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,093
    As you are writing on the .NET Adapter API forum,
    it is unclear whether your are working with normal in-process java Adapters or with Remote Adapters.

    Assuming that you are using java adapters and that they access external libraries through some jar files,
    I confirm that any jar that is put in the adapter's lib folder or in the shared/lib folder is added to the classpath available to Adapter code;
    similarly, any class or other resource file that is put in the adapter's classes folder or in the shared/classes folder is available to Adapter code.

    You can ensure that the classes and resources that you placed in these folders are available by trying to load them (just for testing purpose) from inside your Adapter init method.
    If they still can't be seen by your external library, then try adding them to the global classpath, by modifying the JVM command line in the launch script (namely, LS.bat or LS.sh).

 

 

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 10:18 AM.
Lightstreamer Logo