-
February 11th, 2011, 10:30 PM
#1
LS_Adapter
Hi
i have a project , where i am connecting to a java program and receive some data.
The Adapter is java class , i need to run two adapters with the same java class
to connect with two different programs to receive data it is possible that !!??
Like, the same java class for ONE ADAPTER and TWO PROVIDERS
or
TWO ADAPTERS
BUT ALWAYS THE SAME CLASS
<?xml version="1.0"?>
<adapters_conf id="DEMO_FEED">
<metadata_provider>
<adapter_class>
com.lightstreamer.adapters.metadata.LiteralBasedPr ovider
</adapter_class>
</metadata_provider>
<data_provider name="SOCKETLSADAPTER_A">
<!-- Optional. Specify a directory other than "."
for this Adapter's own class and configuration files. -->
<install_dir>SocketLSAdapter_A</install_dir>
<!-- Mandatory. Java class name of the adapter. -->
<adapter_class>stocklistdemo.adapters.StockQuotesD ata</adapter_class>
<!-- Set If Feed is Local or Remote a.[Local] b.[Remote] -->
<param name="hostIP">10.0.0.100</param>
<param name="bindPort">2000</param>
</data_provider>
<data_provider name="SOCKETLSADAPTER_B">
<!-- Optional. Specify a directory other than "."
for this Adapter's own class and configuration files. -->
<install_dir>SocketLSAdapter_B</install_dir>
<!-- Mandatory. Java class name of the adapter. -->
<adapter_class>stocklistdemo.adapters.StockQuotesD ata</adapter_class>
<!-- Set If Feed is Local or Remote a.[Local] b.[Remote] -->
<param name="hostIP">10.0.0.110</param>
<param name="bindPort">2000</param>
</data_provider>
</adapters_conf>
THANKS
-
February 14th, 2011, 09:49 AM
#2
Hi,
you can certainly use the same class to run two different data adapters;
you don't have to use two different install_dirs doing so, but you probably need to pass to them a parameter so that them can differentiate themselves in some way (I guess you don't need two data adapters that are one the clone of the other;
So your adapters.xml will look like this:
while the tree of your adapter will look like this:
LS_HOMEadapters
yourAdapter
lib
jarContainingYouAdapterClass.jar
This way Lightstreamer will create two instances of StockQuotesData passing to each of them the specified params.
From the client point view, you can specify the dataAdapter to let them subscribe to one or to the other instance.
HTH
-
February 18th, 2011, 09:45 AM
#3
LS Adapter
Hi thanks for the response
Look like load two times the class but is not working as i want
is connected only to one Feed Server , i have to check my java class to not conflict the variables
Thanks
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 11:44 PM.
Bookmarks