This document discusses JBoss Application Server 5. It provides a brief history of JBoss AS and describes some of the key features and innovations in JBoss AS 5.0.x and 5.1.x, including the JBoss Microcontainer, Web Beans, and Embedded Jopr. It also mentions some ongoing work and highlights other areas like JBoss Messaging, clustering, and security. The document distinguishes JBoss AS from JBoss EAP and discusses how EAP is forked from stable versions of JBoss AS. It provides some web resources for following JBoss developments.
JBoss Application Server 5: Microcontainer and Web Beans Overview
1. JBoss Application Server 5
Alessio Soldano
JBoss Web Service Lead
JBoss, a Division of Red Hat
May 21th, 2009
2. Alessio Soldano
• JBoss WS[1] committer since early 2007
• JBoss / Red Hat employee since end of 2007
• JBoss Web Service Lead, 2008
• JBoss AS[2], JBoss Wise[3] contributor
• Current Red Hat representative at JSR-224 EG
[1] http://www.jboss.org/jbossws/
[2] http://www.jboss.org/jbossas/
[3] http://www.jboss.org/wise/
3. Agenda
• JBoss AS history
• Microcontainer overview
• Web Beans overview
• Embedded Jopr overview
• More features highlight
• Work in progress
• Q&A
4. JBoss AS history
JavaEE 5 certification, JDK5 & 6
JBoss AS 5.1
Beta1, CR1
J2EE 1.4 certification JBoss AS 5: Alphas, Betas, CRs
JDK 1.4 and finally 5.0.0.GA, 5.0.1.GA
JBoss Versions
JBoss AS 4.2.0 –
4.2.3
JBoss AS 4.0.0 – 4.0.5
JEE 5.0 compatible,
not certified (95% pass)
JDK5.0
JBoss AS 3.2.0 – 3.2.8
Time
2003 2004 2005 2006 2007 2008 2009
J2EE 1.3 certification, JDK 1.3
5. Recent JBoss AS innovation
• JBoss AS 5.0.x
– JavaEE 5 certified
– JBoss Microcontainer
– Major component upgrades
• JBoss AS 5.1.x
– Web Beans
– Embedded Jopr
– Further component upgrades
5.1.0.CR1 currently available,
5.1.0.GA coming soon!
6. JBoss AS 5: The big picture
Runtime components JBoss AS 5 Runtime
wired together by the MC
service.xml spring beans
with dependencies [and
.ear
aspects] applied across Aspectized User Applications
OSGi
component models!
.war … jboss-beans bundle
Support any component Component Deployers Enterprise Services
model that makes sense, Messaging OR Mapping
but do not get married to
Java EE
MBean
Spring
POJO
OSGi
it! Clustering WS
Security Web Server
Virtual Deployer Framework Transactions …
JBoss MicroContainer
JVM
7. JBoss Microcontainer
• Refactoring of JMX MicroKernel
– Service management
– POJO deployment
– Also standalone use
• A complete IoC framework
• Tight JBoss AOP integration
• Virtual deployment framework
– Deployment dependencies
– Structural deployers
Classloading
– Aspectized deployers Managed
– Deployment stages
• Fully extensible Deployers VFS
Reflection
Kernel
OSGi
MDR JMX Reliance
8. WebBeans – JSR299 RI (1)
Fill in a gap in JavaEE: shared component
among web tier and transactional tier.
JSR-299 defines a unifying dependency injection and
contextual lifecycle model for Java EE 6
• a completely new, richer dependency management model
• designed for use with stateful objects
• integrates the “web” and “transactional” tiers
• makes it much easier to build web applications using JSF and
EJB together
• includes a complete SPI allowing third-party frameworks to
integrate cleanly in the EE 6 environment
• provides a typesafe approach to dependency injection
JSR299 was heavily influenced by Seam and Google Guice.
The Expert Group is lead by Red Hat.
9. WebBeans – JSR299 RI (2)
What can be injected?
• Pre-defined by the specification:
– (Almost) any Java class
– EJB session beans
– Objects returned by producer methods
– Java EE resources (Datasources, JMS topics/queues,
etc)
– Persistence contexts (JPA EntityManager)
– Web service references
– Remote EJBs references
• Plus anything else you can think of!
10. WebBeans – Simple examples
@Current is the default
public class Printer { (built-in) binding type public class Hello {
public String hello(String name) {
@Current Hello hello;
return "hello" + name;
public void hello() { }
System.out.println( hello.hello("world") ); } Java Bean
}
} @Stateless
public class Hello {
public String hello(String name) {
public class Printer { return "hello" + name;
Mark the constructor to be
private Hello hello; called by the container }
} EJB 3
@Initializer
public Printer(Hello hello) { this.hello=hello; }
public void hello() {
System.out.println( hello.hello("world") );
}
}
Constructors are injected
by default; @Current is
the default binding type.
11. WebBeans – Names
@Named("hello") By default not available through EL.
public class Hello {
public String hello(String name) {
return "hello" + name;
}
} If no name is specified, then a
default name is used. Both these
beans have the same name
@Named
public class Hello {
public String hello(String name) {
return "hello" + name;
} <h:commandButton value=”Say Hello”
action=”#{hello.hello}”/>
}
JSF page
Calling an action on a bean through EL
12. WebBeans – Binding type
We specify the @Casual binding type,
otherwise @Current would be assumed
@Casual Creating a binding type is easy...
public class Hi extends Hello {
public String hello(String name) { public
@BindingType
return "hi" + name;
@Retention(RUNTIME)
} @Target({TYPE, METHOD, FIELD, PARAMETER})
} @interface Casual {}
public class Printer { Here we inject the Hello bean
@Casual Hello hello; and require an implementation
which is bound to @Casual
public void hello() {
System.out.println( hello.hello("JBoss") );
}
}
13. WebBeans – Deployment type
Same API, different implementation
@Italian
public class Buongiorno extends Hello {
Creating a deployment type is easy...
public String hello(String name) {
return "Buongiorno " + name; public
} @DeploymentType
} @Retention(RUNTIME)
@Target({TYPE, METHOD})
@interface Italian {}
<Beans>
<Deploy>
<Standard />
A strongly ordered list of enabled deployment types.
<Production>
Notice how everything is an annotation and so typesafe.
<i8ln:Italian>
</Deploy>
</Beans>
Only Web Bean implementations which have enabled
deployment types will be deployed to the container.
web-beans.xml
14. WebBeans – Much more...
• Scopes and contexts:
Loose coupling
– @SessionScoped
– @ConversationScoped
– @RequestScoped
Decouple technical concerns
– custom ... from business logic
• Interceptors: eg. @Transactional
• Events: Decouple event producers
from event consumers
– @Observes
– @Observable Allow business concerns
to be compartmentalized
• Decorators: @Decorator
• ...
15. Management console
Home page: http://jboss.org/embjopr
Demo: http://jboss.org/embjopr/demo
Simplified GUI, Seam based
• Deployment
• Configuration & monitoring
– Datasources
– Message queues
– User applications
• Available from JBoss AS 5.1.0.CR1
Target
• Non-JBoss-guru developers
• Admins
19. More JBoss 5.0.x/5.1.x highlights
• JBoss Messaging
– High performance JMS1.1 compliant provider, MANY
features...
• JBoss Clustering
– SFSB replication, MVCC, improved EJB3 caching, ...
• JBoss Web (Tomcat)
– High concurrency, performance improvements
• JBoss Transaction
– Bullet proof reliability
• JBoss Web Services
– Multiple ws stack integration including Apache CXF, Sun
Metro
• JBoss Security and Negotiations
– SPNEGO support, password encryption, ...
• ...
20. Work in progress
• EJB3.1 / Web Profile / Java EE 6
– JBoss AS 6 ?
• Complete OSGi support
– Facade on top of Microcontainer API, no NHI syndrome
• Component projects' roadmap
– Innovation in all fields
• Document, explain, blog, experiment, test-drive, have
fun and spread the word :-)
21. JBoss AS vs. JBoss EAP
• A Fedora/RHEL type of split for JBoss
• Community Project (JBoss AS)
– JBoss As We Know It
– Sponsored by JBoss/Red Hat
– Allow innovation at a faster pace
• Enterprise Application Platform (EAP)
– Forks the community project at stable points
– Integrates with JBoss Developer Studio / JBoss Operations
Network
– Rigorously tested (performance, scalability, SpecJ, etc.)
– Certified on 17 OS and JVM combinations, 5 DBs
– 3 month Cumulative Patch cycles
– Supported for 5 years.
22. Forking EAP from JBoss AS
Trunk
EAP 5
Fork
Branch_5_x
Branch_5_0 AS 5.1.0
2
P0
C
3
02
2_
AS 5.0.0 AS 5.0.1
4.
CP
4.
E AP
EAP 4.2 2
2
4.
Fork 4.
P
AP 01
EA
Branch_4_2
E CP
AS 4.2.0
AS
4.2.0
AS 4.2.1
AS 4.2.1 AS 4.2.2
AS 4.2.2
… AS 4.2.3...
23. Follow us on the web...
Some pages ...
http://www.jboss.org/ Blogs, Twitter, ...
http://www.jboss.org/feeds/
http://www.jboss.org/jbossmc/ http://twitter.com/JBossNews
http://www.seamframework.org/WebBeans
http://oddthesis.org/ ... or just use Google ;-)