Package javax.naming

Examples of javax.naming.InitialContext.rebind()


            }
        } else {
            // bind RMIDispatcher to InitialContext (must be RMI protocol not IIOP)
            try {
                InitialContext ic = new InitialContext();
                ic.rebind(name, remote);
            } catch (NamingException e) {
                throw new ContainerException("Unable to bind RMIDispatcher to JNDI", e);
            }

            // check JNDI
View Full Code Here


        }

        Context ctx = new InitialContext();

        SQLWorkSpace sp = new SQLWorkSpace();
        ctx.rebind("syrupWorkSpace", sp);

        com.mysql.jdbc.jdbc2.optional.MysqlDataSource ds = new com.mysql.jdbc.jdbc2.optional.MysqlDataSource();
        ds.setURL(url);

        if (user != null)
View Full Code Here

        }
        if (password != null)
        {
            ds.setPassword(password);
        }
        ctx.rebind("syrupDataSource", ds);

        SQLImpl impl = new MySQLImpl();
        ctx.rebind("syrupSQLImpl", impl);
    }
}
View Full Code Here

            ds.setPassword(password);
        }
        ctx.rebind("syrupDataSource", ds);

        SQLImpl impl = new MySQLImpl();
        ctx.rebind("syrupSQLImpl", impl);
    }
}
View Full Code Here

        }

        Context ctx = new InitialContext();

        BlobClient client = new BlobClient(location);
        ctx.rebind("syrupBlobClient", client);

    }
}
View Full Code Here

    try {
      thread.setContextClassLoader(_classLoader);

      try {
        InitialContext ic = new InitialContext();
        ic.rebind("java:comp/BeanManager", new WebBeansJndiProxy());
      } catch (Throwable e) {
        log.log(Level.FINEST, e.toString(), e);
      }

      _singletonScope = new SingletonScope();
View Full Code Here

         try
         {
            ctx = new InitialContext(new Hashtable(environment));
            boolean rebind = Boolean.valueOf((String)environment.get(RMIConnectorServer.JNDI_REBIND_ATTRIBUTE)).booleanValue();
            if (rebind)
               ctx.rebind(jndiURL, rmiServer.toStub());
            else
               ctx.bind(jndiURL, rmiServer.toStub());
            if (logger.isEnabledFor(Logger.DEBUG)) logger.debug("Bound " + rmiServer + " to " + jndiURL);
            return url;
         }
View Full Code Here

      {
         // export the remote object
         PortableRemoteObject.exportObject(this);
         // set up the initialContext
         Context ctx = new InitialContext();
         ctx.rebind(IIOP_JNDI_NAME, this);
         System.out.println("My Service servant started successfully");
         m_isRunning = true;
      }
   }
View Full Code Here

   {
      if (!m_running)
      {
         UnicastRemoteObject.exportObject(this);
         InitialContext ctx = new InitialContext();
         ctx.rebind(JNDI_NAME, this);
         m_running = true;
         System.out.println("My remote service started successfully");
      }
   }
View Full Code Here

        EventLogger.logEvent(msg);
        assertNotNull("No events generated", listAppender1.getEvents());
        assertTrue("Incorrect number of events. Expected 1, got " + listAppender1.getEvents().size(), listAppender1.getEvents().size() == 1);

        // now set jndi resource to Application2
        context.rebind(JNDI_CONTEXT_NAME, "Application2");

        msg = new StructuredDataMessage("Test", "This is a message from Application2", "Context");
        EventLogger.logEvent(msg);
        assertNotNull("No events generated", listAppender2.getEvents());
        assertTrue("Incorrect number of events. Expected 1, got " + listAppender2.getEvents().size(), listAppender2.getEvents().size() == 1);
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.