Package javax.naming

Examples of javax.naming.InitialContext.rebind()


            // Step 1: Instantiate Helloservant
            HelloImpl helloRef = new HelloImpl();

            // Step 2: Publish the reference in the NameService using JNDI API
            Context initialNamingContext = new InitialContext();
            initialNamingContext.rebind("HelloService", helloRef );

            System.out.println("Hello Server: Ready...");
     
            // STEP 3: Get ready to accept requests from the client
            // wait for invocations from clients
View Full Code Here


            ref.add(new StringRefAddr("poolPreparedStatements", dbconf
                    .getProperty("poolPreparedStatements")));
            ref.add(new StringRefAddr("maxOpenPreparedStatements", dbconf
                    .getProperty("maxOpenPreparedStatements")));

            ic.rebind("jgossip_db", ref);
        } catch (NamingException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
View Full Code Here

      try {
        DriverManager.registerDriver((Driver)
              Class.forName(dcn).newInstance());
        Object cf = new ConnectionSpecJDBC(url, dcn, user, pass);
        InitialContext ic = new InitialContext();
        ic.rebind(CF_NAME, cf);
      } catch (Exception e) {
        e.printStackTrace();
        fail(e.getMessage());
      }
    }
View Full Code Here

        String url = p.getProperty(SpeedoProperties.JDO_OPTION_CONNECTION_URL);
       
        final String JNDI_NAME="cf";
        try {
            InitialContext ictx = new InitialContext();
            ictx.rebind(JNDI_NAME, new SimpleDataSource(driver, url, user, password));
        } catch (Exception e) {
            System.err.println("Error during the JNDI initialization: " + e.getMessage());
            e.printStackTrace(System.err);
        }
        p.setProperty(SpeedoProperties.MANAGED, Boolean.TRUE.toString());
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

                InitialContext ctx = new InitialContext();
                TransactionManager txManager = MuleManager.getInstance().getTransactionManager();
                if (txManager == null) {
                    throw new InitialisationException(new org.mule.config.i18n.Message(Messages.TX_MANAGER_NOT_SET), this);
                }
                ctx.rebind("PxeTransactionManager", txManager);
                ctx.close();
            } catch (NamingException e) {
                throw new InitialisationException(new org.mule.config.i18n.Message(Messages.FAILED_TO_CREATE_X, descriptor.getName()), e, this);
            }
View Full Code Here

    }

    public void rebind() {
        try {
            InitialContext ic = new InitialContext();
            ic.rebind(JNDI_NAME, "Test2");
        } catch (NamingException e) {
            throw new RuntimeException(e);
        }
    }
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

      if (!OptionHelper.isEmpty(passwordStr)) {
        setter.setProperty("password", passwordStr);
      }

      Context ctx = new InitialContext();
      ctx.rebind("dataSource", ds);
    } catch (Exception oops) {
      addError(
        "Could not bind  datasource. Reported error follows.", oops);
      ec.addError("Could not not bind  datasource of type [" + dsClassName + "].");
    }
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

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.