Package javax.naming

Examples of javax.naming.Context.lookup()


     
      ja.start(bt);
      System.out.println("start ...");
    
      Context ictx = new InitialContext();
      Queue queue = (Queue) ictx.lookup("queue");
      Topic topic = (Topic) ictx.lookup("topic");
    
      ictx.close();

      ManagedConnectionFactoryImpl mcf = new ManagedConnectionFactoryImpl();
View Full Code Here


      ja.start(bt);
      System.out.println("start ...");
    
      Context ictx = new InitialContext();
      Queue queue = (Queue) ictx.lookup("queue");
      Topic topic = (Topic) ictx.lookup("topic");
    
      ictx.close();

      ManagedConnectionFactoryImpl mcf = new ManagedConnectionFactoryImpl();
      mcf.setResourceAdapter(ja);
View Full Code Here

* Producer/Consumer generating dead messages.
*/
public class DMQClient {
  public static void main(String[] args) throws Exception {
    Context ictx = new InitialContext();
    Queue queue1 = (Queue) ictx.lookup("queue1");
    Queue queue2 = (Queue) ictx.lookup("queue2");
//    Queue queue3 = (Queue) ictx.lookup("queue3");
    ConnectionFactory cf = (ConnectionFactory) ictx.lookup("cf");
    ictx.close();

View Full Code Here

*/
public class DMQClient {
  public static void main(String[] args) throws Exception {
    Context ictx = new InitialContext();
    Queue queue1 = (Queue) ictx.lookup("queue1");
    Queue queue2 = (Queue) ictx.lookup("queue2");
//    Queue queue3 = (Queue) ictx.lookup("queue3");
    ConnectionFactory cf = (ConnectionFactory) ictx.lookup("cf");
    ictx.close();

    Connection cnx = cf.createConnection();
View Full Code Here

  public static void main(String[] args) throws Exception {
    Context ictx = new InitialContext();
    Queue queue1 = (Queue) ictx.lookup("queue1");
    Queue queue2 = (Queue) ictx.lookup("queue2");
//    Queue queue3 = (Queue) ictx.lookup("queue3");
    ConnectionFactory cf = (ConnectionFactory) ictx.lookup("cf");
    ictx.close();

    Connection cnx = cf.createConnection();
    Session prodSession = cnx.createSession(false, Session.AUTO_ACKNOWLEDGE);
    Session consSession = cnx.createSession(true, 0);
View Full Code Here

import org.objectweb.joram.client.jms.Session;

public class AConsumer {
  public static void main(String[] args) throws Exception {
    Context context = new InitialContext();
    ConnectionFactory cf = (ConnectionFactory) context.lookup("cf");
    javax.jms.Queue queue =(Queue)context.lookup("queue");
    context.close();
   
    Connection cnx = cf.createConnection();
    Session session = (Session) cnx.createSession(false, Session.AUTO_ACKNOWLEDGE);
View Full Code Here

public class AConsumer {
  public static void main(String[] args) throws Exception {
    Context context = new InitialContext();
    ConnectionFactory cf = (ConnectionFactory) context.lookup("cf");
    javax.jms.Queue queue =(Queue)context.lookup("queue");
    context.close();
   
    Connection cnx = cf.createConnection();
    Session session = (Session) cnx.createSession(false, Session.AUTO_ACKNOWLEDGE);
//    session.setImplicitAck(true);
View Full Code Here

    TextMessage message = null;
    Queue queue = null;
    ConnectionFactory cf = null;

    Context initialContext = new InitialContext();
    cf = (ConnectionFactory) initialContext.lookup("cf");
    queue = (Queue) initialContext.lookup("queue");
    initialContext.close();

    cnx = cf.createConnection();
   
View Full Code Here

    Queue queue = null;
    ConnectionFactory cf = null;

    Context initialContext = new InitialContext();
    cf = (ConnectionFactory) initialContext.lookup("cf");
    queue = (Queue) initialContext.lookup("queue");
    initialContext.close();

    cnx = cf.createConnection();
   
    session = cnx.createSession(true, Session.AUTO_ACKNOWLEDGE);
View Full Code Here

    try {
      Destination dest;
     
      try {
        Context ctx = new InitialContext();
        dest = (Destination) ctx.lookup(destName);
      } catch (javax.naming.NamingException exc) {
        String shortName = removePrefix(destName);
        if ("javax.jms.Queue".equals(destType))
          dest = AdminModule.createQueue(serverId,
                                         shortName,
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.