Upload
others
View
14
Download
0
Embed Size (px)
Citation preview
RIAs with Java, Spring, Hibernate, BlazeDS, and Flex
James Ward
www.jamesward.com
Technical Evangelist - Adobe#6662
CLIENT/ SERVERMAINFRAME
WEB APPLICATIONS
EASE
OF
DEP
LOY
MEN
T
Hard
Easy
Client CapabilityLimited Full
1992
1998
2004
RICH INTERNETAPPLICATIONS
Applications have evolved
Adobe’s Software Development Platform
Designer/ Developer Tools
Creative Suite 4
Flex Builder
Servers/ Services
ColdFusionLiveCycle Flash Media Server
AcrobatConnect
FlashCast Scene7
ApplicationsAdobeMediaPlayer
Frameworks
ClientsClient Runtimes Adobe
AIRFlash Player
BuzzwordAcrobatConnect
Ajax AdobeFlex 3
60 Day Free Trial
Free for studentsand educators
High PerformanceJIT’ ing VM:
Mozilla Tamarin
Open Source: MPL
Use any text editor / IDE
Open Bug Database:http:/ / bugs.adobe.com
Adobe AIR Application Stack
Cross- OS Applicat ion
IntegratedRendering
Integrated DOMs& Scripting
Flash
FlexActionScriptXMLAudioVideo
HTML
HTML
HTMLJavaScriptXMLCSS
Flash
Adobe AIR APIs
Mac, Windows, Linux & Device OS
File SystemAccess
NetworkDetect ion
Not ificat ionsApplicat ion
UpdateDrag and
DropLocal
Database...
MXML and ActionScript
XML/ HTTPREST
SOAP Web Services
How Flex Works
Browser
J2EE Application Server
BlazeDS orLC Data Services
Flash Player
Web Server
Exist ing Applications and Infrastructure
Flex Builder IDE
Flex SDK
MXML ActionScript
Flex Class Library
.swf
Compile
.swf
HTTP/ S AMF/ S RTMP/ SSOAP
Adobe AIR
Tour de Flex - flex.org/ tour
Flex with Java via XML (RESTful / SOAP)
Web Service
Client
App Server
XML
(RESTful / SOAP)
Introducing Open Source BlazeDS
Capabilit ies
> Easily connects Flex & AIR applications to exist ing server logic
> High performance data transfer for more responsive applicat ions
> Real- t ime data push over standard HTTP
> Full pub/ sub messaging that extends exist ing messaging infrastructure
Publication of the Action Message Format (AMF3) binary data protocol specif ication
Cert if ied builds, warranty protection and enterprise support subscript ions available
BlazeDS is the remoting and HTTP- based messaging technology which Adobe is contributing to the community under LGPL v3
BlazeDS
Data Management
RPC Services
Messaging
ServiceAdapters
Data Synchronization
Off- line Applicat ions
Data Paging
Web Service
HTTP Service
Remote Object Service
Publish & Subscribe
Collaborat ion
Real Time Data Push
Proxy Service
Web- tier Compiler
Portal Deployment
RIA- PDF Generation
LiveCycle
SQL
Hibernate
ColdFusion
JMS
Java
Custom…
http:/ / www.jamesward.com/ census/
Flex with Java via Remoting
BlazeDS
Spring Bean
Client
J2EE Server
POJO
EJB
Other
Endpoint
AMF
Flex with Java via Messaging
MessageService
BlazeDS
Adapter Y
Adapter X
MessagingSystem Y
MessagingSystem X
EndpointJMS
ProviderJMS Adapter
PublisherSubscriber
RTMPAMFHTTP
J2EE Server
Spring and Flex!
SpringSource and Adobe have formed a joint partnership to turn this idea into reality!
The foundations of this new integration will be available as open source
– A new Spring subproject in the web portfolio:
Spring BlazeDS Integration
Focus on integrating the open source BlazeDS with Spring
12
M1 - Dec 2008
Bootstrap the BlazeDS MessageBroker as a Spring- managed bean (no more web.xml MessageBrokerServlet config needed)
Route http- based Flex messages to the MessageBroker through the Spring DispatcherServlet
Expose Spring beans for remoting using typical Spring remoting exporter configuration
13
M2 - March 2008
Spring Security integration
– Ensure that Spring security can secure any Springmanaged endpoints with credentials provided by the Flex app
14
post M2Spring JMS integration
– Integration with the BlazeDS MessageService
– Use Spring configuration to manage BlazeDS MessageDestinations
– Let Spring manage the JMS details
– Allows easy communication from Flex clients to Spring message- driven POJOs
Spring 3.0 REST integration
– Provides support for multiple client- types
– Flex apps can already consume Spring 3.0 RESTful endpoints through HTTPService
– Addit ional value could be realized by providing an AMFView implementation
Response for HTTP requests w ith a ContentType= application/actionscript
web.xml< listener>
< listener-class> org.springframework.web.context.ContextLoaderListener< / listener- class>
< / listener>
< servlet>
< servlet- name> testdrive< / servlet- name>
< servlet-class> org.springframework.web.servlet.DispatcherServlet< / servlet- class>
< load- on- startup> 1< / load- on- startup>
< / servlet>
< servlet- mapping>
< servlet- name> testdrive< / servlet- name>
< url- pattern> / messagebroker/ *< / url- pattern>
< / servlet- mapping>
web.xml - Security Config< context- param>
< param- name> contextConfigLocation< / param- name>
< param- value>
/ WEB- INF/ config/ web- application- config.xml
/ WEB- INF/ config/ web- application- security.xml
< / param- value>
< / context- param>
< filter>
< filter- name> springSecurityFilterChain< / filter- name>
< filter- class> org.springframework.web.filter.DelegatingFilterProxy< / filter- class>
< / filter>
< filter- mapping>
< filter- name> springSecurityFilterChain< / filter- name>
< url- pattern> / *< / url- pattern>
< / filter- mapping>
web- application- config.xml< beans xmlns= "http:/ / www.springframework.org/ schema/ beans"
xmlns:flex= "http:/ / www.springframework.org/ schema/ flex"
xmlns:security= "http:/ / www.springframework.org/ schema/ security"
xmlns:xsi= "http:/ / www.w3.org/ 2001/ XMLSchema- instance"
xsi:schemaLocation= "
http:/ / www.springframework.org/ schema/ beans
http:/ / www.springframework.org/ schema/ beans/ spring- beans- 2.5.xsd
http:/ / www.springframework.org/ schema/ flex
http:/ / www.springframework.org/ schema/ flex/ spring- flex- 1.0.xsd
http:/ / www.springframework.org/ schema/ security
http:/ / www.springframework.org/ schema/ security/ spring- security- 2.0.4.xsd">
< flex:message- broker>
< flex:secured / >
< / f lex:message- broker>
web- application- config.xml - Remoting Beans < !- - Expose the productDAO bean for BlazeDS remoting - - >
< flex:remote- service ref= "productService" / >
< !- - A secured version of productService - - >
< bean id= "securedProductService" class= "flex.spring.samples.product.ProductDAO" >
< flex:remote- service/ >
< constructor- arg ref= "dataSource"/ >
< security:intercept- methods>
< security:protect method= "find*" access= "ROLE_USER" / >
< / security:intercept- methods>
< / bean>
Hibernate Integration
Either wrap beans by remoting Spring services / EJB Session Beans / POJOs...
public class Employee
public class EmployeeService
Or use dpHibernate
Or use LCDS’s Data Management Service
20
EJB Entity Beans and Session Beans21
The End
Questions?
Learn More:> Tour de Flex - f lex .org/ tour
> www.jamesward.com