Professional Documents
Culture Documents
• Impact of AO on middleware
Middleware offers services and aspects to programmers
How complex is it to apply an aspect to an objects
Transacted
Acid sessions Monitor Monitor
Model time data time
(dynamic insertion)
Application layer
Aspect layer
Service layer
Remote
Clustering Security Transaction ACID Cache Monitoring Persistence
Invokers
Microkernel layer
JBoss Microkernel (JMX)
The Professional Open Source™ Company
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
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
joe.setAddress(addr);
tx.begin();
joe.setAge(41);
joe.getAddress().setZip(95124);
tx.commit();
• 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
// Client
POJO proxy =
(POJO)Remoting.createRemoteProxy(“objName",
POJO.class,
“soap://localhost:8080");
• 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
@PK(column=“AUCTION_ID”, generator=“sequence”)
private Long id;
@Attribute
private String description;
@ManyToOne(fk=“SELLER_ID”)
private User seller;
……
No xml in 3.0
ORM
DB
New Projects
Production Support
Tactical
Developer Support
JBoss inc
Consulting Professional Open Source
Developer
Documentation
Training JBoss Group
Small Consultancy
• O/R Mapping
Enterprise
• Portal
• Byte Code Manipulation
• …
Application Server
EJB
• Microkernel design
Independent cycling and loading
MBean
MBean
Service
Service
Service
MBean Server
Transaction
DeploymentScanner SARDeployer
Service
Naming Service
WARDeployer
EJB Containers
Data Sources
*.xAR
WAR 1
Application A EAR 2 Application B
JAR 1
RAR 3
RAR 3 JAR 3
Microkernel Microkernel
Data Sources
*.xAR *.xAR
Custom SAR
Deployment
Web Server Packages
Administrator
• EJB 2.0
No compiler approach (speed of development)
Server
Externalized stack of interceptors (AOP) JVM
EJB Container
Full CMP 2.0 engine migrating to Hibernate backend MBean
Integration with Tomcat in memory
Advanced Security Port 1234
JMX Microkernel
RemoteInvoker
Client JVM EJB Container
Typed MBean
Invocati
Interface
on
011101010101
Client RemoteInvoker
Port 4321
Service
MBean
Client Proxy
Interceptors
Plugins per container
Microkernel
MBeans in the server
Bean CMP
Cache
Lock Engine
Synchronization
Transaction
Connection
Security
Cache
Lock
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
• Nukes
• 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
• 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
• Email: marc.fleury@jboss.com
• THANK YOU!