How can I configure dependency on JMS service?

Solution Unverified - Updated -

Issue

  • How can I configure dependency on JMS service?
    I have this class:

@Singleton
@Startup
public class ApplicationStartup {

and this method:
@PreDestroy
public void stopService() {
System.out.println("*******Service has been stopped *******");
}

When I add this to the class:
@Resource(mappedName = "queue/xyz")
private static Queue queue;

the method "stopService() " is not called when server stops.

Strange. When I remove this ( private static Queue queue;
) then this method is called again.

Can you suggest why?

Environment

  • Red Hat JBoss Enterprise Application (EAP)
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.