Package org.jnp.interfaces

Examples of org.jnp.interfaces.Naming


   }

   @Override
   protected void createService() throws Exception
   {
      Naming naming = NamingContext.getHANamingServerForPartition(clusterPartition.getPartitionName());
      try
      {
         super.createService();
      }
      finally
View Full Code Here


   }

   @Override
   protected void stopService() throws Exception
   {
      Naming naming = NamingContext.getHANamingServerForPartition(clusterPartition.getPartitionName());
      try
      {
         super.stopService();
      }
      finally
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

         else
            log.warn(msg);
         IOException e = new IOException(msg);
         throw e;
      }
      Naming namingServer = (Naming) obj;
      return namingServer;
   }
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

   // InitialContextFactory implementation
   public Context getInitialContext(Hashtable env) throws NamingException
   {
      Class[] interfaces = {Naming.class};
      Interceptor[] interceptors;
      Naming naming;

      // Get the login principal and credentials from the JNDI env
      Object credentials = env.get(Context.SECURITY_CREDENTIALS);
      Object principal = env.get(Context.SECURITY_PRINCIPAL);
      Object protocol = env.get(Context.SECURITY_PROTOCOL);

      if (principal != null && credentials != null)
      {
         if (protocol != null)
         {
            login(principal, credentials, protocol);
         }
         else
         {
            associateSecurityInformation(principal, credentials);
         }
         Interceptor[] tmp = {IsLocalInterceptor.singleton, SecurityClientInterceptor.singleton, InvokeRemoteInterceptor.singleton};
         interceptors = tmp;
      }
      else
      {
         Interceptor[] tmp = {IsLocalInterceptor.singleton, InvokeRemoteInterceptor.singleton};
         interceptors = tmp;
      }

      Naming local = NamingContext.getLocal();
      if (local != null) return new NamingContext(env, null, local);

      String providerUrl = (String) env.get(Context.PROVIDER_URL);
      if (providerUrl == null)
      {
View Full Code Here

         boolean isRegistered = server.isRegistered(xmbean);
         assertTrue(xmbean+" is registered", isRegistered);

         // Lookup the Naming interface
         InitialContext ctx = this.getInitialContext();
         Naming naming = (Naming) ctx.lookup("secure/Naming");
         getLog().info("Found Naming proxy: "+naming);
         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);
         }

         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());
         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

         boolean isRegistered = server.isRegistered(xmbean);
         assertTrue(xmbean+" is registered", isRegistered);

         // Lookup the Naming interface
         InitialContext ctx = this.getInitialContext();
         Naming naming = (Naming) ctx.lookup("secure/Naming");
         getLog().info("Found Naming proxy: "+naming);
         Name hello = ctx.getNameParser("").parse("Hello");

         SimplePrincipal jduke = new SimplePrincipal("jduke");
         SecurityAssociation.setPrincipal(jduke);
         SecurityAssociation.setCredential("theduke".toCharArray());

         // Lookup the previous Hello binding
         String value = (String) naming.lookup(hello);
         assertTrue("lookup(Hello) == HelloBinding", value.equals("HelloBinding"));
         getLog().info("lookup(Hello) = "+value);
      }
      finally
      {
View Full Code Here

   }

   @Override
   protected void createService() throws Exception
   {
      Naming naming = NamingContext.getHANamingServerForPartition(clusterPartition.getPartitionName());
      try
      {
         super.createService();
      }
      finally
View Full Code Here

   }

   @Override
   protected void stopService() throws Exception
   {
      Naming naming = NamingContext.getHANamingServerForPartition(clusterPartition.getPartitionName());
      try
      {
         super.stopService();
      }
      finally
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.