Package org.jnp.interfaces

Examples of org.jnp.interfaces.Naming.bind()


         Name hello = ctx.getNameParser("").parse("Hello");

         // Try to create a binding without security context
         try
         {
            naming.bind(hello, "HelloBinding", "java.lang.String");
            fail("Was able to invoke secretEcho");
         }
         catch(Exception e)
         {
            getLog().info("bind op failed as expected", e);
View Full Code Here


         }

         SimplePrincipal jduke = new SimplePrincipal("jduke");
         SecurityAssociation.setPrincipal(jduke);
         SecurityAssociation.setCredential("theduke".toCharArray());
         naming.bind(hello, "HelloBinding", "java.lang.String");
         getLog().info("Was able to create Hello binding");

         SimplePrincipal guest = new SimplePrincipal("guest");
         SecurityAssociation.setPrincipal(guest);
         SecurityAssociation.setCredential("guest".toCharArray());
View Full Code Here

         SimplePrincipal guest = new SimplePrincipal("guest");
         SecurityAssociation.setPrincipal(guest);
         SecurityAssociation.setCredential("guest".toCharArray());
         try
         {
            naming.bind(hello, "HelloBinding2", "java.lang.String");
            fail("guest was able to create binding");
         }
         catch(Exception e)
         {
            getLog().info("guest bind op failed as expected", e);
View Full Code Here

//    log.info("Env = " + env);
//    Context ctx = new InitialContext(env);
//    ctx.bind(NAME, VALUE);
     
      Naming namingServer = naming.getNamingInstance();
      namingServer.bind(parser.parse(NAME),
                                      new MarshalledValuePair(VALUE),
                                      VALUE.getClass().getName());
      log.info("Bound " + VALUE + " to " + namingServer + " under " + NAME);
      Context sub = namingServer.createSubcontext(parser.parse(SUBCONTEXT_NAME));
      sub.bind(parser.parse(NAME), VALUE);
View Full Code Here

      log.info("Bound " + VALUE + " to " + sub + " under " + NAME);
     
      // NOTE: we must bind the NonDeserializable directly, or else the
      // NamingContext will wrap it in a MarshalledValuePair, which will
      // defeat the test by triggering deserialization too late
      namingServer.bind(parser.parse(BAD_BINDING), new NonDeserializable(),
                                     NonDeserializable.class.getName());

      log.info("Bound a NonDeserializable to " + namingServer + " under " + BAD_BINDING);
     
   }
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.