Package javax.naming

Examples of javax.naming.Context.bind()


      getLog().debug("HAJndiTestCase.testHAJndiOperations()");
      validateUrls();
     
      // bind to node0 using HA-JNDI
      Context naming = getContext(NODE0_HAJNDI);
      naming.bind(JNDI_KEY, JNDI_VALUE1);    
    
      // lookup binding using HA-JNDI on Node0 - should succeed
      String value = (String)lookup(naming, JNDI_KEY, true);
      assertEquals("lookup after initial HA-JNDI binding operation", JNDI_VALUE1, value);
     
View Full Code Here


      assertEquals("lookup after initial HA-JNDI binding operation", JNDI_VALUE1, value);
     
      // bind it again - this should fail with NameAlreadyBoundException     
      try
      {
         naming.bind(JNDI_KEY, JNDI_VALUE1);
         fail("binding key a second time in HA-JNDI should throw NamingException");
      }
      catch (NamingException ne)
      {
         assertTrue("binding key a second time in HA-JNDI should throw NamingException", ne instanceof NamingException);
View Full Code Here

      Context sub1a = sub1.createSubcontext(SUBCON1A);
     
      // bind something to each subcontext
      sub1.bind(SUB1_KEY, SUB1_VALUE);
      sub2.bind(SUB2_KEY, SUB2_VALUE);
      sub1a.bind(SUB1A_KEY, SUB1A_VALUE);     
    
      // close contexts
      naming.close();
      sub1.close();
      sub2.close();
View Full Code Here

         return;
      }
     
      // bind to node1 locally
      Context naming = getContext(NODE1_JNDI);
      naming.bind(LOCAL1_KEY, LOCAL1_VALUE);
      closeContext(naming);
     
      // bind to node0 using HA-JNDI
      naming = getContext(NODE0_HAJNDI);
      naming.bind(JNDI_KEY3, JNDI_VALUE3)
View Full Code Here

      naming.bind(LOCAL1_KEY, LOCAL1_VALUE);
      closeContext(naming);
     
      // bind to node0 using HA-JNDI
      naming = getContext(NODE0_HAJNDI);
      naming.bind(JNDI_KEY3, JNDI_VALUE3)
      closeContext(naming);
    
      //create context with AutoDiscovery enabled
      naming = getAutoDiscoveryContext(false);
     
View Full Code Here

         {
            log.debug("Unable to retrieve orb" + t.toString());
         }

         // TODO: injection, Add a link to the global transaction manager
         envCtx.bind("UserTransaction", new LinkRef("UserTransaction"));
         log.debug("Linked java:comp/UserTransaction to JNDI name: UserTransaction");
         envCtx = envCtx.createSubcontext("env");
         processEncReferences(webApp, envCtx);
      }
      finally
View Full Code Here

        return this;
      }

      param = parameters[0];
      if (param instanceof AnyName) {
        ctx.bind((Name)param.toObject(), value);
      } else {
        ctx.bind(param.toString(), value);
      }
     
    } catch (NamingException e) {
View Full Code Here

      param = parameters[0];
      if (param instanceof AnyName) {
        ctx.bind((Name)param.toObject(), value);
      } else {
        ctx.bind(param.toString(), value);
      }
     
    } catch (NamingException e) {
      throw context.exception(e);
    }
View Full Code Here

                Map.Entry entry = (Map.Entry) iterator.next();
                String name = (String) entry.getKey();
                Object value = entry.getValue();
                if (value == null) continue;
                try {
                    context.bind(name, value);
                } catch (NamingException e) {
                    throw new org.apache.openejb.SystemException("Unable to bind '" + name + "' into bean's enc.", e);
                }
            }
        }
View Full Code Here

                    context.createSubcontext(contextName);
                }
            }

            // bind
            context.bind(jndiName, value);
            log.info("JavaMail session bound to " + jndiName);
        }
    }

    public void doStop() throws Exception {
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.