Package javax.naming

Examples of javax.naming.InitialContext.rebind()


  /** Binds an object to the JNDI context. */
  void bind(String name, Object obj) {
    try {
      Context ctx = new InitialContext();
      ctx.rebind(name, obj);
      if (! boundNames.contains(name))
        boundNames.add(name);
    } catch (Exception e) {
      if (logger.isLoggable(BasicLevel.WARN))
        logger.log(BasicLevel.WARN,
View Full Code Here


      redeployNaming();
     
      Context ctx2 = new InitialContext(env);
      try
      {
         ctx2.rebind(ObjectBinder.NAME, ObjectBinder.VALUE);
      }
      catch (NamingException e)
      {
         log.error("Caught NamingException", e);
         fail(e.getMessage());
View Full Code Here

      parser = ctx.getNameParser("");

      RefAddr refAddr = new StringRefAddr("nns", "JSMCachePolicy");
      String factoryName = DefaultCacheObjectFactory.class.getName();
      Reference ref = new Reference("javax.naming.Context", refAddr, factoryName, null);
      ctx.rebind(DEFAULT_CACHE_POLICY_PATH, ref);
      log.debug("cachePolicyCtxPath="+cacheJndiName);

      // Bind the default SecurityProxyFactory instance under java:/SecurityProxyFactory
      SecurityProxyFactory proxyFactory = (SecurityProxyFactory) securityProxyFactoryClass.newInstance();
      ctx.bind("java:/SecurityProxyFactory", proxyFactory);
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

    { ctx = ctx.createSubcontext( name.get( i ) ); }
    catch (NameAlreadyBoundException ignore)
    { ctx = (Context) ctx.lookup( name.get( i ) ); }
      }

       ictx.rebind( jndiName, combods );
  }


    }
View Full Code Here

    { ctx = ctx.createSubcontext( name.get( i ) ); }
    catch (NameAlreadyBoundException ignore)
    { ctx = (Context) ctx.lookup( name.get( i ) ); }
      }

       ictx.rebind( jndiName, combods );
  }


    }
View Full Code Here

      Inquiry inquiry = new InquiryService();
      if (log.isDebugEnabled()) {
        log.debug("Setting " + INQUIRY_SERVICE + ", " + inquiry.getClass().getName());
      }
      mInquery = inquiry;
      context.rebind(INQUIRY_SERVICE, inquiry);
      Publish publish = new PublishService();
      if (log.isDebugEnabled()) {
        log.debug("Setting " + PUBLISH_SERVICE + ", " + publish.getClass().getName());
      }
      mPublish = publish;
View Full Code Here

      Publish publish = new PublishService();
      if (log.isDebugEnabled()) {
        log.debug("Setting " + PUBLISH_SERVICE + ", " + publish.getClass().getName());
      }
      mPublish = publish;
      context.rebind(PUBLISH_SERVICE, publish);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
}
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.