28 diciembre 2008

dark side of the moon

All that you touch
And all that you see
All that you taste
All you feel
And all that you love
And all that you hate
All you distrust
All you save
And all that you give
And all that you deal
And all that you buy
Beg, borrow or steal
And all you create
And all you destroy
And all that you do
And all that you say
And all that you eat
And everyone you meet
And all that you slight
And everyone you fight
And all that is now
And all that is gone
And all that's to come
And everything under the sun is in tune
But the sun is eclipsed by the moon

"There is no dark side of the moon really. Matter of fact it's all dark."

The Great Gig In The Sky

The Great Gig in the Sky (El Gran Concierto en el Cielo) es la quinta canción del álbum The Dark Side of the Moon, de la banda británica Pink Floyd, editado en 1973. Reconocida por la interpretación vocal de Clare Torry.



Originalmente fue llamada The mortality Sequence (La Secuencia de la Mortalidad), The Religion Song (La Canción de la Religión) y Ecclesiastes (este nombre es previo a la inclusión en el disco, y se debe a que durante las interpretaciones en vivo, se leían parodias del Libro de Eclesiastés, de la Biblia).

Es una canción inspirada en la tristeza y la inminencia de la muerte, enfatizada por la voz protagonista de Clare Torry, Alan Parsons había trabajado con ella previamente y la llamó para sesionar. Cuando se disponían a grabar la voz, los Floyd dieron como únicas instrucciones a Torry: "Piensa en la muerte o en algo horrible y canta" La cantante, tras acabar, salió avergonzada y pidiendo disculpas; lo que sorprendió a los miembros de la banda, a quienes encantó su improvisación.

Roger Waters movía sus manos hacia arriba y hacia abajo indicando los tiempos y ritmo mientras grababan. Luego de tres tomas, se realizó la mezcla y quedó lista la edición. Pink Floyd unánimemente acordó en la inclusión de las tomas.

Las voces que se escuchan durante el tema son de Gerry Driscoll, portero de Abbey Road, quien recita "And I am not frightened of dying, any time will do I don't mind. Why should I be frightened of dying, there's no reason for it you've got to go some time" ("Y no tengo miedo de morir, cualquier momento está bien, no me importa. ¿Por qué debería tener miedo de morir?, no hay razón para ello, tienes que irte en algún momento."); y de Myfawny Watts, quien dice "I never said I was frightened of dying" ("Nunca dije que tengo miedo de morir.")

27 diciembre 2008

marillion - sugar mice


Qué temazo, hacía muchos años que no escuchaba a Marillion, cuando estaba en Manchester, pasaba noches enteras escuchando el album Misplaced Childhood, una auténtica obra de arte. Este tema es de otro album, pero se me abren las carnes cuando lo escucho.






Letra:


I was flicking through the channels on the TV
On a Sunday in Milwaukee in the rain
Trying to piece together conversations
Trying to find out where to lay the blame
But when it comes right down to it there's no use trying to pretend
For when it gets right down to it there's no one here that's left to blame
Blame it on me, you can blame it on me
We're just sugar mice in the rain

I heard Sinatra calling me through the floorboards
Where you pay a quarter for a partnership in rhyme
To the jukebox crying in the corner
While the waitress is counting out the time

For when it comes right down to it there's no use trying to pretend
For when it gets right down to it there's no one really left to blame
Blame it on me, you can blame it on me
We're just sugar mice in the rain

'Cos I know what I feel, know what I want I know what I am
Daddy took a raincheck
' Cos I know what I want, know what I feel I know what I need
Daddy took a raincheck, your daddy took a raincheck
Ain't no one in here that's left to blame but me
Blame it on me, blame it on me

Well the toughest thing that I ever did was talk to the kids on the phone
When I heard them asking questions I knew that you were all alone
Can't you understand that the government left me out of work
I just couldn't stand the looks on their faces saying, "What a jerk"

So if you want my address it's number one at the end of the bar
Where I sit with the broken angels clutching at straws and nursing our scars
Blame it on me, blame it on me,
Sugar mice in the rain, your daddy took a raincheck

Maven Guide

Maven Guide

Using Maven properly might be a challenge to new developers and even experienced developers may sometimes overlook some of the features or implications of using maven. Although there is lots of documentation that can be found on the internet we aim to provide the essentials in our own Maven Guide.



This guide is based on our own experience and the problems that we encountered ourselves. Any questions or suggestions are welcome, just drop us an email.

seam-gen maven

Adding Seam as a Maven 2 dependency


Seam and Maven 2



jboss-seam-gen



Managing the dependencies of a seam-gen project with Ivy


Seam published to Maven



Links interesantes de Seam-gem

seam-gen: seam generator
¿qué es seam? http://seamcity.madeinxpain.com/archives/31
biyection: http://seamcity.madeinxpain.com/archives/28
conversaciones: http://seamcity.madeinxpain.com/archives/29
configuración de seam: http://seamcity.madeinxpain.com/archives/30
programación orientada a aspectos: http://ejemplos-seam.blogspot.com/2007/07/crear-estadisticas-en-seam-con.html


JSF+Facelets+Seam+Hibernate+JBoss Microcontainer Archetype

JSF+Facelets+Seam+Hibernate+JBoss Microcontainer Archetype

Seam Archetype

For creation skeleton of your project use this command (on one line):

mvn archetype:create -DarchetypeArtifactId=softeu-archetype-seam -DremoteRepositories=http://maven.softeu.cz/
-DgroupId=cz.softeu.test -DartifactId=helloApp3

Description of the content in czech: Začínáme s Webovými stránkami v Javě 2

When it is generated you can start it using:

mvn jetty:run

It integrate this technologies:

Other archetypes

We provide more archetypes:

Good luck!

If you have any questions contact me - Petr Ferschmann - pferschmann (-at-) softeu (-dot-) com

Seam Maven integration

Usage of Seam Maven integration

Archetype:

We recommend using our Seam Archetype.

By running this command you will get template for your project.

    mvn archetype:create  -DarchetypeArtifactId=softeu-archetype-seam \
-DremoteRepositories=http://maven.softeu.cz/ \
-DgroupId=cz.softeu.test -DartifactId=helloApp

Read README.txt inside the generated project.

Modify profiles.xml and jdbc.properties and configure it for your environment (DB + Container).

Now you can use Maven Seam plugin (similar to SeamGen):

    mvn seam:new-entity
mvn seam:new-action
mvn seam:new-form
mvn seam:new-conversation

Note: mvn seam:generate-entities doesn't work yet.

Seam Examples

You can download few Seam examptes that I converted to using Maven:

Using by hand

Add our Maven repository to your repositories in pom.xml:



softeu-repo
http://maven.softeu.cz/

And add dependency on your chosen profile(s)


jboss.seam.profiles
seam-facelets
1.1.6.GA
compile

Web Beans 1.0.0.ALPHA1 released!

I'm pleased to announce the release of the Web Beans RI 1.0.0.ALPHA1. This release implements the core of the JSR-299 Web Beans specification and represents a major milestone on the road towards the GA release. Some of the highlights of this release include simple and enterprise Web Beans, support for JBoss Application Server 5, typesafe injection, events and producer methods. There's an exhaustive list below.

The release also includes three examples, a full EE example, with enterprise beans, a war example with simple beans and the login example from the reference docs. To learn more about Web Beans I suggest you read the reference guide or browse seamframework.org.

This release wouldn't have been possible without the sterling work of a number of people. In alphabetical order, thanks go to: David Allen (events and much more), Nik Karlsson (enterprise beans, contexts and much more), Ales Justin (JBoss Microcontainer integration) Gavin King (oversight, documentation) and Andrew Lee Rubinger (JBoss EJB3 integration).

In detail, this release provides support for:

  • support for simple Web Beans
  • support for enterprise Web Beans and enterprise bean remove methods
  • typesafe and name based resolution
  • producer methods
  • producer fields
  • the dependent context
  • support for JBoss 5
  • the servlet contexts: application, session and request
  • Field and constructor injection
  • @Initializer methods
  • Event support (firing and observing events)
  • definition of observer methods through annotations
  • injection of event producers
  • conditional events
  • stereotypes
  • Support for lifecycle callbacks (@PostConstruct and @PostDestroy)
  • an SPI to integrate with other containers

There is also a preview of support for:

  • the login example from chapter 2 of the reference guide
  • transactional observers
  • dynamic lookup through @Obtains
  • specialization

We'll be moving fast over the next few weeks to deliver ALPHA2, and then BETA1 (which will be feature complete). Watch this space!

[Download] [Reference Documentation] [JIRA] [Release Notes]

JBoss Tools 3 CR

From all of us to all of you a very merry Candidate Release of JBoss Tools 3.


[Download] [Update Site] [What's'New] [Movies] [Documentation] [Forums] [JIRA]

Requirements

This release will only work with Eclipse 3.4/Web Tools Ganymede. Because of an Eclipse bug we recommend to use Web Tools 3.0.3.

Highlights

With 360+ bugfixes and enhancements this release is mostly a bugfix release.

There is though a couple of Christmas features in there:

  • JMX tools contribution from Jeff Mesnil which provides nice JMX explorer and editor for JBoss AS and any other applications with JMX support.
  • The updated library locations in JBoss AS 5 is also now supported, allowing you to start using Seam WTP projects on JBoss 5
  • A small, but much voted for feature in Hibernate Tools namely one-to-one support was also added.
  • Support for upgrading/downgrading Seam versions
  • ...and more. Screenshots and detailed news is in What's'New.

Update site

Thanks to Nick our updatesites are now also optimized for p2 (Eclipse 3.4 new update manager) and packed with pack200 allowing for faster dependency resolution and smaller bandwidth usage. If you have any issues with the updatesite let us know, but be aware that we know the Birt Eclipse mirrors sometimes timeout giving an annoying error. The resolution for this is to try again (to hopefully catch a better mirror) or simply not select the Birt feature if you don't need it.

Feedback

Now is the time to provide final feedback for version 3, no major new features is planned to go in but we really like to hear about both good features and bad bugs you find to make sure the next release will be the possible GA release. It is much appreciated and we are ready to hear more in the Forums and JIRA

Have fun and happy holidays from the JBoss Tools development team

Seam 2.1.1.GA is out

It looks like we can add to the Christmas cheer by announcing that Seam 2.1.1 is now out. Seam 2.1.1 is largely a bug-fix release, with a number of notable performance improvements, especially around hot deploy. We've added support for PDF forms to the iText integration as well as OpenID support. Seam-gen now generates IntelliJ IDEA projects. And, I should also point out that we've changed a few of the URLs on examples to match up better with the example names. If you are developing on Seam 2.1, you should consider upgrading quickly to get the latest fixes.

[Download] [Reference Documentation] [JIRA] [Release Notes] [Migration Guide]

25 diciembre 2008

JBoss Seam Support For GWT

Google Web Toolkit and Red Hat's JBoss Enterprise Middleware Enable Next Generation Web Application Development
Red Hat and JBoss Empower Developers through Support for Google Web Toolkit and Other Popular Frameworks

Raleigh, NC – December 11, 2008 - Red Hat (NYSE: RHT), the world’s leading provider of open source solutions, today announced that the company has signed the Google Contributor Agreement. The agreement brings Red Hat’s world-class developer and production support to Google Web Toolkit (GWT) as well as support for JBoss, the global leader in open source middleware software.

Launched in 2006, GWT is an open source project that helps Java developers harness the richness of AJAX in a cross-platform, web-friendly environment. The mission of Google Web Toolkit is to radically improve the web experience for users by enabling developers to use existing Java tools to build no-compromise AJAX for any modern browser. GWT has emerged as a popular Java software development platform for developers creating sophisticated, high performing web applications, as it provides a rich experience that traditional UI technologies for Java EE cannot deliver.

In addition to signing the Contributor Agreement, Red Hat announced that the company has completed some preliminary integration with GWT and the JBoss Seam Framework. Through the integration, Red Hat is leveraging Seam’s open and pluggable architecture so that developers can easily combine the power of enterprise Java with the modern view-layer technologies like GWT, RichFaces and Spring to develop Rich Internet Applications.

“The flexible and open architecture of Seam 2.0 made this integration possible,” said Craig Muzilla, vice president of Red Hat’s middleware business. “By uniting with Google on this project, we’re not only thinking beyond the traditional confines of Java EE, but we’re also bringing choice and value back to developers. It isn’t up to us to dictate what type of frameworks and technologies developers should use, and we’re committed to providing the best possible operational platform for the technologies developers find most useful. GWT is certainly one of our first choices; but we're also looking to leverage our flexible architecture to support other popular technologies like Spring and Flex in the same way.”

The announcement continues Red Hat’s history of partnership with Google on a number of initiatives. Most recently, Google selected a combined group from the Fedora Project and JBoss.org Community as a mentoring organization for the Google Summer of Code 2008, a program that offers student developers stipends to write code for open source projects. In 2007, Red Hat introduced JBoss Portal integration with Google Gadgets, enabling developers to easily add pre-built Google Gadget components onto a portal, and Google announced the open source availability of Hibernate Shards, a framework developed by Google software engineers that adds support for horizontal partitioning to JBoss Hibernate Framework.
"We're extremely happy to be working with Red Hat to ensure that developers can easily work with Google Web Toolkit and the JBoss Seam Framework," says Bruce Johnson, Google Engineering Manager and co-creator of Google Web Toolkit. "We want developers to easily use Google developer products with their favorite Java programming tools, and this is yet another step in that direction."

In the coming months, Red Hat will provide support for Google Web Toolkit as part of the JBoss Enterprise Application Platform subscription.

22 diciembre 2008

loteria

numero loteria navidad mr: 28674 serie 43 fraccion 1

todo

para esta semana:

  • ver con Antonio los tracks disponibles y comentar que trac parece el más idóneo (con subversion)
  • ver con Antonio si merece la pena hacer los templates con maven2 (y crear repositorios internos propios, que es muy ventajoso)
  • seguir con los ejemplos del documento maven-definitive-guide.pdf (chapter 4.- customizing a maven project)
  • crear un repositorio propio (puede servir como primer ejemplo un repositorio para las versiones de las librerías de seam, de jboss tools y de jsf)

21 diciembre 2008

Secret Worlds: The Universe Within

Molecular expressions


View the Milky Way at 10 million light years from the Earth. Then move through space towards the Earth in successive orders of magnitude until you reach a tall oak tree just outside the buildings of the National High Magnetic Field Laboratory in Tallahassee, Florida. After that, begin to move from the actual size of a leaf into a microscopic world that reveals leaf cell walls, the cell nucleus, chromatin, DNA and finally, into the subatomic universe of electrons and protons.


Open Source Issue Tracking Software in Java

Open Source Issue Tracking Software in Java

objetivo:
comparación de trackers para el proyecto Hermes
  • requisitos:
  1. desarrollado en Java
  2. sencillo de administrar

opciones:

18 diciembre 2008

Billy Bragg - Waiting For The Great Leap Forwards

Billy Bragg tocó en directo solo con su guitarra una nueva versión de Waiting For The Grat Leap Forwards, impresionante tema del eterno trovador libertario que escuché por primera vez hace un montón de años.

La versión original:




Great Leap Forwards hace referencia al Great Leap Forwards (gran salto adelante) de Mao en China

Esta versión fue realizada en mayo de 2007 en The Henry Rollins Show, conducido por el emblemático vocalista de Black Flag, en donde Bragg sólo con su guitarra electrica revitaliza la canción con modificaciones en la letra -con guiños a MTV y a Donald Rumsfeld-.

La letra original:

It may have been camelot for jack and jacqueline
But on the che guevara highway filling up with gasoline
Fidel castros brother spies a rich lady whos crying
Over luxurys disappointment
So he walks over and hes trying
To sympathise with her but he thinks that he should warn her
That the third world is just around the corner

In the soviet union a scientist is blinded
By the resumption of nuclear testing and he is reminded
That dr robert oppenheimers optimism fell
At the first hurdle

In the cheese pavilion and the only noise I hear
Is the sound of someone stacking chairs
And mopping up spilt beer
And someone asking questions and basking in the light
Of the fifteen fame filled minutes of the fanzine writer

Mixing pop and politics he asks me what the use is
I offer him embarrassment and my usual excuses
While looking down the corridor
Out to where the van is waiting
Im looking for the great leap forwards

Jumble sales are organised and pamphlets have been posted
Even after closing time theres still parties to be hosted
You can be active with the activists
Or sleep in with the sleepers
While youre waiting for the great leap forwards

One leap forward, two leaps back
Will politics get me the sack?

Here comes the future and you cant run from it
If youve got a blacklist I want to be on it

Its a mighty long way down rock n roll
From top of the pops to drawing the dole

If no one seems to understand
Start your own revolution and cut out the middleman

In a perfect world wed all sing in tune
But this is reality so give me some room

So join the struggle while you may
The revolution is just a t-shirt away
Waiting for the great leap forwards



Aquí está la sorprendente versión nueva:





La letra de esta nueva versión:




It may have been Camelot for Jack and Jacqueline
But on the Hugo Chavez highway filling up with gasoline
Little Donald Rumsfield spies a rich lady who's crying
Over luxury's disappointment, so he goes over and he's trying
To sympathise with her but he thinks that he should warn her
To prepare to be bombed back into the Stone Age

In the former Soviet Union the citizens demand
To know why they are still the target of Strategic Air Command
And they shake their fists in anger and respectfully suggest
We take the money from our missiles and spend them on our hospitals instead (yeah)

The Cold War now is over but the stakes are getting higher
I'm frightened of collateral damage and of friendly fire
And I don't think we can defeat no Axis of Evil
By putting 'smart bombs' in the hands of dumb people

Mixing Pop and Politics they ask me what the use is
I offer them my acupuncturist and massueuses
While looking down the corridor
Out to where my ego is waiting
I'm looking for the New World Order (yeah)

Jumble sales are organised, all my mates got fat
Even after all this time you know you can still send me a fax
You can be active with the activists or sleeping with the media
While you're waiting for the Great Leap Forwards

Oh, one leap forward, two leaps back
Will YouTube give MTV the sack?
Waiting for the Great Leap Forwards

Well here comes the future and you can't run from it
If you've got a website I want to be on it
Waiting for the Great Leap Forwards

In a perfect world we'd all sing in tune
But this is reality not fucking Pop Idol
Waiting for the Great Leap Forwards (yeah)

So join the struggle while you may
The Revolution's just an ethical haircut away
When you're waiting for the Great Leap Forwards


17 diciembre 2008

How to use Hibernate with Seam

How to use Hibernate with Seam

I want to learn how to use Hibernate with Seam!

First, familiarize yourself with basic Seam concepts by following the Seam Getting Started Guide. Now, if you decide to use Seam with plain Hibernate (instead of EJB 3.0), follow the example application in the examples/hibernate directory of the Seam distribution. Alternatively, read the last chapter ("Introducing JBoss Seam") of the book Java Persistence with Hibernate.

JBoss Microcontainer

JBoss Microcontainer

The Java EE 5 Tutorial

The Java EE 5 Tutorial

This tutorial is a guide to developing enterprise applications for the JavaTM Platform, Enterprise Edition 5 (Java EE 5).

This preface contains information about and conventions for the entire Sun Java System Application Server documentation set.

JBoss AS 5 Administration And Configuration Guide

Administration And Configuration Guide

This book is a guide to the administration and configuration of the JBoss Application Server 5.

16 diciembre 2008

JOPR

Para sustituir la triste consola de JBoss AS tenemos JOPR

Para un solo servidor, es mejor el Embedded Jopr

justin.tv

Para ver tv por la red: justin.tv

15 diciembre 2008

DownloadHelper tutorial videos

http://www.downloadhelper.net/tutorials.php

14 diciembre 2008

2see

Seam_Reference_Guide.pdf
4.2 Seam Interceptors
4.3 Managing exceptions

24 Expression Language Enhancements

DDDQuicklyOnline (pdf)
page 65 Refactoring toward deeper insight

About not using SFSB...

Last friday a light conversation about how to design the Hermes application took place. One point was about not using SFSB's at all, just stateless session beans. If no any SFSB is used in the project, some stuff comes to my mind:


  • On the booking example can be read the following (view/exp/bookingExp.html):




    The hotel booking "wizard" is implemented by a conversation-scoped stateful session bean. All Seam components are in the conversation scope by default. The HotelBookingAction maintains state associated with the booking process in the Seam conversation scope. This ensures that if the user is working in multiple brower tabs or multiple brower windows, the various conversations are completely isolated from each other.



    By not using SFSB's ¿will we miss the ability to mantain the state associated with the booking process in the seam conversation scope?



  • The idea of an application transaction with optimistic semantics, and the realization that existing frameworks based around a stateless architecture could not provide effective management of extended persistence contexts. (The Hibernate team is truly fed up with copping the blame for LazyInitializationExceptions, which are not really Hibernate's fault, but rather the fault of the extremely limiting persistence context model supported by stateless architectures such as the Spring framework or the traditional stateless session facade (anti)pattern in J2EE.)


    * extracted from Conversations and workspace management (Seam_Reference_Guide.pdf)


Entity beans

2.3. Entity beans

Entity beans may be bound to a context variable and function as a seam component. Because
entities have a persistent identity in addition to their contextual identity, entity instances are
usually bound explicitly in Java code, rather than being instantiated implicitly by Seam.
Entity bean components do not support bijection or context demarcation. Nor does invocation or
an entity bean trigger validation.

Entity beans are not usually used as JSF action listeners, but do often function as backing
beans that provide properties to JSF components for display or form submission. In particular,
is common to use an entity as a backing bean, together with a stateless session bean action
listener to implement create/update/delete type functionality.

By default, entity beans are bound to the conversation context. They may never be bound to the
stateless context.

Note that it in a clustered environment is somewhat less efficient to bind an entity bean directly
to a conversation or session scoped Seam context variable than it would be to hold a reference
to the entity bean in a stateful session bean. For this reason, not all Seam applications define
entity beans to be Seam components.

Repositories

Repositories

A Repository is purposed to encapsulate all the logic needed to obtain object references. The
domain objects won’t have to deal with the infrastructure to get the needed references to other objects of the domain. They will just get them from the Repository and the model is regaining its
clarity and focus.

The Repository may store references to some of the objects. When an object is created, it may be saved in the Repository, and retrieved from there to be used later. If the client requested an object from the Repository, and the Repository does not have it, it may get it from the storage. Either way, the Repository acts as a storage place for globally accessible objects.
The Repository may also include a Strategy. It may access one persistence storage or another based on the specified Strategy.

For each type of object that needs global access, create an object that can provide the illusion of an in-memory collection of all objects of that type. Set up access through a well-known global interface. Provide methods to add and remove objects, which will encapsulate the actual insertion or removal of data in the data store. Provide methods that select objects based on some criteria and return fully instantiated objects or collections of objects whose attribute values meet the criteria, thereby encapsulating the actual storage and query technology. Provide repositories only for Aggregate roots that actually need direct access.

The Repository interface may contain methods used to perform some supplementary calculations like the number of objects of a certain type.

The Factory should create new objects, while the Repository should find already created objects. When a new object is to be added to the Repository, it should be created first using the Factory, and then it should be given to the Repository which will store it

Factories

Factories
Entities and Aggregates can often be large and complex – too complex to create in the constructor of the root entity.

When a client object wants to create another object, it calls its constructor and possibly passes some parameters. But when the object construction is a laborious process, creating the object involves a lot of knowledge about the internal structure of the object, about the relationships between the objects contained, and the rules applied to them.

Factories are used to encapsulate the knowledge necessary for object creation, and they are especially useful to create Aggregates. When the root of the Aggregate is created, all the objects contained by the Aggregate are created along with it, and all the invariants are enforced.

It is important for the creation process to be atomic. If it is not, there is a chance for the creation process to be half done for some objects, leaving them in an undefined state. This is even more true for Aggregates. When the root is created, it is necessary that all objects subject to invariants are created too.
Otherwise the invariants cannot be enforced. For immutable Value Objects it means that all attributes are initialized to their valid state. If an object cannot be created properly, an exception should be raised, making sure that an invalid value is not returned.

Therefore, shift the responsibility for creating instances of complex objects and Aggregates to a separate object, which may itself have no responsibility in the domain model but is still part
of the domain design. Provide an interface that encapsulates all complex assembly and that does not require the client to reference the concrete classes of the objects being instantiated.
Create entire Aggregates as a unit, enforcing their invariants.
There are several design patterns used to implement Factories.
The book Design Patterns by Gamma et all. describes them in detail, and presents these two patterns among others:
  • Factory Method
  • Abstract Factory
There are times when a Factory is not needed, and a simple
constructor is enough. Use a constructor when:
  • The construction is not complicated.
  • The creation of an object does not involve the creation of others, and all the attributes needed are passed via the constructor.
  • The client is interested in the implementation, perhaps wants to choose the Strategy used.
  • The class is the type. There is no hierarchy involved, so no need to choose between a list of concrete implementations.

Aggregates

Aggregates

It is difficult to guarantee the consistency of changes to objects in a model with complex associations. Many times invariants apply to closely related objects, not just discrete ones. Yet cautious locking schemes cause multiple users to interfere pointlessly with each other and make a system unusable.

Therefore, use Aggregates. An Aggregate is a group of associated objects which are considered as one unit with regard to data changes. The Aggregate is demarcated by a boundary which separates the objects inside from those outside. Each Aggregate has one root. The root is an Entity, and it is the only object accessible from outside. The root can hold references to any of the aggregate objects, and the other objects can hold references to each other, but an outside object can hold references only to the root object. If there are other Entities inside the boundary, the identity of those entities is local, making sense only inside the aggregate.

Objects inside an Aggregate should be allowed to hold references to roots of other Aggregates.

The root Entity has global identity, and is responsible for maintaining the invariants. Internal Entities have local identity.

Cluster the Entities and Value Objects into Aggregates and define boundaries around each. Choose one Entity to be the root of each Aggregate, and control all access to the objects inside the boundary through the root. Allow external objects to hold references to the root only.

Transient references to internal members can be passed out for use within a single operation only. Because the root controls access, it cannot be blindsided by changes to the internals. This arrangement makes it practical to enforce all invariants for objects in the Aggregate and for the Aggregate as a whole in any state change.

Domain Driven Design

Domain Driven Design notes

  • complements MVC
  • separates the model layer ("M") of MVC into:
  1. an application tier - used to retrieve and store data
  2. a domain tier - where the business knowledge or expertise is
  3. an infrastructure tier - responsible for coordinating the infrastructure and domain tiers to make a useful application

Entity

You can use than base entities as they are, or you can extend the base entities with additional methods that encapsulate business logic. For example, there is an Invoice base entity class with fields such as invoiceId, invoiceDate, referenceNumber and accessor method such as getInvoiceId(), setInvoiceId(String invoiceId), etc. Then, there is an Invoice class in the billing domain which extends the base Invoice class and has methods such as getInvoiceTotal(), getAppliedAmount(), etc.

Infrastructure

The Infrastructure class is a global directory of infrastructure resources, such as database access connections, located across all the frameworks and platforms of opentaps. Initially, it can be used to obtain the delegator and dispatcher of the ofbiz framework, but as more applications are added to opentaps, it will also return the infrastructure their frameworks require, including JDBC connections or hibernate session factories. These infrastructure resources are passed to the Repository and the Factory classes so that they can interact with the database and external Web services.

Factory

The Factory class is designed to create Entity objects based on other parameters. For example, you might want to create an Invoice Entity based on customer and invoice terms, or you might want to create an Invoice Entity based on an existing Order, taking its customer and list of items as a starting point. The Factory class is meant to be extended to create Factories for the different domain aggregates such as Invoice, Customer, Order, etc.

Repository

The Repository is designed to help retrieve and store Entities and is meant to be extended for the major Entities, so the foundation Repository should be extended to CustomerRepository, InvoiceRepository, and OrderRepository to support Customer, Invoice, and Order Entities.

As a good design pattern, a repository should fetch objects directly and not associations. The modeling details of a particular implementation should be hidden from the domain.

Repositories or Factories?

Factories are intended to create new Entity objects, while Repositories are intended to retrieve and store them. Therefore, we would follow the following rules for Factories and Repositories:

  1. Use Factories for create and Repositories for get and store
  2. Always return the domain's Entity object from your Factory, so it looks like a real object Factory
  3. Factories will almost always use the service dispatcher, whereas Repositories will usually use the dispatcher but may sometimes use the delegator

Services

Services are designed to encapsulate business logic that span multiple Entities, such creating Invoice from an Order.
Parameters for your service are passed into your service via set methods, the execution of your services via a void method, errors are propagated by exceptions, and the results of your service are passed back via get methods. This is in contrast to the ofbiz framework, where services are defined as static Java methods (don't ever write one in minilang!), the parameters are passed in a map, the results and any error messages are returned in a map.

Because these services are Java objects, we follow the convention to group services with similar parameters together into one class. For example, all services which create Invoices from Order should be in one class, and all services which create Invoices from Shipment should be in another. This allows them to share set and get methods without having one service class which is too long.

What domain should a service be a part of? By convention, we recommend that the service is part of the domain of its output, so all services which create Invoices should be part of the Invoice domain, whether the invoices are created from orders, shipments, or recurring agreements.


ver conferencia de Eric Evans sobre DDD


Enlaces y Recursos Domain-Driven Design

http://tech.groups.yahoo.com/group/domaindrivendesign/messages

12 diciembre 2008

metodos pang y pong


public void pong()
{
log.info("filtrando paises por: #{pais.pais}");
List list = entityManager.createQuery("select p from Pais p where p.pais like #{pais.pais}").getResultList();
Iterator iterator = list.iterator();
while (iterator.hasNext()){
log.info("pais: " + iterator.next().getPais());
}

log.info("ping.pong() action called");
facesMessages.add("pong");
}

11 diciembre 2008

curso JBoss Seam (II) - viernes 12-12-08

puntos para ver el viernes 12-12-08:

crear el método pang obteniendo la lista de entityManager.createQuery("...").getResultList()
  • el parámetro lo vamos a obtener de EL de seam
  • hacerlo con Generics
explicar los Home y los List y hacer un ejercicio con los List
  • antes de verlo decirles cómo mostrar el código de Seam en eclipse
  • como referencia: seam_reference_complete.pdf (cap. 13 The Seam Application Framework)

10 diciembre 2008

curso JBoss Seam (II) - jueves 11-12-08

Propuestas para ver el jueves:

  • testNG
  • HQL
  • Ejercicio práctico partiendo de un proyecto eclipse
  • 9.5 Using EL in EJB-QL/HQL
  • 9.6. Using Hibernate filters

09 diciembre 2008

curso JBoss Seam (II) - Annotations for component definition

Chapter 22. Seam annotations


When you write a Seam application, you'll use a lot of annotations. Seam lets you use annotations to achieve a declarative style of programming. Most of the annotations you'll use are defined by the EJB 3.0 specification. The annotations for data validation are defined by the Hibernate Validator package. Finally, Seam defines its own set of annotations, which we'll describe in this chapter.

All of these annotations are defined in the package org.jboss.seam.annotations.

22.1. Annotations for component definition

The first group of annotations lets you define a Seam component. These annotations appear on the component class.

@Name
@Name("componentName")

Defines the Seam component name for a class. This annotation is required for all Seam components.

@Scope
@Scope(ScopeType.CONVERSATION)

Defines the default context of the component. The possible values are defined by the ScopeType enumeration: EVENT, PAGE, CONVERSATION, SESSION, BUSINESS_PROCESS, APPLICATION, STATELESS.

When no scope is explicitly specified, the default depends upon the component type. For stateless session beans, the default is STATELESS. For entity beans and stateful session beans, the default is CONVERSATION. For JavaBeans, the default is EVENT.

@Role
@Role(name="roleName", scope=ScopeType.SESSION)

Allows a Seam component to be bound to multiple contexts variables. The @Name/@Scope annotations define a "default role". Each @Role annotation defines an additional role.

  • name — the context variable name.

  • scope — the context variable scope. When no scope is explicitly specified, the default depends upon the component type, as above.

@Roles
@Roles({
@Role(name="user", scope=ScopeType.CONVERSATION),
@Role(name="currentUser", scope=ScopeType.SESSION)
})

Allows specification of multiple additional roles.

@Intercept
@Intercept(InterceptionType.ALWAYS)

Determines when Seam interceptors are active. The possible values are defined by the InterceptionType enumeration: ALWAYS, AFTER_RESTORE_VIEW, AFTER_UPDATE_MODEL_VALUES, INVOKE_APPLICATION, NEVER.

When no interception type is explicitly specified, the default depends upon the component type. For entity beans, the default is NEVER. For session beans, message driven beans and JavaBeans, the default is ALWAYS.

@JndiName
@JndiName("my/jndi/name")

Specifies the JNDI name that Seam will use to look up the EJB component. If no JNDI name is explicitly specified, Seam will use the JNDI pattern specified by org.jboss.seam.core.init.jndiPattern.

@Conversational
@Conversational(ifNotBegunOutcome="error")

Specifies that a conversation scope component is conversational, meaning that no method of the component can be called unless a long-running conversation started by this component is active (unless the method would begin a new long-running conversation).

@Startup
@Startup(depends={"org.jboss.core.jndi", "org.jboss.core.jta"})

Specifies that an application scope component is started immediately at initialization time. This is mainly used for certain built-in components that bootstrap critical infrastructure such as JNDI, datasources, etc.

@Startup

Specifies that a session scope component is started immediately at session creation time.

  • depends — specifies that the named components must be started first, if they are installed.

@Install
@Install(false)

Specifies whether or not a component should be installed by default. The lack of an @Install annotation indicates a component should be installed.

@Install(dependencies="org.jboss.seam.core.jbpm")

Specifies that a component should only be stalled if the components listed as dependencies are also installed.

@Install(genericDependencies=ManagedQueueSender.class)

Specifies that a component should only be installed if a component that is implemented by a certain class is installed. This is useful when the dependency doesn't have a single well-known name.

@Install(classDependencies="org.hibernate.Session")

Specifies that a component should only be installed if the named class is in the classpath.

@Install(precedence=BUILT_IN)

Specifies the precedence of the component. If multiple components with the same name exist, the one with the higher precedence will be installed. The defined precendence values are (in ascending order):

  • BUILT_IN — Precedence of all built-in Seam components

  • FRAMEWORK — Precedence to use for components of frameworks which extend Seam

  • APPLICATION — Predence of application components (the default precedence)

  • DEPLOYMENT — Precedence to use for components which override application components in a particular deployment

  • MOCK — Precedence for mock objects used in testing

@Synchronized
@Synchronized(timeout=1000)

Specifies that a component is accessed concurrently by multiple clients, and that Seam should serialize requests. If a request is not able to obtain its lock on the component in the given timeout period, an exception will be raised.

@ReadOnly
@ReadOnly

Specifies that a JavaBean component or component method does not require state replication at the end of the invocation.

22.2. Annotations for bijection

The next two annotations control bijection. These attributes occur on component instance variables or property accessor methods.

@In
@In

Specifies that a component attribute is to be injected from a context variable at the beginning of each component invocation. If the context variable is null, an exception will be thrown.

@In(required=false)

Specifies that a component attribute is to be injected from a context variable at the beginning of each component invocation. The context variable may be null.

@In(create=true)

Specifies that a component attribute is to be injected from a context variable at the beginning of each component invocation. If the context variable is null, an instance of the component is instantiated by Seam.

@In(value="contextVariableName")

Specifies the name of the context variable explicitly, instead of using the annotated instance variable name.

@In(value="#{customer.addresses['shipping']}")

Specifies that a component attribute is to be injected by evaluating a JSF EL expression at the beginning of each component invocation.

  • value — specifies the name of the context variable. Default to the name of the component attribute. Alternatively, specifies a JSF EL expression, surrounded by #{...}.

  • create — specifies that Seam should instantiate the component with the same name as the context variable if the context variable is undefined (null) in all contexts. Default to false.

  • required — specifies Seam should throw an exception if the context variable is undefined in all contexts.

@Out
@Out

Specifies that a component attribute that is a Seam component is to be outjected to its context variable at the end of the invocation. If the attribute is null, an exception is thrown.

@Out(required=false)

Specifies that a component attribute that is a Seam component is to be outjected to its context variable at the end of the invocation. The attribute may be null.

@Out(scope=ScopeType.SESSION)

Specifies that a component attribute that is not a Seam component type is to be outjected to a specific scope at the end of the invocation.

Alternatively, if no scope is explicitly specified, the scope of the component with the @Out attribute is used (or the EVENT scope if the component is stateless).

@Out(value="contextVariableName")

Specifies the name of the context variable explicitly, instead of using the annotated instance variable name.

  • value — specifies the name of the context variable. Default to the name of the component attribute.

  • required — specifies Seam should throw an exception if the component attribute is null during outjection.

Note that it is quite common for these annotations to occur together, for example:

@In(create=true) @Out private User currentUser;

The next annotation supports the manager component pattern, where a Seam component that manages the lifecycle of an instance of some other class that is to be injected. It appears on a component getter method.

@Unwrap
@Unwrap

Specifies that the object returned by the annotated getter method is the thing that is injected instead of the component instance itself.

The next annotation supports the factory component pattern, where a Seam component is responsible for initializing the value of a context variable. This is especially useful for initializing any state needed for rendering the response to a non-faces request. It appears on a component method.

@Factory
@Factory("processInstance")

Specifies that the method of the component is used to initialize the value of the named context variable, when the context variable has no value. This style is used with methods that return void.

@Factory("processInstance", scope=CONVERSATION)

Specifies that the method returns a value that Seam should use to initialize the value of the named context variable, when the context variable has no value. This style is used with methods that return a value. If no scope is explicitly specified, the scope of the component with the @Factory method is used (unless the component is stateless, in which case the EVENT context is used).

  • value — specifies the name of the context variable. If the method is a getter method, default to the JavaBeans property name.

  • scope — specifies the scope that Seam should bind the returned value to. Only meaningful for factory methods which return a value.

This annotation lets you inject a Log:

@Logger
@Logger("categoryName")

Specifies that a component field is to be injected with an instance of org.jboss.seam.log.Log. For entity beans, the field must be declared as static.

  • value — specifies the name of the log category. Default to the name of the component class.

The last annotation lets you inject a request parameter value:

@RequestParameter
@RequestParameter("parameterName")

Specifies that a component attribute is to be injected with the value of a request parameter. Basic type conversions are performed automatically.

  • value — specifies the name of the request parameter. Default to the name of the component attribute.

22.3. Annotations for component lifecycle methods

These annotations allow a component to react to its own lifecycle events. They occur on methods of the component. There may be only one of each per component class.

@Create
@Create

Specifies that the method should be called when an instance of the component is instantiated by Seam. Note that create methods are only supported for JavaBeans and stateful session beans.

@Destroy
@Destroy

Specifies that the method should be called when the context ends and its context variables are destroyed. Note that create methods are only supported for JavaBeans and stateful session beans.

Note that all stateful session bean components must define a method annotated @Destroy @Remove in order to guarantee destruction of the stateful bean when a context ends.

Destroy methods should be used only for cleanup. Seam catches, logs and swallows any exception that propagates out of a destroy method.

@Observer
@Observer("somethingChanged")

Specifies that the method should be called when a component-driven event of the specified type occurs.

@Observer(value="somethingChanged",create=false)

Specifies that the method should be called when an event of the specified type occurs but that an instance should not be created if one doesn't exist. If an instance does not exist and create is false, the event will not be observed. The default value for create is true.

22.4. Annotations for context demarcation

These annotations provide declarative conversation demarcation. They appear on methods of Seam components, usually action listener methods.

Every web request has a conversation context associated with it. Most of these conversations end at the end of the request. If you want a conversation that span multiple requests, you must "promote" the current conversation to a long-running conversation by calling a method marked with @Begin.

@Begin
@Begin

Specifies that a long-running conversation begins when this method returns a non-null outcome without exception.

@Begin(ifOutcome={"success", "continue"})

Specifies that a long-running conversation begins when this action listener method returns with one of the given outcomes.

@Begin(join=true)

Specifies that if a long-running conversation is already in progress, the conversation context is simply propagated.

@Begin(nested=true)

Specifies that if a long-running conversation is already in progress, a new nested conversation context begins. The nested conversation will end when the next @End is encountered, and the outer conversation will resume. It is perfectly legal for multiple nested conversations to exist concurrently in the same outer conversation.

@Begin(pageflow="process definition name")

Specifies a jBPM process definition name that defines the pageflow for this conversation.

@Begin(flushMode=FlushModeType.MANUAL)

Specify the flush mode of any Seam-managed persistence contexts. flushMode=FlushModeType.MANUAL supports the use of atomic conversations where all write operations are queued in the conversation context until an explicit call to flush() (which usually occurs at the end of the conversation).

  • ifOutcome — specifies the JSF outcome or outcomes that result in a new long-running conversation context.

  • join — determines the behavior when a long-running conversation is already in progress. If true, the context is propagated. If false, an exception is thrown. Default to false. This setting is ignored when nested=true is specified

  • nested — specifies that a nested conversation should be started if a long-running conversation is already in progress.

  • flushMode — set the flush mode of any Seam-managed Hibernate sessions or JPA persistence contexts that are created during this conversation.

  • pageflow — a process definition name of a jBPM process definition deployed via org.jboss.seam.core.jbpm.pageflowDefinitions.

@End
@End

Specifies that a long-running conversation ends when this method returns a non-null outcome without exception.

@End(ifOutcome={"success", "error"}, evenIfException={SomeException.class, OtherException.class})

Specifies that a long-running conversation ends when this action listener method returns with one of the given outcomes or throws one of the specified classes of exception.

  • ifOutcome — specifies the JSF outcome or outcomes that result in the end of the current long-running conversation.

  • beforeRedirect — by default, the conversation will not actually be destroyed until after any redirect has occurred. Setting beforeRedirect=true specifies that the conversation should be destroyed at the end of the current request, and that the redirect will be processed in a new temporary conversation context.

@StartTask
@StartTask

"Starts" a jBPM task. Specifies that a long-running conversation begins when this method returns a non-null outcome without exception. This conversation is associated with the jBPM task specified in the named request parameter. Within the context of this conversation, a business process context is also defined, for the business process instance of the task instance.

The jBPM TaskInstance will be available in a request context variable named taskInstance. The jPBM ProcessInstance will be available in a request context variable named processInstance. (Of course, these objects are available for injection via @In.)

  • taskIdParameter — the name of a request parameter which holds the id of the task. Default to "taskId", which is also the default used by the Seam taskList JSF component.

  • flushMode — set the flush mode of any Seam-managed Hibernate sessions or JPA persistence contexts that are created during this conversation.

@BeginTask
@BeginTask

Resumes work on an incomplete jBPM task. Specifies that a long-running conversation begins when this method returns a non-null outcome without exception. This conversation is associated with the jBPM task specified in the named request parameter. Within the context of this conversation, a business process context is also defined, for the business process instance of the task instance.

The jBPM TaskInstance will be available in a request context variable named taskInstance. The jPBM ProcessInstance will be available in a request context variable named processInstance.

  • taskIdParameter — the name of a request parameter which holds the id of the task. Default to "taskId", which is also the default used by the Seam taskList JSF component.

  • flushMode — set the flush mode of any Seam-managed Hibernate sessions or JPA persistence contexts that are created during this conversation.

@EndTask
@EndTask

"Ends" a jBPM task. Specifies that a long-running conversation ends when this method returns a non-null outcome, and that the current task is complete. Triggers a jBPM transition. The actual transition triggered will be the default transition unless the application has called Transition.setName() on the built-in component named transition.

@EndTask(transition="transitionName")

Triggers the given jBPM transition.

@EndTask(ifOutcome={"success", "continue"})

Specifies that the task ends when this method returns one of the listed outcomes.

  • transition — the name of the jBPM transition to be triggered when ending the task. Defaults to the default transition.

  • ifOutcome — specifies the JSF outcome or outcomes that result in the end of the task.

  • beforeRedirect — by default, the conversation will not actually be destroyed until after any redirect has occurred. Setting beforeRedirect=true specifies that the conversation should be destroyed at the end of the current request, and that the redirect will be processed in a new temporary conversation context.

@CreateProcess
@CreateProcess(definition="process definition name")

Creates a new jBPM process instance when the method returns a non-null outcome without exception. The ProcessInstance object will be available in a context variable named processInstance.

  • definition — the name of the jBPM process definition deployed via org.jboss.seam.core.jbpm.processDefinitions.

@ResumeProcess
@ResumeProcess(processIdParameter="processId")

Re-enters the scope of an existing jBPM process instance when the method returns a non-null outcome without exception. The ProcessInstance object will be available in a context variable named processInstance.

  • processIdParameter — the name a request parameter holding the process id. Default to "processId".

22.5. Annotations for transaction demarcation

Seam provides an annotation that lets you force a rollback of the JTA transaction for certain action listener outcomes.

@Rollback
@Rollback(ifOutcome={"failure", "not-found"})

If the outcome of the method matches any of the listed outcomes, or if no outcomes are listed, set the transaction to rollback only when the method completes.

  • ifOutcome — the JSF outcomes that cause a transaction rollback (no outcomes is interpreted to mean any outcome).

@Transactional
@Transactional

Specifies that a JavaBean component should have a similar transactional behavior to the default behavior of a session bean component. ie. method invocations should take place in a transaction, and if no transaction exists when the method is called, a transaction will be started just for that method. This annotation may be applied at either class or method level.

Seam applications usually use the standard EJB3 annotations for all other transaction demarcation needs.

22.6. Annotations for exceptions

These annotations let you specify how Seam should handle an exception that propagates out of a Seam component.

@Redirect
@Redirect(viewId="error.jsp")

Specifies that the annotated exception causes a browser redirect to a specified view id.

  • viewId — specifies the JSF view id to redirect to.

  • message — a message to be displayed, default to the exception message.

  • end — specifies that the long-running conversation should end, default to false.

@HttpError
@HttpError(errorCode=404)

Specifies that the annotated exception causes a HTTP error to be sent.

  • errorCode — the HTTP error code, default to 500.

  • message — a message to be sent with the HTTP error, default to the exception message.

  • end — specifies that the long-running conversation should end, default to false.

22.7. Annotations for validation

This annotation triggers Hibernate Validator. It appears on a method of a Seam component, almost always an action listener method.

Please refer to the documentation for the Hibernate Annotations package for information about the annotations defined by the Hibernate Validator framework.

Note that use of @IfInvalid is now semi-deprecated and is now preferred.

@IfInvalid
@IfInvalid(outcome="invalid", refreshEntities=true)

Specifies that Hibernate Validator should validate the component before the method is invoked. If the invocation fails, the specified outcome will be returned, and the validation failure messages returned by Hibernate Validator will be added to the FacesContext. Otherwise, the invocation will proceed.

  • outcome — the JSF outcome when validation fails.

  • refreshEntities — specifies that any invalid entity in the managed state should be refreshed from the database when validation fails. Default to false. (Useful with extended persistence contexts.)

22.8. Annotations for Seam Remoting

Seam Remoting requires that the local interface of a session bean be annotated with the following annotation:

@WebRemote
@WebRemote(exclude="path.to.exclude")

Indicates that the annotated method may be called from client-side JavaScript. The exclude property is optional and allows objects to be excluded from the result's object graph (see the Remoting chapter for more details).

22.9. Annotations for Seam interceptors

The following annotations appear on Seam interceptor classes.

Please refer to the documentation for the EJB 3.0 specification for information about the annotations required for EJB interceptor definition.

@Interceptor
@Interceptor(stateless=true)

Specifies that this interceptor is stateless and Seam may optimize replication.

@Interceptor(type=CLIENT)

Specifies that this interceptor is a "client-side" interceptor that is called before the EJB container.

@Interceptor(around={SomeInterceptor.class, OtherInterceptor.class})

Specifies that this interceptor is positioned higher in the stack than the given interceptors.

@Interceptor(within={SomeInterceptor.class, OtherInterceptor.class})

Specifies that this interceptor is positioned deeper in the stack than the given interceptors.

22.10. Annotations for asynchronicity

The following annotations are used to declare an asynchronous method, for example:

@Asynchronous public void scheduleAlert(Alert alert, @Expiration Date date) { ... }
@Asynchronous public Timer scheduleAlerts(Alert alert, @Expiration Date date, @IntervalDuration long interval) { ... }
@Asynchronous
@Asynchronous

Specifies that the method call is processed asynchronously.

@Duration
@Duration

Specifies that a parameter of the asynchronous call is the duration before the call is processed (or first processed for recurring calls).

@Expiration
@Expiration

Specifies that a parameter of the asynchronous call is the datetime at which the call is processed (or first processed for recurring calls).

@IntervalDuration
@IntervalDuration

Specifies that an asynchronous method call recurs, and that the annotationed parameter is duration between recurrences.

22.11. Annotations for use with JSF dataTable

The following annotations make it easy to implement clickable lists backed by a stateful session bean. They appear on attributes.

@DataModel
@DataModel("variableName")

Exposes an attribute of type List, Map, Set or Object[] as a JSF DataModel into the scope of the owning component (or the EVENT scope if the owning component is STATELESS). In the case of Map, each row of the DataModel is a Map.Entry.

  • value — name of the conversation context variable. Default to the attribute name.

  • scope — if scope=ScopeType.PAGE is explicitly specified, the DataModel will be kept in the PAGE context.

@DataModelSelection
@DataModelSelection

Injects the selected value from the JSF DataModel (this is the element of the underlying collection, or the map value).

  • value — name of the conversation context variable. Not needed if there is exactly one @DataModel in the component.

@DataModelSelectionIndex
@DataModelSelectionIndex

Exposes the selection index of the JSF DataModel as an attribute of the component (this is the row number of the underlying collection, or the map key).

  • value — name of the conversation context variable. Not needed if there is exactly one @DataModel in the component.

22.12. Meta-annotations for databinding

These meta-annotations make it possible to implement similar functionality to @DataModel and @DataModelSelection for other datastructures apart from lists.

@DataBinderClass
@DataBinderClass(DataModelBinder.class)

Specifies that an annotation is a databinding annotation.

@DataSelectorClass
@DataSelectorClass(DataModelSelector.class)

Specifies that an annotation is a dataselection annotation.

22.13. Annotations for packaging

This annotation provides a mechanism for declaring information about a set of components that are packaged together. It can be applied to any Java package.

@Namespace
@Namespace(value="http://jboss.com/products/seam/example/seampay")

Specifies that components in the current package are associated with the given namespace. The declared namespace can be used as an XML namespace in a components.xml file to simplify application configuration.

@Namespace(value="http://jboss.com/products/seam/core", prefix="org.jboss.seam.core")

Specifies a namespace to associate with a given package. Additionally, it specifies a component name prefix to be applied to component names specified in the XML file. For example, an XML element named microcontainer that is associated with this namespace would be understood to actually refere to a component named org.jboss.seam.core.microcontainer.