Java Code Examples for gnu.CORBA.NamingService.Ext

The following are top voted examples for showing how to use gnu.CORBA.NamingService.Ext. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: javify   File: Main.java   Source Code and License 4 votes vote down vote up
private void run(String[] args)
{
  Parser parser = initializeParser();
  parser.parse(args);

  try
    {
      // Create and initialize the ORB
      final OrbFunctional orb = new OrbFunctional();
      OrbFunctional.setPort(port);

      // Create the servant and register it with the ORB
      File dataDirectory = new File(directory);
      System.out.println("Persistent data stored at "
                         + dataDirectory.getAbsolutePath());
      dataDirectory.mkdirs();

      // / TODO support more starting modes.
      NamingContextExt namer = new Ext(
                                       new PersistentContext(
                                                             orb,
                                                             dataDirectory,
                                                             cold));

      // Case with the key "NameService".
      orb.connect(namer, "NameService".getBytes());

      // Storing the IOR reference.
      String ior = orb.object_to_string(namer);
      IOR iorr = IOR.parse(ior);
      if (iorf != null)
        {
          FileOutputStream f = new FileOutputStream(iorf);
          PrintStream p = new PrintStream(f);
          p.print(ior);
          p.close();
        }

      System.out.println("GNU Classpath persistent naming service "
                         + "started at " + iorr.Internet.host + ":"
                         + iorr.Internet.port + " key 'NameService'.\n\n"
                         + "Copyright (C) 2008 Free Software Foundation\n"
                         + "This tool comes with ABSOLUTELY NO WARRANTY. "
                         + "This is free software, and you are\nwelcome to "
                         + "redistribute it under conditions, defined in "
                         + "GNU Classpath license.\n\n" + ior);

      new Thread()
      {
        public void run()
        {
          // Wait for invocations from clients.
          orb.run();
        }
      }.start();
    }
  catch (FileNotFoundException e)
    {
      throw new RuntimeException(e);
    }
  finally
    {
      // Restore the default value for allocating ports for the subsequent
      // objects.
      OrbFunctional.setPort(OrbFunctional.DEFAULT_INITIAL_PORT);
    }
}
 
Example 2
Project: jvm-stm   File: Main.java   Source Code and License 4 votes vote down vote up
private void run(String[] args)
{
  Parser parser = initializeParser();
  parser.parse(args);

  try
    {
      // Create and initialize the ORB
      final OrbFunctional orb = new OrbFunctional();
      OrbFunctional.setPort(port);

      // Create the servant and register it with the ORB
      File dataDirectory = new File(directory);
      System.out.println("Persistent data stored at "
                         + dataDirectory.getAbsolutePath());
      dataDirectory.mkdirs();

      // / TODO support more starting modes.
      NamingContextExt namer = new Ext(
                                       new PersistentContext(
                                                             orb,
                                                             dataDirectory,
                                                             cold));

      // Case with the key "NameService".
      orb.connect(namer, "NameService".getBytes());

      // Storing the IOR reference.
      String ior = orb.object_to_string(namer);
      IOR iorr = IOR.parse(ior);
      if (iorf != null)
        {
          FileOutputStream f = new FileOutputStream(iorf);
          PrintStream p = new PrintStream(f);
          p.print(ior);
          p.close();
        }

      System.out.println("GNU Classpath persistent naming service "
                         + "started at " + iorr.Internet.host + ":"
                         + iorr.Internet.port + " key 'NameService'.\n\n"
                         + "Copyright (C) 2008 Free Software Foundation\n"
                         + "This tool comes with ABSOLUTELY NO WARRANTY. "
                         + "This is free software, and you are\nwelcome to "
                         + "redistribute it under conditions, defined in "
                         + "GNU Classpath license.\n\n" + ior);

      new Thread()
      {
        public void run()
        {
          // Wait for invocations from clients.
          orb.run();
        }
      }.start();
    }
  catch (FileNotFoundException e)
    {
      throw new RuntimeException(e);
    }
  finally
    {
      // Restore the default value for allocating ports for the subsequent
      // objects.
      OrbFunctional.setPort(OrbFunctional.DEFAULT_INITIAL_PORT);
    }
}
 
Example 3
Project: JamVM-PH   File: Main.java   Source Code and License 4 votes vote down vote up
private void run(String[] args)
{
  Parser parser = initializeParser();
  parser.parse(args);

  try
    {
      // Create and initialize the ORB
      final OrbFunctional orb = new OrbFunctional();
      OrbFunctional.setPort(port);

      // Create the servant and register it with the ORB
      File dataDirectory = new File(directory);
      System.out.println("Persistent data stored at "
                         + dataDirectory.getAbsolutePath());
      dataDirectory.mkdirs();

      // / TODO support more starting modes.
      NamingContextExt namer = new Ext(
                                       new PersistentContext(
                                                             orb,
                                                             dataDirectory,
                                                             cold));

      // Case with the key "NameService".
      orb.connect(namer, "NameService".getBytes());

      // Storing the IOR reference.
      String ior = orb.object_to_string(namer);
      IOR iorr = IOR.parse(ior);
      if (iorf != null)
        {
          FileOutputStream f = new FileOutputStream(iorf);
          PrintStream p = new PrintStream(f);
          p.print(ior);
          p.close();
        }

      System.out.println("GNU Classpath persistent naming service "
                         + "started at " + iorr.Internet.host + ":"
                         + iorr.Internet.port + " key 'NameService'.\n\n"
                         + "Copyright (C) 2008 Free Software Foundation\n"
                         + "This tool comes with ABSOLUTELY NO WARRANTY. "
                         + "This is free software, and you are\nwelcome to "
                         + "redistribute it under conditions, defined in "
                         + "GNU Classpath license.\n\n" + ior);

      new Thread()
      {
        public void run()
        {
          // Wait for invocations from clients.
          orb.run();
        }
      }.start();
    }
  catch (FileNotFoundException e)
    {
      throw new RuntimeException(e);
    }
  finally
    {
      // Restore the default value for allocating ports for the subsequent
      // objects.
      OrbFunctional.setPort(OrbFunctional.DEFAULT_INITIAL_PORT);
    }
}
 
Example 4
Project: classpath   File: Main.java   Source Code and License 4 votes vote down vote up
private void run(String[] args)
{
  Parser parser = initializeParser();
  parser.parse(args);

  try
    {
      // Create and initialize the ORB
      final OrbFunctional orb = new OrbFunctional();
      OrbFunctional.setPort(port);

      // Create the servant and register it with the ORB
      File dataDirectory = new File(directory);
      System.out.println("Persistent data stored at "
                         + dataDirectory.getAbsolutePath());
      dataDirectory.mkdirs();

      // / TODO support more starting modes.
      NamingContextExt namer = new Ext(
                                       new PersistentContext(
                                                             orb,
                                                             dataDirectory,
                                                             cold));

      // Case with the key "NameService".
      orb.connect(namer, "NameService".getBytes());

      // Storing the IOR reference.
      String ior = orb.object_to_string(namer);
      IOR iorr = IOR.parse(ior);
      if (iorf != null)
        {
          FileOutputStream f = new FileOutputStream(iorf);
          PrintStream p = new PrintStream(f);
          p.print(ior);
          p.close();
        }

      System.out.println("GNU Classpath persistent naming service "
                         + "started at " + iorr.Internet.host + ":"
                         + iorr.Internet.port + " key 'NameService'.\n\n"
                         + "Copyright (C) 2012 Free Software Foundation\n"
                         + "This tool comes with ABSOLUTELY NO WARRANTY. "
                         + "This is free software, and you are\nwelcome to "
                         + "redistribute it under conditions, defined in "
                         + "GNU Classpath license.\n\n" + ior);

      new Thread()
      {
        public void run()
        {
          // Wait for invocations from clients.
          orb.run();
        }
      }.start();
    }
  catch (FileNotFoundException e)
    {
      throw new RuntimeException(e);
    }
  finally
    {
      // Restore the default value for allocating ports for the subsequent
      // objects.
      OrbFunctional.setPort(OrbFunctional.DEFAULT_INITIAL_PORT);
    }
}