-
December 6th, 2006, 05:25 PM
#1
Forgive me if I misunderstand, but would this design not mean that multiple instances of the same MetaAdapter would overwrite eachother's stored data provider instance through MyDataProviderInstances.put(adapter_id,this)?
I need to communicate with the DataAdapter instance that provides the data to the particular MetaDataAdapter in question. Although all clients will be using the same DataAdapter, they will pass in different parameters through sendMessage that will cause each DataAdapter instance to send data that will differ based on this. I'm not sure that is possible with what you have suggested?
-
December 7th, 2006, 06:57 PM
#2
Each Adapter is made with 2 object's instances. A DataProvider instance and a MetadataProvider one.
To configure an Adapter you must create an adapters.xml file and put it under the adapters folder (refer to LS_HOME/DOCS-SDKs/sdk_adapter_java/examples/StockListDemo/Deployment_LS/README.TXT. for further details on how to deploy an adapter) In this file you choose the DataProvider class, the MetadaProvider class and it's also possible to set parameters to be passed to the class's instances.
Obviously you can use a class to create more Adapters. eg you have 2 adapters. Just set the 2 adapters.xml as follows:
The first one will use MyDataProvider as DataProvider and MyMetadataProvider as MetadataProvider.
Code xml:
<?xml version="1.0"?>
<adapters_conf id="ADAPTER_1">
<metadata_provider>
<adapter_class>my_package.MyMetadataProvider</adapter_class>
<param name="match_id">ADAPTER_1</param>
</metadata_provider>
<data_provider>
<adapter_class>my_package.MyDataProvider</adapter_class>
<param name="match_id">ADAPTER_1</param>
</data_provider>
</adapters_conf>
The other use MyDataProvider2 as DataProvider and MyMetadataProvider as MetadataProvider.
Code xml:
<?xml version="1.0"?>
<adapters_conf id="ADAPTER_2">
<metadata_provider>
<adapter_class>my_package.MyMetadataProvider</adapter_class>
<param name="match_id">ADAPTER_2</param>
</metadata_provider>
<data_provider>
<adapter_class>my_package.MyDataProvider2</adapter_class>
<param name="match_id">ADAPTER_2</param>
</data_provider>
</adapters_conf>
At this point you have 2 MyMetadaProvider instances and each one receives its match_id parameter.
so adapter_id is "ADAPTER_1" for the first instance and "ADAPTER_2" for the other.
Now with this call
Code java:
MyDataProviderInstances.put(adapter_id,this);
each MyMetadataProvider instance puts in the MyDataProviderInstances HashMap its reference with a different key (equals to the match_id received).
From the other side MyDataProvider an MyDataProvider2 instances get each one a different MyMetadataProvider instance.
Code java:
metadataAdapter = (MyMetadataProvider) MyMetadataProvider.MyDataProviderInstances.get(adapter_id);
Mone.
PS: I saw that on my previous post i fogot to instantiate MyDataProviderInstances. Sorry.
-
November 21st, 2008, 05:24 PM
#3
With the release of Lightstreamer Server v.3.5, the current thread has been replaced by this new thread: http://www.lightstreamer.com/vb/showthread.php?t=422
Similar Threads
-
By odeheurles in forum Adapter SDKs
Replies: 6
Last Post: January 26th, 2015, 09:50 AM
-
By vnipt in forum General
Replies: 3
Last Post: November 14th, 2011, 09:33 AM
-
By emese in forum Adapter SDKs
Replies: 1
Last Post: July 21st, 2011, 10:16 AM
-
By rd2008 in forum Client SDKs
Replies: 2
Last Post: January 7th, 2009, 02:28 PM
-
By chinghunglai in forum General
Replies: 2
Last Post: March 26th, 2008, 09:50 AM
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 05:28 AM.
Bookmarks