Package javax.naming

Examples of javax.naming.Context.rebind()


      {
         assertTrue("binding key a second time in HA-JNDI should throw NamingException", ne instanceof NamingException);
      }
     
      // rebind it using a different value
      naming.rebind(JNDI_KEY, JNDI_VALUE2)
     
      // lookup binding - should return new value
      value = (String)lookup(naming, JNDI_KEY, true);
      assertEquals("lookup after HA-JNDI rebind operation", JNDI_VALUE2, value);
     
View Full Code Here


      so that any lookup against java:/jaas/domain returns an instance of our
      security manager class.
      */
     RefAddr refAddr = new StringRefAddr("nns", "JSM");
     Reference ref = new Reference("javax.naming.Context", refAddr, factoryName, null);
     ctx.rebind(this.baseContext, ref);
   }
}
View Full Code Here

   }

   private void establishPolicyRegistration() throws Exception
   {
      Context ctx = new InitialContext();
      ctx.rebind(this.policyRegistrationContextName, this.policyRegistration);
   }
  
   private void establishSecurityManagement() throws Exception
   {
      Context ctx = new InitialContext();
View Full Code Here

   }
  
   private void establishSecurityManagement() throws Exception
   {
      Context ctx = new InitialContext();
      ctx.rebind(this.securityManagementContextName, this.securityManagement);
   }
}
View Full Code Here

    Context ctx = getContext();
    try {
      Any param1 = parameters[0];
      Any param2 = parameters[1];
      if (param1 instanceof AnyName && param2 instanceof AnyName) {
        ctx.rebind((Name)param1.toObject(), (Name)param2.toObject());
      } else if (parameters[0].isString()) {
        ctx.rebind(param1.toString(), param2.toString());
      }
    } catch (NamingException e) {
      throw context.exception(e);
View Full Code Here

      Any param1 = parameters[0];
      Any param2 = parameters[1];
      if (param1 instanceof AnyName && param2 instanceof AnyName) {
        ctx.rebind((Name)param1.toObject(), (Name)param2.toObject());
      } else if (parameters[0].isString()) {
        ctx.rebind(param1.toString(), param2.toString());
      }
    } catch (NamingException e) {
      throw context.exception(e);
    }
    return this;
View Full Code Here

        return this;
      }

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

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

            for (Map.Entry<String, Object> entry : webContext.getBindings().entrySet()) {
                try {
                    final String key = entry.getKey();
                    Object value = normalize(entry.getValue());
                    Contexts.createSubcontexts(root, key);
                    root.rebind(key, value);
                } catch (NamingException e) {
                    e.printStackTrace();
                }
            }
        }
View Full Code Here

        // try to force some binding which probably failed earlier (see in TomcatWebappBuilder)
        try {
            Context comp = (Context) ContextBindings.getClassLoader().lookup("comp");
            TransactionManager transactionManager = SystemInstance.get().getComponent(TransactionManager.class);
            comp.rebind("TransactionManager", transactionManager);

            // bind TransactionSynchronizationRegistry
            TransactionSynchronizationRegistry synchronizationRegistry = SystemInstance.get().getComponent(TransactionSynchronizationRegistry.class);
            comp.rebind("TransactionSynchronizationRegistry", synchronizationRegistry);
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.