Package weblogic.jndi

Examples of weblogic.jndi.Environment


    }
    if(url==null){
      exit();
    }
    // get a naming context from the cluster using convenience classes
    Environment env = new Environment();
    env.setProviderUrl(url);
    Context context = env.getInitialContext();
    // lookup the RMI service
    hello = (HelloCluster)context.lookup(HelloClusterImpl.BINDNAME);
 
View Full Code Here


    String url = args[0];
   
    try
    {
      Environment env = new Environment();

      env.setProviderUrl(url);

      // If we've been given an explicit username and password, use
      // them.  Otherwise, the JNDI connection will attempt to default
      // to guest/guest.

      String user = null;
     
      for (int arg = 1; arg < args.length; arg++)
      {
  if (args[arg].equals("-user") && arg + 1 < args.length)
  {
    env.setSecurityPrincipal(user = args[++arg]);
  }
  else if (args[arg].equals("-pass") && arg + 1 < args.length)
  {
    env.setSecurityCredentials(args[++arg]);
  }
  else if (args[arg].equals("-sslCert") && arg + 1 < args.length)
  {
    // If we've been asked to make a secure T3 connection and we
    // have enough arguments, we populate the SSL client
    // certificate so that we can attempt two-way SSL authentication.

    // In order to do this, we must make an array of at least two
    // InputStream objects; the first is the client's private key,
    // and the rest are the certificate chain, starting with the
    // client's certificate (which must be present) and ending with
    // the root CA's certificate.

    InputStream[] certs = readCerts(args[++arg]);

    if (url.startsWith("t3s") || url.startsWith("https"))
    {
      env.setSSLClientCertificate(certs);
    } else {
      fatal("the URL doesn't specify use of SSL");
    }
  }
  else if (args[arg].equals("-cert") && arg + 1 < args.length)
  {
    if (user == null)
    {
      fatal("user name must be specified before certificate chain");
    }
   
    InputStream[] certs = readCerts(args[++arg]);
    X509[] x509 = new X509[certs.length];

    for (int i = 0; i < certs.length; i++)
    {
      x509[i] = new X509(certs[i]);
    }

    env.setSecurityCredentials(new DefaultUserInfoImpl(user, x509));
  } else {
    usage();
  }
      }

      ctx = env.getInitialContext();

      Frobable f = (Frobable) ctx.lookup("frobtarget");
      f.frob();
      System.out.println("Frobbed successfully");
    }
View Full Code Here

   *
   * @param name of this server. Used to locate configuration and log file.
   */
  public BizServer(String name) {
    try {
      context = (new Environment()).getInitialContext();
    }
    catch (NamingException namee) {
      System.err.println("Unable to establish JNDI context.");
      quit = true;
      return;
View Full Code Here

   * Constructor
   *
   */
  public BizAdapter() {
    try {
      context = (new Environment()).getInitialContext();
    }
    catch (NamingException namee) {
      System.err.println("Unable to establish JNDI context.");
    }
  }
View Full Code Here

  private void addMapping(String docType, String beanName) {
    //
    // ensure the name maps to an actual bean
    //
    try {
      Context context = (new Environment()).getInitialContext();

      BizBeanHome bean = (BizBeanHome) context.lookup(beanName);

      //
      // check if docType is already a key and if so add the
View Full Code Here

TOP

Related Classes of weblogic.jndi.Environment

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.