-
February 12th, 2008, 07:14 PM
#1
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>
-
February 13th, 2008, 09:27 AM
#2
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.
-
July 6th, 2010, 12:43 PM
#3
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.
-
July 7th, 2010, 10:28 AM
#4
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).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
All times are GMT +1. The time now is 10:18 AM.
Bookmarks