1 / 54

Transparent Middleware ™

Transparent Middleware ™. Transparent Middleware, AO and EJB3.0 Marc Fleury, PhD. Founder and CEO JBoss, inc. Agenda. Middleware as a collection of aspects, custom middleware New Aspects EJB 3.0 JBoss: professional open source. Tangled code vs Untangled code.

yule
Télécharger la présentation

Transparent Middleware ™

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Transparent Middleware ™ Transparent Middleware, AO and EJB3.0 Marc Fleury, PhD. Founder and CEO JBoss, inc. The Professional Open Source™ Company

  2. Agenda • Middleware as a collection of aspects, custom middleware • New Aspects • EJB 3.0 • JBoss: professional open source The Professional Open Source™ Company

  3. Tangled code vs Untangled code • AO identifies aspects and gives programmers weaving semantics • Example of untangling: • A GUI with color syntax highlighting aspects in source is AO • It untangles code IN YOUR HEAD • Example tangled code: • EJB 2.0: programmers use interfaces and code abstract getters and setters. Intrusive programming model • Example untangled code: • EJB 3.0: programmers use POJOS and annotations. • Persistence by annotations, remoteness by annotations etc • AS TRANSPARENT AS IT CAN BE (POJO BASED) The Professional Open Source™ Company

  4. Transparent middleware • Impact of AO on middleware • Middleware offers services and aspects to programmers • How complex is it to apply an aspect to an objects • SIMPLIFICATION of programming models • Today middleware is mostly tangled specs • A component writer in EJB KNOWS about way to much system level issues • POJO based is the best we can do The Professional Open Source™ Company

  5. Cache Persistent data Clustered Remote webservice Cached model configuration Secure access Transacted Acid sessions Monitor data time (dynamic insertion) Monitor Model time Remote Invokers Clustering Security Transaction ACID Cache Monitoring Persistence JBoss Microkernel (JMX) Microkernel layer Application layer Aspect layer Service layer The Professional Open Source™ Company

  6. Metadata and Metatags • Aspect Configuration • Explicit through Xdoclet tags (later JSR-175) • Implicit through XML (deployable at runtime) • /** • * • * @@transaction(“RequiresNew”) • */ • public void somePOJOmethod() { … } • <class-metadata group=“transaction” class=“com.acme.POJO”> • <method name=“get.*”> • <trans-attribute>RequiresNew</transattribute> • </method> • </class-metadata> The Professional Open Source™ Company

  7. JBoss 4: Aspects a la carte • Middleware, by nature, is cross-cutting • Middleware implemented as Aspects allow for: • Smooth, fluid, iterative development • Clean separation between System Architect and Application Developer • Less upfront design decisions • JBoss 4 is Aspect-Oriented Middleware • Architectural decisions can be made later on in the development process • AOP makes iterative development more fluid The Professional Open Source™ Company

  8. JBoss 4:Dynamic AO • Dynamic AOP • Transactional, ACID, Objects. Our Transactional Cache • Replicated Objects. Our Distributed Cache • Optimized HTTP Session Replication • Remoting – choose at runtime, SOAP, RMI, Sockets, IIOP • Clustered Remoting – invocation failover • Use of Dynamic AO in JBossCache • POJO inserted into cache • Can become Transactional • Can become Replicated • Depends on Cache Configuration • Goal to have transparent ACID properties • Transparent Replication • No application coding for inserted Objects • Uses AOP Dynamic API • Requires “prepare” step via <advisable> • ALMOST COMPLETE TRANSPARENCY The Professional Open Source™ Company

  9. Interaction With Cache • tree = new TreeCacheAop();config = new PropertyConfigurator();// configure tree cache.config.configure(tree, "META-INF/replSync-service.xml");joe = new Person();joe.setName("Joe Black");joe.setAge(31);addr = new Address();addr.setCity("Sunnyvale");addr.setStreet("123 Albert Ave");addr.setZip(94086);joe.setAddress(addr); Use Pojos as Pojos The Professional Open Source™ Company

  10. Interaction With Cache • Joe’s state is automatically transactional and replicated • State replicated, synchronized at transaction commit/rollback • tree.start();  // kick start tree cachetree.putObject("/aop/joe", joe); // add aop sanctioned object • tx.begin();joe.setAge(41);joe.getAddress().setZip(95124);tx.commit(); The Professional Open Source™ Company

  11. JBossRemoting • Goals • Use POJOs not APIs • No extending of UnicastRemote • No precompilation (rmic) • Protocol independent • Protocol isolation • Designed after dotNetRemoting • Features • SOAP, Fact Socket, or RMI protocols available • Clustering: failover, loadbalancing The Professional Open Source™ Company

  12. Remoting/Clustered Remoting • Declare POJO remoted at runtime • Hooks into JBoss Remoting project (Jeff Haynie, Tom Elrod) • URI based protocols (soap, socket, rmi) • // Server • POJO remote = new POJO("hello"); • Dispatcher.singleton.registerTarget(“objName", remote); • // Client • POJO proxy = (POJO)Remoting.createRemoteProxy(“objName", • POJO.class, • “soap://localhost:8080"); The Professional Open Source™ Company

  13. Clustered Remoting • Invocation failover with any protocol • Invocation loadbalancing with any protocol • Leverages existing JBoss Clustering • POJO pojo = new POJO("hello"); • POJO proxy = (POJO)ClusteredRemoting.registerClusteredObject( • “objName", • pojo, • "DefaultPartition", • new RoundRobin(), • “socket://localhost:5150"); The Professional Open Source™ Company

  14. New Aspects: IoC, Observer • IoC is an aspect • Setting of references can be intercepted • Hook up of singleton, per VM • Per call, per lifecycle • Work done by Bill Burke in CVS • Observer/Observable is an aspect • Strong limitation of current J2EE. No observable pattern • Message or pooling based designs. • Need for JavaBeans “fireChange” • Template code was aspectized by Adrian Brock in CVS • Etc etc • Tight collaboration with academia on identification of new aspects for middleware. • Fast time to market in JBoss The Professional Open Source™ Company

  15. EJB 3.0: SIMPLIFICATION SIMPLIFICATION SIMPLIFICATION • Simple annotations • Systematic use of annotations to simplify programming • Eliminate need for XML deployment descriptors • Generation of interfaces if needed • Simple defaults • Systematic use of defaults • Configuration on exception only • Simple dependencies • Annotations • IoC, utility classes • Simple POJO programming model • No more homes, factory pattern • No more abstract getter/setter • Sessions can be remote, Entities are always local The Professional Open Source™ Company

  16. EJB3.0:TRANSPARENT PROGRAMMING • Simple CMP • POJO persistence • Entities are always local, use of new() POJO Model • Inheritance and polymorphism • No CMR • Simple and Powerful QL: • from EJBQL to HQL back to EJBQL again • Support for group-by, explicit inner and outer join, projections, bulk update and delete, dynamic queries, SQL queries • Close to HQL, SQL focus, ORDBMS focus unlike JDO • Simple callbacks • Implement only the callbacks you want • Simple testing • Testing behavior outside of a container • Work in progress • Sessions as application transaction, revolution for MVC designs • Detach-reattach? We recommend local and collocated designs • YOU ASKED FOR IT, YOU GOT IT The Professional Open Source™ Company

  17. EJB3 (simplified EJB) @Entity(table=“AUCTION”) public class Auction { @PK(column=“AUCTION_ID”, generator=“sequence”) private Long id; @Attribute private String description; @OneToMany(inverse=“auction” order-by=“DATETIME” cascade=ALL) private List<Bid> bids = new ArrayList(); @ManyToOne(fk=“SELLER_ID”) private User seller; //Getters and setters …… The Professional Open Source™ Company

  18. EJB3 (simplified EJB) …… @Attribute(formula=“SELECT MAX(B.AMOUNT) FROM BID B “ + “WHERE B.AUCTION_ID = AUCTION_ID”) private BigDecimal maxBidAmount; public BigDecimal getMaxBidAmount() { return maxBidAmount; } …… The Professional Open Source™ Company

  19. EJB3 (simplified EJB) …… public Bid bid(BidDecimal amount) { if ( !amount.greaterThan(maxBidAmount) ) return null; Bid bid = new Bid(amount, new Date(), this); bids.add(bid); return bid; } } The Professional Open Source™ Company

  20. EJB3 (simplified EJB) @Stateful(entityContext=INSTANCE, transaction=REQUIRES_NEW) public class BidForAuctionBean implements BidForAuction { @Inject EntityManager entityManager; private Auction auction; public Auction getAuction(Long id) { auction = (Auction) entityManager.get(“Auction”, id); return auction; } @Remove public void bidForAuction(BigDecimal amount) { return auction.bid(amount); } } The Professional Open Source™ Company

  21. Deployment descriptors No xml in 3.0 The Professional Open Source™ Company

  22. WEB WEB WEB WEB EJB EJB EJB EJB CACHE CACHE CACHE CACHE EJB3.0: new architecturesPeer to peer grids ORM DB The Professional Open Source™ Company

  23. JBoss inc Professional Open Source JBoss Group Small Consultancy JBoss inc evolution New Projects Production Support Developer Support Developer Tactical Enterprise Consulting Documentation Training 10/00 6/01 1/02 9/02 9/03 1/04 The Professional Open Source™ Company

  24. What is JBoss? • JBoss federates open source projects under the JBoss Professional Open Source ™ model • JBoss Inc. employs the lead developers of • JBoss Application Server: J2EE based • Tomcat • Hibernate • JBossCache/JGroups: • Nukes, • ? workflow, rules, new clients, connectors? • JBoss inc, the new safe choice • 24/7 Support • Indemnification • Certification – J2EE, JASP The Professional Open Source™ Company

  25. JBoss Group Customers “JBoss Group’s people are super-smart and could help us at the technical level we needed without us having to work our way through levels of support staff. Compared with our old vendor, we get great support for relatively low cost.” Jerry Shifrin, senior engineer, network management group, MCI (formerly WorldCom) The Professional Open Source™ Company

  26. CUSTOMERS The Professional Open Source™ Company

  27. JBoss numbers • A large community • 40,000 documentation sets sold • 500 contributors over time, 20 core (JBoss Inc) • INNOVATION INNOVATION INNOVATION • A standard in the market: #1 in development • More than 4M downloads in last two years alone • A standard in the market: #1 in OEM • Analyst private communication • A Standard for System Integrators #2 in growth • CRN survey puts JBoss certified consultant at #2 in fastest growing certification with large systems integrators • A standard in the market: # 3 in production • BZResearch survey. 13% in 2002, 27% in 2003, largest growth of all servers • JDJ survey: 70% of users go to Deployment. The Professional Open Source™ Company

  28. J2EE Update • JBoss has licensed the TCK for J2EE 1.4 • Work in progress • Founders Program • Partners who are helping JBoss with the Certification effort include • Borland • Iona • Intel • SchlumbergerSema • Unisys • WebMethods • Sonic The Professional Open Source™ Company

  29. Professional Open Source • Revenue from Services • Back Office model with EXPERTS (5% utilization) • Focus on quality of service as sole source of income • Attract & Retain Top Developers • Paid Open Source Development, boost to projects • Support is “developer to developers” • Commercial Quality Code • Control over the quality of source, dedicated resources • JBoss Group, the best support for JBoss • Direct and unique chain of control in open source: Support → Bug Fix → Next Version • Expand Services offering • Include support for Tomcat, hibernate and JavaGroup (JGroups) The Professional Open Source™ Company

  30. JBoss Production Support • Staffed with the lead developers of JBoss Inc. Projects • Enables quick problem resolution from EXPERTS • No navigating through levels of escalation • Prices range from $8,000 - $250,000 • Price determined by Service Level Agreement • Number of named projects • NO PER CPU COSTS • Eliminate procurement headaches • Eliminate tracking of licenses • Eliminate vendor audits • Eliminate architecture decision based on cost of CPU licenses The Professional Open Source™ Company

  31. JBoss Authorized Service Partner (JASP) Expand Partnerships & Channel • ISV and OEM • Systems Integrators • Systems Vendors • Partner does 1st / 2nd line JBoss does expert 3rd line • Leverage installed base of JBoss • Leverage existing partner channels to increase service coverage • Provide high level support with 1st line presence and 3rd line expertise. The Professional Open Source™ Company

  32. JBoss the projects • JBoss AS Full J2EE support, EJB, JMX, JMS, JCA, JAAS • Hibernate O/R Mapping solution. • Tomcat JSP/Servlet/Web server. • JBossIDE Eclipse integration, tag driven development. Debugging. • JBossCache Distributed data. • JGroups Reliable multicast and cluster communication • Nukes JBoss portal and CMS. • JBossAOP Aspect-Oriented Programming with JBoss 4.0. • Javassist Simple bytecode manipulation library The Professional Open Source™ Company

  33. Market Demand & JBoss Product Evolution • O/R Mapping • Portal • Byte Code Manipulation • … Aspects, J2EE 1.4 Developer Tactical Enterprise Clustering, Tomcat, Web Services Microkernel, JMX, J2EE API’s Application Server EJB JBoss Version 4.0 1.0 2.0 3.0 3.2 The Professional Open Source™ Company

  34. Service MBean Service MBean MBean Server Service MBean JMX Architecture (2/4) • Microkernel design • Independent cycling and loading • Hot Deployment of services and applications • Unified ClassLoaders, total Class visibility/cyclability • Service Archives (SARs) for easy configuration and net deployment Server JVM The Professional Open Source™ Company

  35. Deployers: Bringing in the Services Microkernel DeploymentScanner SARDeployer Transaction Service EARDeployer Message Service MainDeployer EJBDeployer Security Service Naming Service WARDeployer EJB Containers Data Sources *.xAR The Professional Open Source™ Company

  36. Microkernel benefits for SOA architecture • Microkernel approach ideal for ISV and OEM • Easily remove the services you don’t need • Tight footprint and modular codebase and hot deploy/remove/redeploy • JBoss is a TRUE Service Oriented Architecture (SOA) WAR 1 EAR 2 Application A Application B JAR 1 RAR 3 RAR 3 JAR 3 Microkernel Microkernel DeploymentScanner SARDeployer Transaction Service DeploymentScanner SARDeployer Transaction Service Security Service EARDeployer EARDeployer Message Service MainDeployer MainDeployer Naming Service EJBDeployer Security Service Data Sources Naming Service WARDeployer Custom SAR EJB Containers Data Sources Custom SAR *.xAR *.xAR The Professional Open Source™ Company

  37. Deployers: Working from the Network Machine 1 Machine 2 Microkernel Microkernel DeploymentScanner DeploymentScanner Load Services MainDeployer MainDeployer HTTP Scan HTTP Scan Deployment Packages Web Server Administrator The Professional Open Source™ Company

  38. Machine 1 Machine 2 Machine 3 Machine 6 Machine 5 Machine 4 Microkernel Microkernel Microkernel Microkernel Microkernel Microkernel DeploymentScanner DeploymentScanner DeploymentScanner DeploymentScanner DeploymentScanner DeploymentScanner MainDeployer MainDeployer MainDeployer MainDeployer MainDeployer MainDeployer Deployers: Working from the Network • Microkernels and netboot enable new grid control • Domain of applicability: Robot control, Storage area networks, Next generation routers • Mars Lander syndrome hardware ships with software • Burn kernel in flash ram • Deploy applications from centralized repository • Remote load at a later time • It changes the way robot/router grids are built, deployed and managed. Deployment Packages Web Server Administrator The Professional Open Source™ Company

  39. JBoss 3.x Series EJB • EJB 2.0 • No compiler approach (speed of development) • Externalized stack of interceptors (AOP) • Full CMP 2.0 engine migrating to Hibernate backend • Integration with Tomcat in memory • Advanced Security Server JVM EJB Container MBean RemoteInvoker Port 1234 Client JVM EJB Container MBean Typed Interface Invocation JMX Microkernel Client RemoteInvoker 011101010101 Port 4321 Service MBean Client Proxy The Professional Open Source™ Company

  40. An EJB Container • An EJB container is the sum of • Interceptors • Plugins per container • MBeans in the server Data Source Transaction Manager Microkernel Bean Lock Cache CMP Engine Security Transaction Lock Cache Connection Synchronization The Professional Open Source™ Company

  41. Client Authentication Overview ClientSide Client performs a login to establish principal and credentials Subsequent Bean method invocations include principal and credential with method info JBossServer JaasSecurityManager validates client principal and credentials by executing the JAAS LoginModule stack associated with the security domain name The Professional Open Source™ Company

  42. Security overview • The JBossSX framework includes a number of bundled login modules • Suitable for integration with standard security infrastructure store protocols such as LDAP and JDBC • Also includes standard base class implementations that help enforce the expected LoginModule to Subject usage pattern to help integrate your own authentication protocol. • The JBossSX framework includes an implementation of SRP that consists of the following elements: • An implementation of the SRP-3 handshake protocol • A client side JAAS LoginModule • A JMX MBean. It also establishes an authentication cache that is bound into the JBoss server JNDI namespace. • A server side JAAS LoginModule implementation that uses the authentication cache managed by the SRP JMX The Professional Open Source™ Company

  43. Web services in JBoss Overview: JBoss.net • Specifies how JBoss server components are exposed as Web service • Stateless Session Beans • Web components • POJO as servlet The Professional Open Source™ Company

  44. JBoss Hibernate Hibernate IS EJB 3.0 CMP CMP is an API and XML mappings Hibernate is the actual persistence engine Hibernate caches are being integrated with JBossCache Full distributed data with OR backend on one node The Professional Open Source™ Company

  45. Hibernate Part of JBoss full-time Gavin King and Christian Bauer on board Persistence for POJOs (JavaBeans) • Flexible and intuitive mapping • Support for fine-grained object models • Powerful, high performance queries • Dual-Layer Caching Architecture (HDLCA) • Support for detached objects (no DTOs) • Transparent Persistence • Automatic dirty checking • Transitive Persistence • Smart fetching and caching • Smooth migration to EJB3.0 • Consulting and support available as part of JBoss inc The Professional Open Source™ Company

  46. Tomcat 5.0.x improvements • Tomcat’s Remy Maucherat is on JBoss inc staff • Performance optimizations and reduced garbage collection • Optional standalone deployer (validation and precompilation of webapps) • Scalability and reliability enhancements • Complete server monitoring using JMX • Improved Taglibs handling, including advanced pooling and tag plugins • Embedding of Tomcat using JMX • Enhanced Security Manager support (now allows very restrictive policies) • Expanded documentation • Consulting and support available as part of JBoss inc The Professional Open Source™ Company

  47. Tomcat standalone or Tomcat inside JBoss ? • Better JBoss deployer • Hot deployment • Deployment of nested archives (EARs, SARs) • Redeployment • Automatic undeployment • Advanced clustering • Integrated J2EE stack within one VM • Deployment descriptor • Optimized local calls • Integrated security • AOP in JBoss 4.0 available in Tomcat components and webapps • Easy to use classloader • Nukes The Professional Open Source™ Company

  48. JBoss IDE • JBoss IDE is based on Eclipse. • Series of plugins for Eclipse • The debugging and monitoring of JBoss servers and the control of their life cycle (start/stop). • A very comfortable and sophisticated support for XDoclet • Support completion and generation • Support for AOP (completion and generation). • An easy way to configure and deploy the packaging layout of archives (packed or exploded) The Professional Open Source™ Company

  49. What Is JBossCache? • What is JBossCache? • A transactional replicated cache for JBoss with and without AOP (aspect-oriented programming) • A cache for frequently accessed elements • Stateful Session Beans, HTTPSession • Caches are used in a number of places in JBoss • This one provides a central cache service (MBean interface) • All access goes through the cache • Write-through (lazy or eager) • Reads only access the cache (very fast on cache hits) • Items not in the cache are loaded (e.g. from database) • Bounded size; old items are removed by eviction policy • Local (=non-replicated) and replicated caches • Replicated caches are the interesting part The Professional Open Source™ Company

  50. Feature • Transactions • All modifications done within TX, replication at TX commit. No replication on rollback • Locking • Access to nodes serialized by locks • Lock acquisition timeouts used for deadlock prevention • Replication • local: in-VM, no replication • repl-async: replication done on separate thread • repl-sync: replication done on user's thread, wait for all acks • All combinations supported • From local/no-tx/no-locking to repl/tx/locking • Ex: repl-async/no-locking/TX The Professional Open Source™ Company

More Related