CDI Telco Framework and Aquillian             to the Sip Servlets platform      Annual Mobicents Community Summit         ...
Agenda● CDI Telco Framework  ○ Few words about CDI JSR-299  ○ CTF Introduction  ○ Examples  ○ Sip Servlets 2.0● Sip Servle...
CDI Telco FrameworkCDI JSR299, is the Java standard for dependency injection andcontextual lifecycle management. The CDI s...
CDI Telco FrameworkCTF brings the power and productivity benefits of CDI intothe Mobicents Sip Servlets platform providing...
CDI Telco Framework
CDI Telco FrameworkBenefits●   Loose coupling with strong typing●   Portable extensions●   Reusable components●   Enhanced...
CDI Telco FrameworkCTF Beanpublic class SimpleSipServlet {   @Inject   private SipFactory sipFactory;    protected void do...
CDI Telco Frameworkpublic class SimpleSipServlet {   @Inject   SipRegistarComponent sipRegistar;   @Inject   javax.enterpr...
CDI Telco FrameworkCurrent State and future plansCurrenlty CTF Core in Alpha version providing● Injection of Sip Servlet t...
CDI Telco FrameworkResources●   CDI-Telco-Framework web site - http://www.mobicents.org/mss/ctf/mss-ctf.html●   CDI-Telco-...
CDI Telco FrameworkSip Servlets 2.0The new JSR proposal for Sip Servlets 2.0 aims forenhancements and simplifications over...
MSS Arquillian containerArquillian testing framework, seeks to minimize the burdenon the developer to author integration t...
MSS Arquillian containerMobicents brings the Sip Servlets Arquilliancontainer for testing converged applications.● Contain...
MSS Arquillian containerExtras● Annotations   ○ @ContextParam   ○ @ContextParamMap   ○ @ConcurrencyControlMode● Helper cla...
MSS Arquillian container● Finer grained control over the tests lifecycle  and the containers lifecycle● Override container...
MSS Arquillian container● CTF can be optionally enabled in order to  enrich the test or the test archive.● On the same tes...
MSS Arquillian container<container qualifier="mss-tomcat-embedded-6" default="true" mode="manual">        <configuration> ...
MSS Arquillian container@RunWith(Arquillian.class)public class ShootistSipServletTest extends SipTestCase{@Deployment(name...
MSS Arquillian container    @Test @ContextParam(name="cancel", value="true")    public void testShootist() throws Exceptio...
MSS Arquillian containerWhat comes next:● Will be released soon in order to get community  feedback for missing features o...
ContactGeorge Vagenasgvagenas@gmail.comThank you
Upcoming SlideShare
Loading in …5
×

CDI Telco Framework & Arquillian presentation at Mobicents Summit, Sochi 2011

3,191 views

Published on

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
3,191
On SlideShare
0
From Embeds
0
Number of Embeds
1,486
Actions
Shares
0
Downloads
17
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

CDI Telco Framework & Arquillian presentation at Mobicents Summit, Sochi 2011

  1. 1. CDI Telco Framework and Aquillian to the Sip Servlets platform Annual Mobicents Community Summit Sochi-Russia, December 4-9, 2011George VagenasCDI Telco Framework project lead
  2. 2. Agenda● CDI Telco Framework ○ Few words about CDI JSR-299 ○ CTF Introduction ○ Examples ○ Sip Servlets 2.0● Sip Servlets Arquillian Container ○ Introduction to Arquillian ○ MSS Arquillian container ○ Examples
  3. 3. CDI Telco FrameworkCDI JSR299, is the Java standard for dependency injection andcontextual lifecycle management. The CDI services provide:● an improved lifecycle for stateful objects, bound to well- defined contexts● a typesafe approach to dependency injection● object interaction via an event notification facility
  4. 4. CDI Telco FrameworkCTF brings the power and productivity benefits of CDI intothe Mobicents Sip Servlets platform providing dependencyinjection and contextual lifecycle management forconverged HTTP/SIP applications.Mission Statement ● Simplify SipServlets development by introducing a clean programming model ● Extensibility is a major concern ● The framework will stand as an extension to the CDI core, thus making integration with other Java EE 6 technologies a breezeProjects home: CDI Telco Framework
  5. 5. CDI Telco Framework
  6. 6. CDI Telco FrameworkBenefits● Loose coupling with strong typing● Portable extensions● Reusable components● Enhanced event notifications mechanism● Out of the box integration with the rest of the Java EE ecosystem
  7. 7. CDI Telco FrameworkCTF Beanpublic class SimpleSipServlet { @Inject private SipFactory sipFactory; protected void doInvite(@Observes @Invite SipServletRequest req) { ... } protected void doSuccessResponse(@Observes @SuccessResponse SipServletResponse resp){ ... }}
  8. 8. CDI Telco Frameworkpublic class SimpleSipServlet { @Inject SipRegistarComponent sipRegistar; @Inject javax.enterprise.event.Event<String> event; protected void doRegister(@Observes @Register SipServletRequest req) { sipRegistar.doRegister(req); event.fire("Received Register event"); }}
  9. 9. CDI Telco FrameworkCurrent State and future plansCurrenlty CTF Core in Alpha version providing● Injection of Sip Servlet tools● Sip Event notification mechanismWhats coming next● Provide extensions with high level abstraction components● Integration with Media Server
  10. 10. CDI Telco FrameworkResources● CDI-Telco-Framework web site - http://www.mobicents.org/mss/ctf/mss-ctf.html● CDI-Telco-Framework introduction & Click2Call Example- http://blog.devrealm. org/2011/04/19/cdi-telco-framework/● CDI-Telco-Framework documentation - http://docs.jboss. org/mobicents/frameworks/ctf/1.0.0.ALPHA1/user_guide/en-US/html_single/
  11. 11. CDI Telco FrameworkSip Servlets 2.0The new JSR proposal for Sip Servlets 2.0 aims forenhancements and simplifications over the existing API.CDI Telco Framework could be a candidate technology tobe adopted in the new specification since the simplifiedprogramming model and the extensibility of the frameworkwill foster innovation and bring new ideas to thetechnology.
  12. 12. MSS Arquillian containerArquillian testing framework, seeks to minimize the burdenon the developer to author integration tests by handling allaspects of test execution, including:● managing the lifecycle of the container (start/stop),● bundling the test class with dependent classes and resources into a deployable archive,● enhancing the test class (e.g., resolving @Inject, @EJB and @Resource injections),● deploying the archive to test (deploy/undeploy) and capturing results and failures.
  13. 13. MSS Arquillian containerMobicents brings the Sip Servlets Arquilliancontainer for testing converged applications.● Container is based on Tomcat 6.x● Using SipUnit as SIP client ○ We are collaborating with CafeSip developers on the SipUnit project in order to provide new features, fix bugs etc.
  14. 14. MSS Arquillian containerExtras● Annotations ○ @ContextParam ○ @ContextParamMap ○ @ConcurrencyControlMode● Helper classes ○ ContextParamTool ○ SipStackTool● Lifecycle extension to provide finer grained control over containers and tests lifecycle
  15. 15. MSS Arquillian container● Finer grained control over the tests lifecycle and the containers lifecycle● Override container configuration as needed● The integration is completely transparent, which means you can launch the tests and get the test results using existing IDE, Ant and Maven test plugins without any add-ons.
  16. 16. MSS Arquillian container● CTF can be optionally enabled in order to enrich the test or the test archive.● On the same test we can have ○ Multiple test archives ○ Multiple container configuration
  17. 17. MSS Arquillian container<container qualifier="mss-tomcat-embedded-6" default="true" mode="manual"> <configuration> <property name="tomcatHome">target/mss-tomcat-embedded-6</property> <property name="workDir">work</property> <property name="bindHttpPort">8888</property> <property name="unpackArchive">true</property> <property name="sipConnectors">:5070,:5070/TCP</property> <property name="bindAddress">127.0.0.1</property> <property name="sipApplicationRouterProviderClassName">org.mobicents.servlet.sip.router.DefaultApplicationRouterProvider</property> </configuration> </container>
  18. 18. MSS Arquillian container@RunWith(Arquillian.class)public class ShootistSipServletTest extends SipTestCase{@Deployment(name="simpleArchive", managed=false) public static WebArchive createTestArchive(){ WebArchive webArchive = ShrinkWrap.create(WebArchive.class," shootistsipservlet.war"); webArchive.addClasses(ShootistSipServlet.class); webArchive.addAsWebInfResource("in-container-sip.xml", "sip.xml"); return webArchive; }
  19. 19. MSS Arquillian container @Test @ContextParam(name="cancel", value="true") public void testShootist() throws Exception { SipStackTool sipStackTool = new SipStackTool(); receiver = sipStackTool.initializeSipStack(SipStack.PROTOCOL_UDP,"127.0.0.1", "5080", "127.0.0.1:5070"); sipPhone = receiver.createSipPhone("127.0.0.1", SipStack.PROTOCOL_UDP, 5070, "sip:LittleGuy@there.com"); sipCall = sipPhone.createSipCall(); sipCall.listenForIncomingCall(); deployer.deploy("simpleArchive"); assertTrue(sipCall.waitForIncomingCall(timeout)); assertTrue(sipCall.sendIncomingCallResponse(Response.TRYING," Trying", timeout));
  20. 20. MSS Arquillian containerWhat comes next:● Will be released soon in order to get community feedback for missing features or bugs● Work on a Tomcat 7.x based container● Mobicents Sip Servlets testsuite will migrate to the new container
  21. 21. ContactGeorge Vagenasgvagenas@gmail.comThank you

×