Package javax.naming

Examples of javax.naming.Context.lookup()


      // Get the initial context
      Context jndicontext = getInitialContext();

      // Get the connection factory
      QueueConnectionFactory queueFactory =
   (QueueConnectionFactory)jndicontext.lookup("ConnectionFactory");

      // Create the connection
      queueConnection = queueFactory.createQueueConnection();

      // Create the session with: No transaction and Auto ack
View Full Code Here


      // Create the session with: No transaction and Auto ack
      queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

      // Look up the destination
      queue = (Queue)jndicontext.lookup(queueJNDI);

      // Create a subsriber
      queueReceiver = queueSession.createReceiver(queue);

      // Set the message listener, which is this class since we implement
View Full Code Here

      // Get the initial context
      Context jndicontext = getInitialContext();

      // Get the connection factory
      TopicConnectionFactory topicFactory =
   (TopicConnectionFactory)jndicontext.lookup( "ConnectionFactory");

      // Create the connection
      topicConnection = topicFactory.createTopicConnection();

      // Create the session with: No transaction and auto ack
View Full Code Here

      // Create the session with: No transaction and auto ack
      topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);

      // Look up the destination
      topic = (Topic)jndicontext.lookup(topicJNDI);

      // Create a subsriber
      topicSubscriber = topicSession.createSubscriber(topic);

      // Set the message listener, which is this class since we implement
View Full Code Here

      // Get the initial context
      Context jndicontext = getInitialContext();

      // Get the connection factory
      QueueConnectionFactory queueFactory =
    (QueueConnectionFactory)jndicontext.lookup("ConnectionFactory");

      // Create the connection
      queueConnection = queueFactory.createQueueConnection();

      // Create the session with: No Transaction and Auto ack
View Full Code Here

      // Create the session with: No Transaction and Auto ack
      queueSession = queueConnection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);

      // Look up the destination
      queue = (Queue)jndicontext.lookup(queueJNDI);

      // Create a sender
      queueSender = queueSession.createSender(queue);
   }
View Full Code Here

      // Get the initial context
      Context jndicontext = getInitialContext();

      // Get the connection factory
      TopicConnectionFactory topicFactory =
    (TopicConnectionFactory)jndicontext.lookup("ConnectionFactory");

      // Create the connection
      topicConnection = topicFactory.createTopicConnection();

      // Create the session with: No Transaction  and Auto ack
View Full Code Here

      // Create the session with: No Transaction  and Auto ack
      topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);

      // Look up the destination
      topic = (Topic)jndicontext.lookup(topicJNDI);

      // Create a publisher
      topicPublisher = topicSession.createPublisher(topic);
   }
View Full Code Here

 
  private org.jboss.cache.Cache cache;
 
  public void start() throws Exception {
    Context ctx = new InitialContext();
    cacheManager = (CacheManager) ctx.lookup("java:CacheManager");
    cache = cacheManager.getCache("riftsaw-cache", true);
    cache.start();
  }
 
  public <K, V> Cache<K, V> createCache() {
View Full Code Here

 
  private Object getClusteredCache() {
    if (this.enabled && this.cacheManagerName != null) {
      try {
        Context ctx = new InitialContext();
        return ctx.lookup(this.cacheManagerName);
      } catch (NamingException e) {
        return null;
      }
    }
    return null;
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.