blazeds

Post on 02-Jul-2015

5.313 Views

Category:

Economy & Finance

7 Downloads

Preview:

Click to see full reader

DESCRIPTION

An overview of the BlazeDS, an open source data services model.

TRANSCRIPT

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

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?

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

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

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?

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

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.

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.

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

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;

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

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

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

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>

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>

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 ?

top related