Package javax.naming

Examples of javax.naming.Context.lookup()


                            Properties prop) throws AdminException, ConnectException {
    Queue queue = null;

    try {
      Context ctx = new InitialContext();
      queue = (Queue) ctx.lookup(name);
    } catch (javax.naming.NamingException exc) {
      String shortName = removePrefix(name);
      queue = (Queue) AdminModule.createQueue(serverId, shortName, className, prop);
      queue.setFreeReading();
      queue.setFreeWriting();
View Full Code Here


                            Properties prop) throws AdminException, ConnectException {
    Topic topic = null;

    try {
      Context ctx = new InitialContext();
      topic = (Topic) ctx.lookup(name);
    } catch (javax.naming.NamingException exc) {
      String shortName = removePrefix(name);
      topic = (Topic) AdminModule.createTopic(serverId, shortName, className, prop);
      topic.setFreeReading();
      topic.setFreeWriting();
View Full Code Here

  public static void main(String[] args) throws Exception {
    System.out.println();
    System.out.println("Queries to the monitoring queue...");

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

    Connection cnx = cf.createConnection();
    Session sess = cnx.createSession(false, Session.AUTO_ACKNOWLEDGE);
View Full Code Here

    System.out.println();
    System.out.println("Queries to the monitoring queue...");

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

    Connection cnx = cf.createConnection();
    Session sess = cnx.createSession(false, Session.AUTO_ACKNOWLEDGE);
    MessageProducer prod = sess.createProducer(queue);
View Full Code Here

      }
      Context ctx = this.context;
      if (ctx == null) {
        ctx = new InitialContext();
      }
      QueueConnectionFactory factory = (QueueConnectionFactory) ctx.lookup(connFactoryName);
      this.connection = factory.createQueueConnection();
      this.session = this.connection.createQueueSession(transactedQueue, acknowledgeMode);
      this.queue = this.session.createQueue(queueName);
      this.responseQueue = this.session.createQueue(responseQueueName);
      this.producer = this.session.createProducer(this.queue);
View Full Code Here

    if ("AUTO_ACKNOWLEDGE".equals(ackModeString)) {
      ackMode = Session.AUTO_ACKNOWLEDGE;
    } else if ("CLIENT_ACKNOWLEDGE".equals(ackModeString)) {
      ackMode = Session.CLIENT_ACKNOWLEDGE;
    }
    QueueConnectionFactory factory = (QueueConnectionFactory) ctx.lookup(connFactoryName);
    try {
      this.connection = factory.createQueueConnection();
      this.session = connection.createQueueSession(transacted, ackMode);
      this.queue = this.session.createQueue(queueName);
      this.responseQueue = this.session.createQueue(responseQueueName);
View Full Code Here

 
  private EventDistributor getLocalEventDistributor() {
    if (localEventDistributor == null && this.localEventDistributorName != null) {
      try {
        Context ctx = new InitialContext();
        return (EventDistributor) ctx.lookup(this.localEventDistributorName);
      } catch (NamingException e) {
        return null;
      }
    }
    return localEventDistributor;
View Full Code Here

    /** Factory method - gets a reference to the Report home interface.
     */
    public static ReportLocalHome getReportLocalHome()
    throws NamingException {
        Context context = new InitialContext();
        ReportLocalHome home = (ReportLocalHome)context.lookup(JNDI_NAME_REPORT);
        return home;
    }

    /** Factory method - gets a reference to the ReportContent home interface.
     */
 
View Full Code Here

    /** Factory method - gets a reference to the ReportContent home interface.
     */
    public static ReportContentLocalHome getReportContentLocalHome()
    throws NamingException {
        Context context = new InitialContext();
        ReportContentLocalHome home = (ReportContentLocalHome)context.lookup(JNDI_NAME_REPORT_CONTENT);
        return home;
    }

    /** Factory method - gets a reference to the ReportType home interface.
     */
 
View Full Code Here

    /** Factory method - gets a reference to the ReportType home interface.
     */
    public static ReportTypeLocalHome getReportTypeLocalHome()
    throws NamingException {
        Context context = new InitialContext();
        ReportTypeLocalHome home = (ReportTypeLocalHome)context.lookup(JNDI_NAME_REPORT_TYPE);
        return home;
    }

    /*************************************************************************************
     *
 
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.