@MessageDriven
Die Annotation @MessageDriven markiert eine Klasse als Message-Driven Bean. Innerhalb von @MessageDriven wird mit den Annotationen @ActivationConfigProperty die Verknüpfung zu der Destination geschaffen, von der das Bean die Nachrichten empfangen soll.
@MessageDriven(
name="<Name des Beans>",
activationConfig={
@ActivationConfigProperty(
propertyName="connectionFactoryJndiName",
propertyValue="jms/ConnectionFactory"),
@ActivationConfigProperty(
propertyName="destinationName",
propertyValue="<Name der Queue oder des Topics>"),
@ActivationConfigProperty(
propertyName="destinationType",
propertyValue="<javax.jms.Queue oder javax.jms.Topic>"),
@ActivationConfigProperty(
propertyName="messageSelector",
propertyValue="<Query>")
...
},
description="<Beschreibung>"
)
public class <Name des Beans> implements MessageListener
{
...
public void onMessage(Message message)
{
...
}
...
}
Quelle
http://java.sun.com/javaee/5/docs/api/javax/ejb/MessageDriven.html
http://java.sun.com/javaee/5/docs/api/javax/ejb/ActivationConfigProperty.html
http://download.oracle.com/docs/cd/B25221_04/web.1013/b14428/mdb30cfg.htm
@MessageDriven(
name="<Name des Beans>",
activationConfig={
@ActivationConfigProperty(
propertyName="connectionFactoryJndiName",
propertyValue="jms/ConnectionFactory"),
@ActivationConfigProperty(
propertyName="destinationName",
propertyValue="<Name der Queue oder des Topics>"),
@ActivationConfigProperty(
propertyName="destinationType",
propertyValue="<javax.jms.Queue oder javax.jms.Topic>"),
@ActivationConfigProperty(
propertyName="messageSelector",
propertyValue="<Query>")
...
},
description="<Beschreibung>"
)
public class <Name des Beans> implements MessageListener
{
...
public void onMessage(Message message)
{
...
}
...
}
Quelle
http://java.sun.com/javaee/5/docs/api/javax/ejb/MessageDriven.html
http://java.sun.com/javaee/5/docs/api/javax/ejb/ActivationConfigProperty.html
http://download.oracle.com/docs/cd/B25221_04/web.1013/b14428/mdb30cfg.htm