Demos and Usage of javax.naming.InitialContext.rebind(Name name,Object obj)


   1: import java.rmi.server.UnicastRemoteObject;
   2: import javax.naming.InitialContext;
   3: 
   4:         ...
   5:          UnicastRemoteObject.exportObject(this);
   6:          InitialContext ctx = new InitialContext();
   7:         ...
   8:          ctx.rebind(JNDI_NAME, this);
   9:          m_running = true;

View Full Code Here
   1: 
   2:             InitialContext context = createContext();
   3:         ...
   4:             context.rebind("HrDS", dataSource);
   5:             
   6:         ...
   7:     
   8:     private static InitialContext createContext() throws NamingException {
   9:         Properties env = new Properties();
  10:         ...
  11:             "com.sun.jndi.rmi.registry.RegistryContextFactory");
  12:         InitialContext context = new InitialContext( env );

View Full Code Here
   1: 
   2: import javax.naming.InitialContext;
   3: import javax.naming.NamingException;
   4:         ...
   5:         try {
   6:             InitialContext initalContext = new InitialContext(jndiProperties);
   7:         ...
   8:             initalContext.rebind(jndiName, dataSource);
   9:         } catch (NamingException e) {

View Full Code Here
   1: 
   2:         InitialContext ctx = new InitialContext();
   3:         ...
   4:         ctx.rebind( jndiName, ds );
   5:         System.out.println("DataSource bound to nameservice under the name \"" +
   6:                    jndiName + '\"');
   7:         }

View Full Code Here
   1: 
   2:         InitialContext ctx = new InitialContext();
   3:         ...
   4:         ctx.rebind( dmds_name , dmds );
   5:         System.out.println( "DriverManagerDataSource bounds as " + dmds_name );
   6:         ...
   7:         ctx.rebind( cpds_name , cpds );
   8:         System.out.println( "ConnectionPoolDataSource bounds as " + cpds_name );
   9:         ...
  10:         ctx.rebind( pbds_name , pbds );

View Full Code Here
   1: 
   2:         InitialContext ctx = new InitialContext();
   3:         ...
   4:         ctx.rebind( dmds_name , dmds );
   5:         System.out.println( "DriverManagerDataSource bounds as " + dmds_name );
   6:         ...
   7:         ctx.rebind( cpds_name , cpds );
   8:         System.out.println( "ConnectionPoolDataSource bounds as " + cpds_name );
   9:         ...
  10:         ctx.rebind( pbds_name , pbds );

View Full Code Here
   1: 
   2:         InitialContext ctx = new InitialContext();
   3:         ...
   4:         ctx.rebind( dmds_name , dmds );
   5:         System.out.println( "DriverManagerDataSource bounds as " + dmds_name );
   6:         ...
   7:         ctx.rebind( cpds_name , cpds );
   8:         System.out.println( "ConnectionPoolDataSource bounds as " + cpds_name );
   9:         ...
  10:         ctx.rebind( pbds_name , pbds );

View Full Code Here
   1:                 System.out.println("Binding datasource to '"+jndiName+"'");
   2:                 InitialContext ctx = new InitialContext();
   3:         ...
   4:                 ctx.rebind(jndiName, ds);
   5: 
   6:                 assertSuccess();
   7:             }

View Full Code Here
   1: import java.net.URL;
   2: import javax.naming.InitialContext;
   3: import javax.naming.Reference;
   4:         ...
   5: 
   6:         InitialContext ctx = new InitialContext();
   7:         ...
   8:         NonSerializableFactory.rebind(jndiName, securityPolicy);
   9: 
  10:         ...
  11:         Reference memoryRef = new Reference(className, addr, factory, null);
  12:         ctx.rebind(jndiName, memoryRef);

View Full Code Here
   1:             {
   2:             Object obj = new InitialContext().lookup(jndiName);
   3:             cachedPMF = (PersistenceManagerFactory) PortableRemoteObject.narrow(obj,
   4:         ...
   5:          {
   6:          Object obj = new InitialContext().lookup(jndiName);
   7:          cachedCF = (ConnectionFactory) PortableRemoteObject.narrow(obj,
   8:         ...
   9:       {
  10:       Object obj = new InitialContext().lookup(jndiName);
  11:       return (String) PortableRemoteObject.narrow(obj, String.class);
  12:         ...
  13: 
  14:       jndiContext.rebind(jndiName, pmf);

View Full Code Here
   1: import javax.naming.Binding;
   2: import javax.naming.InitialContext;
   3: import javax.naming.Name;
   4:         ...
   5:    {
   6:       Context ctx = (Context)new InitialContext().lookup("");
   7:       Name n = ctx.getNameParser("").parse(name);
   8:         ...
   9:          
  10:          InitialContext iniCtx = new InitialContext(); 
  11:          Context ctx = iniCtx;
  12:         ...
  13:          
  14:          iniCtx.rebind("test/server2", hello2);

View Full Code Here
   1: import javax.sql.DataSource;
   2: import javax.naming.InitialContext;
   3: import javax.naming.Name;
   4:         ...
   5:     {
   6:     InitialContext ictx = new InitialContext();
   7:     if (unbindName != null)
   8:         ...
   9: 
  10:          ictx.rebind( jndiName, combods );
  11:     }

View Full Code Here
   1: import javax.sql.DataSource;
   2: import javax.naming.InitialContext;
   3: import javax.naming.Name;
   4:         ...
   5:     {
   6:     InitialContext ictx = new InitialContext();
   7:     if (unbindName != null)
   8:         ...
   9: 
  10:          ictx.rebind( jndiName, combods );
  11:     }

View Full Code Here
   1: import java.net.URL;
   2: import javax.naming.InitialContext;
   3: import javax.security.auth.Subject;
   4:         ...
   5:       getLog().info("testCertLogin");
   6:       InitialContext ctx = new InitialContext();
   7:       ctx.rebind("testCertLogin", new TestSecurityDomain());
   8:         ...
   9:       InitialContext ctx = new InitialContext();
  10:       ctx.rebind("testJdbc", ds);

View Full Code Here