Package javax.naming

Examples of javax.naming.InitialContext.lookup()


   * @param name       The JNDI name of the destination.
   */
  public void removeDestination(String name) throws AdminException {
    try {
      Context ctx = new InitialContext();
      Destination dest = (Destination) ctx.lookup(name);
      ctx.close();

      dest.delete();
      unbind(name);
    } catch (Exception exc) {
View Full Code Here


    InitialContext jndi = null;

    jndi = new InitialContext();

    // Look up a JMS connection factory
    conFactory = (ConnectionFactory)jndi.lookup("factoryChat");

    // Look up a JMS topic
    Topic chatTopic = (Topic)jndi.lookup(topicName);

    // Create a JMS connection
View Full Code Here

    // Look up a JMS connection factory
    conFactory = (ConnectionFactory)jndi.lookup("factoryChat");

    // Look up a JMS topic
    Topic chatTopic = (Topic)jndi.lookup(topicName);

    // Create a JMS connection
    connection = conFactory.createConnection();

    // Create two JMS session objects
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

        try
        {
            ic = new InitialContext(  );

            Queue                  queue = ( Queue ) ic.lookup( queueName );

            QueueConnectionFactory factory = ( QueueConnectionFactory ) ic.lookup( JNDINames.QUEUE_CONNECTION_FACTORY );
            cnn     = factory.createQueueConnection(  );
            session = cnn.createQueueSession( transacted, QueueSession.AUTO_ACKNOWLEDGE );
View Full Code Here

        {
            ic = new InitialContext(  );

            Queue                  queue = ( Queue ) ic.lookup( queueName );

            QueueConnectionFactory factory = ( QueueConnectionFactory ) ic.lookup( JNDINames.QUEUE_CONNECTION_FACTORY );
            cnn     = factory.createQueueConnection(  );
            session = cnn.createQueueSession( transacted, QueueSession.AUTO_ACKNOWLEDGE );

            ObjectMessage msg = session.createObjectMessage( obj );
View Full Code Here

    if (parentID <= 0){ return folderList; }

    try {
    InitialContext ic = CVUtility.getInitialContext();
    CommonHelperLocalHome commonHelperHome = (CommonHelperLocalHome)ic.lookup("local/CommonHelper");
    CommonHelperLocal commonHelperRemote =  commonHelperHome.create();
    commonHelperRemote.setDataSource(this.dataSource);
    folderList = commonHelperRemote.getSubFolderList(individualID,parentID, "emailfolder");
    }catch(Exception e){
      logger.error("[getSubFolderList]: Exception", e);
View Full Code Here

  private void supportEmail(ArrayList messageIDs, int ownerID)
  {
    try {
      InitialContext ic = CVUtility.getInitialContext();

      TicketLocalHome ticketHome = (TicketLocalHome)ic.lookup("local/Ticket");
      TicketLocal ticketRemote = (TicketLocal) ticketHome.create();
      ticketRemote.setDataSource(this.dataSource);

      // Used for getting the Default Owner ID.
      AppSettingsLocalHome appHome=(AppSettingsLocalHome)ic.lookup("local/AppSettings");
View Full Code Here

      TicketLocalHome ticketHome = (TicketLocalHome)ic.lookup("local/Ticket");
      TicketLocal ticketRemote = (TicketLocal) ticketHome.create();
      ticketRemote.setDataSource(this.dataSource);

      // Used for getting the Default Owner ID.
      AppSettingsLocalHome appHome=(AppSettingsLocalHome)ic.lookup("local/AppSettings");
      AppSettingsLocal appRemote=(AppSettingsLocal)appHome.create();
      appRemote.setDataSource(this.dataSource);
      String strAssignedID = appRemote.getApplicationSettings("DEFAULTOWNER");
      appRemote = null;
      appHome = 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.