Package javax.naming

Examples of javax.naming.Context.rebind()


       
        final Context ctx = NamingContextPool.getNamingContext(null);
        try
        {
            ctx.rebind(CONNECTION_FACTORY, new MockQueueConnectionFactory());
            ctx.rebind(QUEUE_NAME, new MockQueue(QUEUE_NAME));
        }
        finally
        {
            NamingContextPool.releaseNamingContext(ctx) ;
        }
View Full Code Here


  protected void setUp() throws Exception {
    MockContextFactory.setAsInitial();
                final Context ctx = NamingContextPool.getNamingContext(null);
                try
                {
                    ctx.rebind(NotifyTopics.CONNECTION_FACTORY, new MockTopicConnectionFactory());
                }
                finally
                {
                    NamingContextPool.releaseNamingContext(ctx) ;
                }
View Full Code Here

    MockTopic mockTopic = new MockTopic(topicName);
   
    final Context ctx = NamingContextPool.getNamingContext(null) ;
    try
    {
        ctx.rebind(topicName, mockTopic);
    }
    finally
    {
        NamingContextPool.releaseNamingContext(ctx) ;
    }
View Full Code Here

  
      try {
        ctx = new InitialContext();
        MockDataSource mds = new MockDataSource(this);
        String dataSourcename = Configuration.getStoreDBDatasourceName();
        ctx.rebind(dataSourcename, mds);
       
      } catch (NamingException e) {
        e.printStackTrace();
        logger.debug("", e);
        fail(e.getMessage());
View Full Code Here

   
      try {
        ctx = new InitialContext();
        MockDataSource mds = new MockDataSource(this);
        String dataSourcename = Configuration.getStoreDBDatasourceName();
        ctx.rebind(dataSourcename, mds);
       
      } catch (NamingException e) {
        e.printStackTrace();

      logger.debug("", e);
View Full Code Here

        try {
        MockContextFactory.setAsInitial();
                final Context ctx = NamingContextPool.getNamingContext(null);
                try
                {
                    ctx.rebind(NotifyQueues.CONNECTION_FACTORY, new MockQueueConnectionFactory());
                }
                finally
                {
                    NamingContextPool.releaseNamingContext(ctx) ;
                }
View Full Code Here

    MockQueue mockQueue = new MockQueue(queueName);
       
                final Context ctx = NamingContextPool.getNamingContext(null);
                try
                {
                    ctx.rebind(queueName, mockQueue);
                }
                finally
                {
                    NamingContextPool.releaseNamingContext(ctx) ;
                }
View Full Code Here

    MockTopic mockTopic = new MockTopic(topicName);
   
    final Context ctx = NamingContextPool.getNamingContext(null);
    try
    {
        ctx.rebind(topicName, mockTopic);
    }
    finally
    {
        NamingContextPool.releaseNamingContext(ctx) ;
    }
View Full Code Here

        // Grab the connection created and do a simple Query - we expect a result
      try {
        ctx = new InitialContext();
        MockDataSource mds = new MockDataSource(this);
        String dataSourcename = Configuration.getStoreDBDatasourceName();
        ctx.rebind(dataSourcename, mds);

      } catch (NamingException e) {
      logger.debug("", e);
        fail(e.getMessage());
      } catch (Exception e) {
View Full Code Here

    // Grab the connection created and do a simple Query - we expect a result
      try {
        ctx = new InitialContext();
        MockDataSource mds = new MockDataSource(this);
        String dataSourcename = Configuration.getStoreDBDatasourceName();
        ctx.rebind(dataSourcename, mds);
       
      } catch (NamingException e) {
      logger.debug("", e);
        fail(e.getMessage());
      } catch (Exception e) {
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.