Package org.jnp.interfaces

Examples of org.jnp.interfaces.Naming


//    env.setProperty("java.naming.provider.url", providerURL);
//    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);
      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


//    env.setProperty("java.naming.provider.url", providerURL);
//   
//    Context ctx = new InitialContext(env);
//      ctx.unbind(NAME);
     
      Naming namingServer = naming.getNamingInstance();
      try
      {
         namingServer.unbind(parser.parse(SUBCONTEXT_NAME + "/" + NAME));
         log.info("Unbound " + SUBCONTEXT_NAME + "/" + NAME + " from " + namingServer);
      }
      catch (NameNotFoundException ignored)
      {
         // already unbound by test
      }
      try
      {
         namingServer.unbind(parser.parse(SUBCONTEXT_NAME));
         log.info("Unbound " + SUBCONTEXT_NAME + " from " + namingServer);
      }
      catch (NameNotFoundException ignored)
      {
         // already unbound by test
      }
      try
      {
         namingServer.unbind(parser.parse(NAME));
         log.info("Unbound " + NAME + " from " + namingServer);
      }
      catch (NameNotFoundException ignored)
      {
         // already unbound by test
      }
      try
      {
         namingServer.unbind(parser.parse(BAD_BINDING));
         log.info("Unbound " + BAD_BINDING + " from " + namingServer);
      }
      catch (NameNotFoundException ignored)
      {
         // already unbound by test
View Full Code Here

   // InitialContextFactory implementation --------------------------
   public Context getInitialContext(Hashtable env)
      throws NamingException
   {
      Naming namingServer = null;
      try
      {
         Hashtable env2 = (Hashtable) env.clone();
         env2.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
         // Retrieve the Naming interface
View Full Code Here

   {
      log.debug("Creating NamingServer stub, theServer="+theServer
         +",rmiPort="+rmiPort
         +",clientSocketFactory="+clientSocketFactory
         +",serverSocketFactory="+serverSocketFactory);
      Naming instance = getNamingInstance();
      Remote stub = UnicastRemoteObject.exportObject(instance,
            rmiPort, clientSocketFactory, serverSocketFactory);
      log.debug("NamingServer stub: "+stub);
      serverStub = new MarshalledObject(stub);
      isStubExported = true;
View Full Code Here

   {
      log.debug("Creating NamingServer stub, theServer="+theServer
         +",rmiPort="+rmiPort
         +",clientSocketFactory="+clientSocketFactory
         +",serverSocketFactory="+serverSocketFactory);
      Naming instance = getNamingInstance();
      Remote stub = UnicastRemoteObject.exportObject(instance,
            rmiPort, clientSocketFactory, serverSocketFactory);
      log.debug("NamingServer stub: "+stub);
      serverStub = new MarshalledObject(stub);
      isStubExported = true;
View Full Code Here

   {
      log.debug("Creating NamingServer stub, theServer="+theServer
         +",rmiPort="+rmiPort
         +",clientSocketFactory="+clientSocketFactory
         +",serverSocketFactory="+serverSocketFactory);
      Naming instance = getNamingInstance();
      Remote stub = UnicastRemoteObject.exportObject(instance,
            rmiPort, clientSocketFactory, serverSocketFactory);
      log.debug("NamingServer stub: "+stub);
      serverStub = new MarshalledObject(stub);
      isStubExported = true;
View Full Code Here

    *
    * @throws Exception    Failed to invoke method.
    */
   public Object invoke(Invocation invocation) throws Exception
   {
      Naming theServer = namingMain.getNamingInstance();
      // Set the method hash to Method mapping
      if (invocation instanceof MarshalledInvocation)
      {
         MarshalledInvocation mi = (MarshalledInvocation) invocation;
         mi.setMethodMap(marshalledInvocationMapping);
View Full Code Here

   {
      log.debug("Creating NamingServer stub, theServer="+theServer
         +",rmiPort="+rmiPort
         +",clientSocketFactory="+clientSocketFactory
         +",serverSocketFactory="+serverSocketFactory);
      Naming instance = getNamingInstance();
      Remote stub = UnicastRemoteObject.exportObject(instance,
            rmiPort, clientSocketFactory, serverSocketFactory);
      log.debug("NamingServer stub: "+stub);
      serverStub = new MarshalledObject(stub);     
   }
View Full Code Here

      log.debug("Creating NamingServer stub, theServer="+theServer
         +",rmiPort="+rmiPort
         +",clientSocketFactory="+clientSocketFactory
         +",serverSocketFactory="+serverSocketFactory);
     
      Naming instance = getNamingInstance();
      Remote stub;
      if (getUseGlobalService()) {
         namingServerGuard = new NamingServerGuard(instance);
         stub = UnicastRemoteObject.exportObject(namingServerGuard,
               rmiPort, clientSocketFactory, serverSocketFactory);
View Full Code Here

         provider = "https:" + provider.substring(10);

      tryLogin(env);

      URL providerURL = null;
      Naming namingServer = null;
      try
      {
         providerURL = new URL(provider);
         // Retrieve the Naming interface
         namingServer = getNamingServer(providerURL);
View Full Code Here

TOP

Related Classes of org.jnp.interfaces.Naming

Copyright © 2018 www.massapicom. 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.