Tags » Java EE

Simplifying JAX-RS caching with CDI

This post explains (via a simple example) how you can use CDI Producers to make it a little easier to leverage cache control semantics in your RESTful services… 505 more words

Java

Valid CDI scopes for Session (EJB) beans

CDI enriches the EJB specification (Session beans to be specific) by providing contextual life cycle management. Session beans are not ‘contextual’ instances in general.

If you are comfortable with CDI in general, the idea of ‘being contextual’ should be pretty clear. 163 more words

Java

Hello World!

This is it! My first ever blog posting! I have wanted to do something like this for a while and decided to finally jump in! 277 more words

Java EE

How to Receive a Message from an Apache ActiveMQ Topic with OCaml-Java

W/o Durability

open Java

open JavaString

open Package'java'io

open Package'javax'jms

open Package'org'apache'activemq

let conn_factory = Java.make "ActiveMQConnectionFactory()" ()

let conn = call "ConnectionFactory.createConnection()" conn_factory

let sess = call "Connection.createSession(boolean, int)" conn false (get "Session.AUTO_ACKNOWLEDGE" ())

let dest = call "Session.createTopic(String)" sess (of_string "SampleTopic")

let cons = call "Session.createConsumer(Destination)" sess dest

let _ = call "Connection.start()" conn

let msg = call "MessageConsumer.receive()" cons

let _ = call "PrintStream.println(Object)" (get "System.out" ()) msg

let _ = call "Connection.close()" conn… 124 more words
Software

How to Receive a Message from an Apache ActiveMQ Queue with OCaml-Java

open Java

open JavaString

open Package'java'io

open Package'javax'jms

open Package'org'apache'activemq

let conn_factory = Java.make "ActiveMQConnectionFactory()" ()

let conn = call "ConnectionFactory.createConnection()" conn_factory

let sess = call "Connection.createSession(boolean, int)" conn false (get "Session.AUTO_ACKNOWLEDGE" ())

let dest = call "Session.createQueue(String)" sess (of_string "SampleQueue")

let cons = call "Session.createConsumer(Destination)" sess dest

let _ = call "Connection.start()" conn

let msg = call "MessageConsumer.receive()" cons

let _ = call "PrintStream.println(Object)" (get "System.out" ()) msg

let _ = call "Connection.close()" conn
Software

How to Send a Message to an Apache ActiveMQ Topic with OCaml-Java

open Java

open JavaString

open Package'javax'jms

open Package'org'apache'activemq

let conn_factory = Java.make "ActiveMQConnectionFactory()" ()

let conn = call "ConnectionFactory.createConnection()" conn_factory

let sess = call "Connection.createSession(boolean, int)" conn false (get "Session.AUTO_ACKNOWLEDGE" ())

let dest = call "Session.createTopic(String)" sess (of_string "SampleTopic")

let prod = call "Session.createProducer(Destination)" sess dest

let msg = call "Session.createTextMessage(String)" sess (of_string "Simples Assim")

let _ = call "MessageProducer.send(Message)" prod msg

let _ = call "Connection.close()" conn
Software

How to Send a Message to an Apache ActiveMQ Queue with OCaml-Java

open Java

open JavaString

open Package'javax'jms

open Package'org'apache'activemq

let conn_factory = Java.make "ActiveMQConnectionFactory()" ()

let conn = call "ConnectionFactory.createConnection()" conn_factory

let sess = call "Connection.createSession(boolean, int)" conn false (get "Session.AUTO_ACKNOWLEDGE" ())

let dest = call "Session.createQueue(String)" sess (of_string "SampleQueue")

let prod = call "Session.createProducer(Destination)" sess dest

let msg = call "Session.createTextMessage(String)" sess (of_string "Simples Assim")

let _ = call "MessageProducer.send(Message)" prod msg

let _ = call "Connection.close()" conn
Software