Your SlideShare is downloading. ×
0
iBeans = dead-simple integration + web app development Ken Yagen Silicon Valley Code Camp, October, 2009
Agenda <ul><li>Introduction to Mule iBeans
Demo
How it works
Using iBeans
The Future of iBeans </li></ul>All contents Copyright © 2009, MuleSoft Inc.
What is an iBean? <ul><li>A way to access external services, Facebook, AWS, eBay
A well-defined interface to a hosted service </li></ul><ul><ul><li>‘ service’ can be public or internal to your company </...
A really easy way to create a reusable component </li></ul>All contents Copyright © 2009, MuleSoft Inc.
Introduction to Mule iBeans <ul><li>Dramatically simplified integration for web applications
Simple API using annotations
Works with JSP, JSF, Struts, Spring, JavaScript
Task-based integration, e.g.: </li></ul><ul><ul><li>Send/receive email
Subscribe to JMS queue
Poll RSS or Twitter feed
Publish REST service </li></ul></ul><ul><li>Open source
Based on Mule </li></ul>All contents Copyright © 2009, MuleSoft Inc.
Do we need another framework? <ul><li>Plenty of ESB/integration frameworks out there – </li></ul><ul><ul><li>Mule, Open ES...
Not much for the WebApp developers who just wants grab data quickly
Focus on:  </li></ul><ul><ul><li>Dead simple API
Reuse
Task-based integration </li></ul></ul>All contents Copyright © 2009, MuleSoft Inc.
Demo time All contents Copyright © 2009, MuleSoft Inc.
Upcoming SlideShare
Loading in...5
×

iBeans = Dead-simple integration for web app development

1,905

Published on

Why does integration always seem to be the most time consuming and tedious part of Web app development? Mule iBeans (http://www.mulesoft.org/ibeans) provides a dramatically simpler approach to integrating your applications with data sources and services. iBeans allows your webapps, using Java or Javascript, to interact with other webapps and services by providing a simple API and annotations that enable your webapp to perform common tasks. Whether you are building a “full-boat” SOA infrastructure or just need a simple point-to-point solution embedded in your web app, the Mule iBeans open source project can help. Learn how to integrate cloud services like twitter, flickr and google into your Java apps with virtually no code.

Published in: Technology, Business
1 Comment
0 Likes
Statistics
Notes
  • Would be very cool for someone to write an iBean for SlideShare's API (http://www.slideshare.net/developers). Should be an easy one and contribute it back to iBeans Central and get a nice iBeans fleece!
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

No Downloads
Views
Total Views
1,905
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
50
Comments
1
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "iBeans = Dead-simple integration for web app development"

  1. 1. iBeans = dead-simple integration + web app development Ken Yagen Silicon Valley Code Camp, October, 2009
  2. 2. Agenda <ul><li>Introduction to Mule iBeans
  3. 3. Demo
  4. 4. How it works
  5. 5. Using iBeans
  6. 6. The Future of iBeans </li></ul>All contents Copyright © 2009, MuleSoft Inc.
  7. 7. What is an iBean? <ul><li>A way to access external services, Facebook, AWS, eBay
  8. 8. A well-defined interface to a hosted service </li></ul><ul><ul><li>‘ service’ can be public or internal to your company </li></ul></ul><ul><li>A Java interface with annotated method
  9. 9. A really easy way to create a reusable component </li></ul>All contents Copyright © 2009, MuleSoft Inc.
  10. 10. Introduction to Mule iBeans <ul><li>Dramatically simplified integration for web applications
  11. 11. Simple API using annotations
  12. 12. Works with JSP, JSF, Struts, Spring, JavaScript
  13. 13. Task-based integration, e.g.: </li></ul><ul><ul><li>Send/receive email
  14. 14. Subscribe to JMS queue
  15. 15. Poll RSS or Twitter feed
  16. 16. Publish REST service </li></ul></ul><ul><li>Open source
  17. 17. Based on Mule </li></ul>All contents Copyright © 2009, MuleSoft Inc.
  18. 18. Do we need another framework? <ul><li>Plenty of ESB/integration frameworks out there – </li></ul><ul><ul><li>Mule, Open ESB, Camel, Spring Integration </li></ul></ul><ul><li>All feel SOA-influenced
  19. 19. Not much for the WebApp developers who just wants grab data quickly
  20. 20. Focus on: </li></ul><ul><ul><li>Dead simple API
  21. 21. Reuse
  22. 22. Task-based integration </li></ul></ul>All contents Copyright © 2009, MuleSoft Inc.
  23. 23. Demo time All contents Copyright © 2009, MuleSoft Inc.
  24. 24. How it Works <ul><li>Container-based approach </li></ul><ul><ul><li>iBeans bundled with Tomcat, not WebApp
  25. 25. Auto discovery </li></ul></ul><ul><li>Web Apps select services by adding servlet definitions
  26. 26. Full support for AJAX messaging and RPC
  27. 27. iBeans console used for updating and removing features
  28. 28. IBean and Application annotations
  29. 29. Modules for: Email, Scheduling, Atom, Jms, Rest, Ajax, Xml, Guice, Spring
  30. 30. Built with the cloud in mind </li></ul>Tomcat/Tcat Server/Mule Mule iBeans Web App 1 Web App 2 Web App 3 Cloud and data services All contents Copyright © 2009, MuleSoft Inc. iBeans Central Update Browse
  31. 31. The @Call and @UriParam Annotations public interface TwitterIBean { @Call (uri = &quot; http://www.twitter.com/statuses/show/{id}.json &quot;) String statusesShow( @UriParam (&quot; id &quot;) String id) throws CallException; } All contents Copyright © 2009, MuleSoft Inc.
  32. 32. The @State Annotation public interface TwitterIBean { @State void init( @UriParam (“ format ”) String format); @Call (uri = “ http://www.twitter.com/statuses/show/{id}.{format} ”) String statusesShow( @UriParam (&quot; id &quot;) String id) throws CallException; } All contents Copyright © 2009, MuleSoft Inc.
  33. 33. Static Defaults public interface TwitterIBean { @UriParam (“ format ”) static String DEFAULT_FORMAT = “ json ”; @State void init( @UriParam (“ format ”) String format); @Call (uri = &quot; http://www.twitter.com/statuses/show/{id}.{format} &quot;) String statusesShow( @UriParam (&quot; id &quot;) String id) throws CallException; } All contents Copyright © 2009, MuleSoft Inc.
  34. 34. The @ReturnType Annotation and Generic Types public interface TwitterIBean { @UriParam (“ format ”) static String DEFAULT_FORMAT = “ json ”; @State void init( @UriParam (“ format ”) String format, @ReturnType Class retType); @Call (uri = &quot; http://www.twitter.com/statuses/show/{id}.{format} &quot;) <T>T statusesShow( @UriParam (&quot; id &quot;) String id) throws CallException; } All contents Copyright © 2009, MuleSoft Inc.
  35. 35. Always provide sensible defaults public interface TwitterIBean { @UriParam (“ format ”) static String DEFAULT_FORMAT = “ json ” ; @ReturnType static Class DEFAULT_RETURN_TYPE = String. class ; @State void init( @UriParam (“ format ”) String format, @ReturnType Class retType); @Call (uri = &quot; http://www.twitter.com/statuses/show/{id}.{format} &quot;) <T>T statusesShow( @UriParam (&quot; id &quot;) String id) throws CallException; } All contents Copyright © 2009, MuleSoft Inc.
  36. 36. Testing the iBean public class TwitterIBeanTest extends AbstractIBeansTestCase { @IntegrationBean private TwitterIBean twitter; public void testTwitter() throws Exception { twitter.init(“ xml ”, Document. class ); Document doc = twitter.statusesShow(“ 1234567890 ”); } } All contents Copyright © 2009, MuleSoft Inc.
  37. 37. Other Annotations Annotation Description Type @HeaderParam Configures a header on the outgoing message Param, Field @PayloadParam Used for Http, configures a POST parameter Param @Payload Attaches data to the body of the message Param @State Will store values on the instance of the bean for later reference Method @PropertyParam Adds a property to the message that can be used later i.e. user/pass for authentication Param, Field All contents Copyright © 2009, MuleSoft Inc.
  38. 38. Transforming Response Data public class TwitterTransformers { @Transformer protected Status twitterXmlToStatus(Document doc) { String status = selectValue(&quot; /status/text &quot;, doc); String user = selectValue(&quot; /user/name &quot;, doc); return new Status(status, user); } } All contents Copyright © 2009, MuleSoft Inc.
  39. 39. public class TwitterIBeanTest extends AbstractIBeansTestCase { @IntegrationBean private TwitterIBean twitter; public void testTwitter() throws Exception { registerBeans( new TwitterTransformers()); twitter.init(“ xml ”, Status. class ); Status status = twitter.statusesShow(“ 1234567890 ”); } } Testing iBeans All contents Copyright © 2009, MuleSoft Inc.
  40. 40. Application Annotations Annotation Description Type @Schedule Cron scheduling for calling a method, can be used to poll channels Method @Receive Receive Data on a channel URI Method @Send Send the return of the method on a channel URI Method @ReceiveAndReply Receive Data on a channel URI and send the return back to the caller Method All contents Copyright © 2009, MuleSoft Inc.
  41. 41. @Schedule, @Send Example public class TwitterSchedule { @IntegrationBean private TwitterIBean twitter; @Schedule (interval = 5000) @Send (uri = &quot; ajax:///ibeans/ajax/twitter &quot;) public Document getTimeline() throws Exception { twitter.init(“ xml ”, Document. class ) return twitter.getPublicTimeline(); } } All contents Copyright © 2009, MuleSoft Inc.
  42. 42. iBeans Console All contents Copyright © 2009, MuleSoft Inc.
  43. 43. iBeans Shell <ul><li>Groovy-based iBeans shell
  44. 44. List, create iBeans
  45. 45. Get help for an iBean
  46. 46. Test an ibean really quickly </li></ul>All contents Copyright © 2009, MuleSoft Inc.
  47. 47. Topics we may not have covered <ul><li>Error Handling
  48. 48. ParamFactory for creating complex headers and parameters </li></ul><ul><ul><li>i.e. Amazon secure hash params for EC2 </li></ul></ul><ul><li>Using generic VariableType return types to allow users to set the data format
  49. 49. Authentication </li></ul>All contents Copyright © 2009, MuleSoft Inc.
  50. 50. The Future of iBeans <ul><li>Web Services support (JAX-RS)
  51. 51. Support for scripting in the console
  52. 52. Combine with Tcat for cloud development and provisioning
  53. 53. Centralized configuration (Mule Registry)
  54. 54. Mule 3.0 will be able to host iBeans
  55. 55. Support for other languages: Scala, Ruby, Clojure, etc
  56. 56. Could become the WCF for the JVM… </li></ul>All contents Copyright © 2009, MuleSoft Inc.
  57. 57. ??? <ul><li>Links for Mule iBeans: </li></ul><ul><ul><li>Homepage: http://www.mulesoft.org/display/IBEANS/Home </li></ul></ul><ul><li>Links for Tcat: </li></ul><ul><ul><li>Homepage: http://mulesoft.com/tcat </li></ul></ul><ul><li>About me: </li></ul><ul><ul><li>Blog: http://blog.mulesoft.org
  58. 58. Twitter: http://twitter.com/kenyagen
  59. 59. Company: http://mulesoft.com </li></ul></ul>All contents Copyright © 2009, MuleSoft Inc.
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×