Active Data Service :
As name imply active data service is used to show the latest data on UI.
The main example is stock market where the value of the share is always changing therefore provide this type of feasibility oracle has introduced a mechanize which is called Active Data Service.
But before going to jump into the details about Active Data Service i would like to put some light on why do we really need active data service and how it is work in real scenario.
All the real time application now days are based on client server architecture. So there is two things
Always request is initiated by client for to performing operation on server and server will response as soon as possible .as long as the response come there is no any communication left between server and client.
Following picture depicts the relation ship between server and client .
To be honest the Active Data Service is huge and also it is bit complex.That is reason why i thought to start with simple.Since oracle has given one component that support the Active Data Service without doing any thing.By the way oracle also has give other component that support the Active Data Service but that require configuration and coding to make them work.
So for understanding the Active data service it is good to first understand about af:poll component which is based on the Active data Service however you can direct start learning the Active data service without knowing the af:poll components.
af:poll document is at following location
af:poll will run automatically and run at certain period of time or it will run periodically.
The server and client communication can happens following three type which are following
1-Push as know as HTTP stream
So af:poll is based on poll communication.Where client always should request to server after some period of time.
For one request server will response so there is no any more communication left and client need to initiate again new request.
In my next post i will go more depth in about above maintained approach.
Here it is clear that af:poll is based on the Poll approach.
For understanding the af:poll i have implemented following way
1-First i have created a page where i have inserted af:table and af:poll component.
And i am passing the table data using table through backing bean and also i attached poll event with backing bean
2-Passing value through backing bean
Here in backing bean i have refreshing whole adf table again and again in the pollListenerMethod method which automatically trigger after every five seconds
Although user has option to increase/decrease interval value as their need by the way default interval is 5000 mill second.
This sample example which is based on af:poll and af:poll is based on active data service .In Poll client will call server periodically based on what interval is given .
Nevertheless in my up coming post i would like to put more information on active data service.
Source code is present at following link
1-It is always call server which extra over head on server.
2-This approach is just for understanding about af:poll.If you executing binding again regardless if there is any change or not then it is not suitable .
3-Refereshing the whole pages or whole table obviously not correct.
1-For using af:poll does not require any extra coding since Adf servlet which is added by default in web.xml will take care.no extra code .
2-Through client side java script it will call server periodically .