Package javax.naming

Examples of javax.naming.InitialContext.bind()


    */
   public void start() throws Throwable
   {
      Context context = new InitialContext();

      context.bind(JNDI_NAME, this);

      context.close();
   }

   /**
 
View Full Code Here


      CacheSPI<Object, Object> cache = cacheTL.get();
      cache.getConfiguration().setCacheLoaderConfig(getSingleCacheLoaderConfig("", "org.jboss.cache.loader.JDBCCacheLoader", props, false, true, false));
      cache.create();


      context.bind(JNDI_NAME, ds);
      assertNotNull(JNDI_NAME + " bound", context.lookup(JNDI_NAME));
   }

   public void testLargeObject()
   {
View Full Code Here

         try
         {
            Properties p = new Properties();
            p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.cache.transaction.DummyContextFactory");
            Context ctx = new InitialContext(p);
            ctx.bind("java:/TransactionManager", instance);
            ctx.bind("UserTransaction", new DummyUserTransaction(instance));
         }
         catch (NamingException e)
         {
            log.error("binding of DummyTransactionManager failed", e);
View Full Code Here

         {
            Properties p = new Properties();
            p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.cache.transaction.DummyContextFactory");
            Context ctx = new InitialContext(p);
            ctx.bind("java:/TransactionManager", instance);
            ctx.bind("UserTransaction", new DummyUserTransaction(instance));
         }
         catch (NamingException e)
         {
            log.error("binding of DummyTransactionManager failed", e);
         }
View Full Code Here

      for (BindReferencePlugin plugin : bindReferencesPlugins)
      {
         try
         {
            InitialContext ic = getInitialContext();
            ic.bind(plugin.getBindName(), plugin.getReference());
            LOG.info("Reference bound (by recall()): " + plugin.getBindName());
         }
         catch (NameAlreadyBoundException e)
         {
            LOG.debug("Name already bound: " + plugin.getBindName());
View Full Code Here

      for (BindReferencePlugin plugin : bindReferencesPlugins)
      {
         try
         {
            InitialContext ic = getInitialContext();
            ic.bind(plugin.getBindName(), plugin.getReference());
            LOG.info("Reference bound (by recall()): " + plugin.getBindName());
         }
         catch (NameAlreadyBoundException e)
         {
            LOG.debug("Name already bound: " + plugin.getBindName());
View Full Code Here

@Stateless
public class BeanWithBind {
    public void doBind() {
        try {
            final Context context = new InitialContext();
            context.bind("java:jboss/test", "Test");
            context.bind("java:comp/test", "Test");
            context.bind("java:/test", "Test");
        } catch (NamingException e) {
            throw new RuntimeException(e);
        }
View Full Code Here

public class BeanWithBind {
    public void doBind() {
        try {
            final Context context = new InitialContext();
            context.bind("java:jboss/test", "Test");
            context.bind("java:comp/test", "Test");
            context.bind("java:/test", "Test");
        } catch (NamingException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

    public void doBind() {
        try {
            final Context context = new InitialContext();
            context.bind("java:jboss/test", "Test");
            context.bind("java:comp/test", "Test");
            context.bind("java:/test", "Test");
        } catch (NamingException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

        String msg = req.getParameter("op");

        if ("bind".equals(msg)) {
            try {
                final Context context = new InitialContext();
                context.bind("java:jboss/web-test", "Test");
                context.bind("java:comp/web-test", "Test");
                context.bind("java:/web-test", "Test");
            } catch (NamingException e) {
                throw new ServletException(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.