+ All Categories

BlazeDS

Date post: 02-Jul-2015
Category:
Upload: priyank
View: 5,313 times
Download: 7 times
Share this document with a friend
Description:
An overview of the BlazeDS, an open source data services model.
17

Click here to load reader

Transcript
Page 1: BlazeDS
Page 2: BlazeDS

“ I a m a Du mb d e v e l o p e r ”

Page 3: BlazeDS

Th i n g s t o k n o w!

Data Connectivity Role of LCDS Data Management Web Service Remote Service ( RPC ?) Proxy Service JMS (pub-sub model) What’s that “I” in RIA?

Page 4: BlazeDS

Ga me b e g i n s !

What is BlazeDS? Java remoting and Messaging Technology. Enables developers to connect to back-end

distributed data and push data in real-time to Adobe Flex and Adobe AIR applications

Open Source From SOAP to AMF (Action Message Format) 10 times faster than XML based protocols, how? Previously known as Adobe LCDS

Page 5: BlazeDS

I n t e r a c t i o n wi t h RPC

Page 6: BlazeDS

Us i n g RPC c o mp o n e n t s

Instead of Contacting services, RPC components contact “Destinations”

Destination: Manageable Service Endpoints Managed using XML based configuration file “Remote Object” not possible without

BlazeDS Adobe Flash Player blocks request to any

external hosts, solution?

Page 7: BlazeDS

Un d e r s t a n d i n g RPC

Crossdomain.xml required ( For apps that are not using BlazeDS )

XML file that indicates Data and documents are available to SWF files

served from certain/all domains Must be in “web root” of the server

Page 8: BlazeDS

AMF – “ 1 0 t i me s f a s t e r ”

Compact binary format for data serialization/ deserialization and remote method invocation.

Object encoding controls how objects are represented in Action Message Format (AMF).

Representation that can be transferred over HTTP/HTTPS.

As data size increases the performance benefits of using BlazeDS increase exponentially.

Page 9: BlazeDS

F a s t , Ho w?

AMF improves performance by Dramatically compressing the size of data

transferred. Parsing binary data into objects in memory far

more efficiently than parsing XML data.

Page 10: BlazeDS

Qu i c k Br i e f

Message Agents Message Producers & Consumers Exchange messages through a common destination

Channel and endpoints Formats, Translates messages into network-specific form. Delivers to the endpoint (on the server) Server-Side Channel Unmarshals messages Configuration settings ( XML files) at runtime

Message Broker Routes messages to the appropriate service based on its

type Channel Types

Page 11: BlazeDS

Co n f i g u r a t i o n f i l e

Channel Configuration Configure channels using services-config.xml AMF protocol use an optimization technique Assign channel at runtime( AS Code) by creating a

ChannelSet object, and adding a channel to it. Var cs:ChannelSet = new ChannelSet(); Var channel:Channel = new AMFChannel(“name”,

endpoint) cs.addChannel(channel); Remoteobject.channelSet = cs;

Page 12: BlazeDS

Re mo t e Ob j e c t c o mp o n e n t

Access methods of server-side java objects. No need to specify 0bjects as operations in web

services Use RemoteObject component in MXML/AS Server - Proxied access to an RPC service Communication happens over a “destination” Configured in the remoting-config.xml

RPC method or URL, channel, adapter

Asynchronous communication AsyncToken object

Page 13: BlazeDS

Co n f i g u r e o t h e r S e r v i c e

Http Service and web service use proxy-service.xml Limit access to specific URL Provide Security

Page 14: BlazeDS

Th i n g s o v e r l o o k e d

How adapters are created? How serialization happens between AS and

Java? How to pass parameters to remote objects?

Use <mx:method>

How is data polled? Long Polling Polling Real-time polling

Page 15: BlazeDS

Co n f i g u r i n g Bl a z e DS

Tomcat Unzip the blazeds-turnkey file on to your C: drive Blazeds comes with Tomcat default. Create a new application: C:\blazeds\tomcat\webapps Copy & paste the META-INF, WEB-INF folder from the samples (zip) file. Store all your java class files in WEB-INF/classes folder Configure remoting-config.xml under WEB-INF/flex/ for all your remoting

related details (destinations) Create a <property/> and a specify a <source/>

Configure messaging-config.xml under WEB-INF/flex for all your messaging (real-time) by adding your destination

For all other service related details use the proxy-config.xml Give references of all these xml files in services-config.xml (done by

default) Run your application http://<localhost/ip>:<portno>/<appname>

Page 16: BlazeDS

Co n f i g u r e Bl a z e DS wi t h J b o s s Create a new project :

{jboss_root}/server/default/deploy Put your war/ear/sar folder here or create a folder

with “.war” type Include the META-INF & WEB-INF folder in the war Restart your server if it does not “Hot deploy” Run your application

http://<localhost/ip>:<portno>/<appname>

Page 17: BlazeDS

Hmmm… I d o n ’ t r e me mb e r a n y t h i n g ? ? Qu e s t i o n s ?


Recommended