Examples of removeFromEnvironment()


Examples of javax.naming.Context.removeFromEnvironment()

        try {
            Context initCtx = new InitialContext();
            Context myEnv = (Context) initCtx.lookup("java:comp/env");

            myEnv.addToEnvironment("flt00", new Float(INJECTED_FLOAT));
            myEnv.removeFromEnvironment("flt00");

        } catch (NamingException e) {
            throw new IllegalStateException("The context could not be obtained.");
        }
    }
View Full Code Here

Examples of javax.naming.Context.removeFromEnvironment()

   private Context createInitialContext(Hashtable env) throws NamingException
   {
      Context ctx1 = new InitialContext(env);
      if (ctx1.getEnvironment().get(NamingContext.JNP_DISCOVERY_GROUP) != null)
      {
         ctx1.removeFromEnvironment(Context.PROVIDER_URL);
      }
      return ctx1;
   }

   private void redeployNaming() throws Exception
View Full Code Here

Examples of javax.naming.Context.removeFromEnvironment()

    public Object removeFromEnvironment(String propName) throws NamingException {
        Context ctx = getDefaultContext();

        if (ctx != null) {
            ctx.removeFromEnvironment(propName);
        }
       
        return env.remove(propName);
    }
View Full Code Here

Examples of javax.naming.Context.removeFromEnvironment()

    public Object removeFromEnvironment(String propName) throws NamingException {
        Context ctx = getDefaultContext();

        if (ctx != null) {
            ctx.removeFromEnvironment(propName);
        }
       
        return env.remove(propName);
    }
View Full Code Here

Examples of javax.naming.Context.removeFromEnvironment()

   private Context createInitialContext(Hashtable env) throws NamingException
   {
      Context ctx1 = new InitialContext(env);
      if (ctx1.getEnvironment().get(NamingContext.JNP_DISCOVERY_GROUP) != null)
      {
         ctx1.removeFromEnvironment(Context.PROVIDER_URL);
      }
      return ctx1;
   }

   private void redeployNaming() throws Exception
View Full Code Here

Examples of javax.naming.Context.removeFromEnvironment()

    context3.unbind("myobject");

    assertTrue("Correct environment", context3.getEnvironment() != context2.getEnvironment());
    context3.addToEnvironment("key2", "value2");
    assertTrue("key2 added", "value2".equals(context3.getEnvironment().get("key2")));
    context3.removeFromEnvironment("key1");
    assertTrue("key1 removed", context3.getEnvironment().get("key1") == null);

    assertTrue("Correct DataSource registered", context1.lookup("jdbc/myds") == ds);
    try {
      context1.lookup("myobject");
View Full Code Here

Examples of javax.naming.Context.removeFromEnvironment()

  public Object removeFromEnvironment(String propName) throws NamingException
  {
    Context ctx = getDefaultContext();
   
    if (ctx != null) ctx.removeFromEnvironment(propName);
   
    return env.remove(propName);
  }

  public void rename(Name oldName, Name newName) throws NamingException
View Full Code Here

Examples of javax.naming.Context.removeFromEnvironment()

  /**  
         * Removes an environment property from the environment of this context.
         */  
  public Object removeFromEnvironment(String propName) throws NamingException {
    Context ctx = getImpl();
    return ctx.removeFromEnvironment(propName);
  }
         

  /**  
         * Binds a new name to the object bound to an old name, and unbinds the old name.
View Full Code Here

Examples of javax.naming.Context.removeFromEnvironment()

    context3.unbind("myobject");

    assertTrue("Correct environment", context3.getEnvironment() != context2.getEnvironment());
    context3.addToEnvironment("key2", "value2");
    assertTrue("key2 added", "value2".equals(context3.getEnvironment().get("key2")));
    context3.removeFromEnvironment("key1");
    assertTrue("key1 removed", context3.getEnvironment().get("key1") == null);

    assertTrue("Correct DataSource registered", context1.lookup("jdbc/myds") == ds);
    try {
      context1.lookup("myobject");
View Full Code Here

Examples of javax.naming.InitialContext.removeFromEnvironment()

   private Context createInitialContext(Hashtable env) throws NamingException
   {
      Context ctx1 = new InitialContext(env);
      if (ctx1.getEnvironment().get(NamingContext.JNP_DISCOVERY_GROUP) != null)
      {
         ctx1.removeFromEnvironment(Context.PROVIDER_URL);
      }
      return ctx1;
   }

   private void redeployNaming() throws Exception
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.