Slide 10
Slide 10 text
Outbound
@ConnectionFactoryDefinition(
name = "java:comp/env/OutboundConnectionFactory",
interfacename = com.example.jca.OutboundConnectionFactory,
resourceAdapter = "some-rar",
...
)
@Stateless
public class ExampleMessageSender {
@Resource(lookup = "java.comp/env/OutboundConnectionFactory")
OutboundConnectionFactory factory;
public void send(...) {
try (OutboundConnection conn = factory.createConnection()) {
...
} catch (Exception e) {
...
}
}
}