orbd(1)

πŸ‘‘ orbd(1) β€” the Java IDL & RMI-IIOP tools girlie πŸ’…

okay so bestie, gather round, because we're talking about orbd, aka the Oracle Object Request Broker Daemon, and she is that girl. no cap.


✨ NAME ✨

orbd β€” enables clients to locate and call persistent objects on servers in the CORBA environment. that's it, that's the whole job description, and she does it flawlessly 🫢


🌸 SYNOPSIS 🌸

orbd [ options ]

options

command-line options. see Options below, obviously πŸ’–


πŸ¦‹ DESCRIPTION πŸ¦‹

so the orbd command lets clients transparently locate and call persistent objects on servers in the CORBA environment. the Server Manager that ships inside the orbd tool is what makes that transparent locating-and-calling possible. here's the tea: persistent servers, when they're publishing their persistent object references in the naming service, put the port number of the ORBD into the object reference instead of the port number of the server itself. iconic behavior, honestly.

and why is that such a slay? because having an ORBD port number in a persistent object reference gives you these two perks:

  • the object reference in the naming service stays independent of the server life cycle. like, the object reference could get published by the server in the Naming Service the very first time it's installed, and then no matter how many times that server gets started or shut down, the ORBD still hands the correct object reference back to the calling client. periodt.
  • the client only has to look up the object reference in the naming service once, and can keep reusing that reference regardless of whatever changes the server life cycle throws at it. one and done, we love efficiency πŸ’…

to actually get at the ORBD Server Manager, the server has to be started using servertool, which is a command-line interface for application programmers to register, unregister, start up, and shut down a persistent server. want more on the Server Manager? see Server Manager further down, bestie.

also β€” the moment orbd starts, it also starts a naming service. for more info about the naming service, see Start and Stop the Naming Service. two for one, we love a multitasker ✨


πŸ’– OPTIONS πŸ’–

  • -ORBInitialPort nameserverport β€” required, no skipping this one. specifies the port the name server should be started on. after it's up, orbd listens for incoming requests on this port. heads up: on Oracle Solaris software you have to become the root user to start a process on a port below 1024, and for that exact reason Oracle recommends you use a port number greater than or equal to 1024. protect your peace and your permissions, okay? πŸŽ€

🌈 NONREQUIRED OPTIONS 🌈

  • -port port β€” specifies the activation port where ORBD should be started, and where ORBD will be accepting requests for persistent objects. the default value for this port is 1049. this port number gets added to the port field of the persistent Interoperable Object References (IOR). cute little detail, very iykyk.
  • -defaultdb directory β€” specifies the base where the ORBD persistent storage directory, orb.db, gets created. if you don't pass this option, the default value is ./orb.db.
  • -serverPollingTime milliseconds β€” specifies how often ORBD checks on the health of persistent servers registered through servertool. the default value is 1000 ms. the value you give for milliseconds has to be a valid positive integer, no funny business.
  • -serverStartupDelay milliseconds β€” specifies how long ORBD waits before sending a location forward exception after a persistent server that's registered through servertool gets restarted. the default value is 1000 ms. again: milliseconds must be a valid positive integer. yes bestie, same rule, she's consistent.
  • -Joption β€” passes option to the Java Virtual Machine, where option is one of the options described on the reference page for the Java application launcher. for example, -J-Xms48m sets the startup memory to 48 MB. see java(1). πŸ’œ

⭐ START AND STOP THE NAMING SERVICE ⭐

a naming service is a CORBA service that lets CORBA objects be named by binding a name to an object reference. that name binding can be stored in the naming service, and a client can supply the name to get the object reference it wants. simple as that, bestie.

before you run a client or a server, you're gonna start ORBD. ORBD comes with both a persistent naming service and a transient naming service, and both of them are an implementation of the COS Naming Service.

the Persistent Naming Service provides persistence for naming contexts. meaning: this info is persistent across service shutdowns and startups, and it's recoverable if a service failure happens. if ORBD gets restarted, the Persistent Naming Service restores the naming context graph, so the binding of all clients' and servers' names stays intact (persistent). she remembers everything, unlike some people 😭

for backward compatibility, tnameserv, a Transient Naming Service that shipped with earlier releases of the JDK, is also included in this release of Java SE. a transient naming service only retains naming contexts as long as it's running β€” if there's a service interruption, the naming context graph is lost. gone. poof. πŸ’€

the -ORBInitialPort argument is a required command-line argument for orbd, and it sets the port number the naming service runs on. the instructions below assume you can use port 1050 for the Java IDL Object Request Broker Daemon. when you're using Oracle Solaris software, you must become a root user to start a process on a port lower than 1024 β€” and for that reason, it's recommended that you use a port number above or equal to 1024. you can substitute a different port whenever you need to.

to start orbd from a UNIX command shell, enter:

orbd -ORBInitialPort 1050&

from an MS-DOS system prompt (Windows), enter:

start orbd -ORBInitialPort 1050

now that ORBD is running, you can run your server and client applications. when you run them, they have to be made aware of the port number (and the machine name, when applicable) where the Naming Service is running. one way to do that is to add the following code to your application:

Properties props = new Properties();
props.put("org.omg.CORBA.ORBInitialPort", "1050");
props.put("org.omg.CORBA.ORBInitialHost", "MyHost");
ORB orb = ORB.init(args, props);

in this example, the naming service is running on port 1050 on host MyHost. another way is to specify the port number and/or machine name when you run the server or client application from the command line. for example, you'd start your HelloApplication with the following command line:

java HelloApplication -ORBInitialPort 1050 -ORBInitialHost MyHost

to stop the naming service, use the relevant operating system command β€” such as pkillorbd on Oracle Solaris β€” or Ctrl+C in the DOS window where orbd is running. heads up though: names registered with the naming service can disappear when the service is terminated, because of that transient naming service situation. the Java IDL naming service will run until it is explicitly stopped. she doesn't stop unless you tell her to πŸ’…

for more information about the naming service included with ORBD, see Naming Service at http://docs.oracle.com/javase/8/docs/technotes/guides/idl/jidlNaming.html


🧚 SERVER MANAGER 🧚

to access the ORBD Server Manager and run a persistent server, the server must be started with servertool, which is a command-line interface for application programmers to register, unregister, start up, and shut down a persistent server. and listen: when a server is started using servertool, it must be started on the same host and port where orbd is executing. if the server is run on a different port, then the information stored in the database for local contexts will be invalid and the service will not work properly. that's not a vibe, that's a bug. don't do it πŸ™ˆ

see Java IDL: The "Hello World" Example at http://docs.oracle.com/javase/8/docs/technotes/guides/idl/jidlExample.html

in this example, you run the idlj compiler and javac compiler as shown in the tutorial. to run the ORBD Server Manager, follow these steps for running the application:

  1. Start orbd.
    • UNIX command shell, enter: orbd -ORBInitialPort 1050
    • MS-DOS system prompt (Windows), enter: start orbd -ORBInitialPort 1050

port 1050 is the port you want the name server to run on. the -ORBInitialPort option is a required command-line argument. when you're using Oracle Solaris software, you must become a root user to start a process on a port below 1024 β€” and for this reason it's recommended that you use a port number above or equal to 1024. πŸ’–

  1. Start the servertool: servertool -ORBInitialPort 1050

make sure the name server (orbd) port is the same as in the previous step, for example -ORBInitialPort 1050. the servertool must be started on the same port as the name server. matchy matchy, no exceptions ✨

  1. in the servertool command line interface, start the Hello server from the servertool prompt:
servertool  > register -server HelloServer -classpath . -applicationName
                HelloServerApName

the servertool registers the server, assigns it the name HelloServerApName, and displays its server ID with a listing of all registered servers. run the client application from another terminal window or prompt:

java HelloClient -ORBInitialPort 1050 -ORBInitialHost localhost

for this example, you can omit -ORBInitialHost localhost because the name server is running on the same host as the Hello client. if the name server is running on a different host, then use the -ORBInitialHost nameserverhost option to specify the host where the IDL name server is running. specify the name server (orbd) port as you did in the previous step, for example -ORBInitialPort 1050. when you finish experimenting with the ORBD Server Manager, be sure to shut down or terminate the name server (orbd) and servertool. to shut down orbd from an MS-DOS prompt, select the window that's running the server and enter Ctrl+C to shut it down. πŸŽ€

to shut down orbd from an Oracle Solaris shell, find the process and terminate it with the kill command. the server keeps waiting for invocations until it's explicitly stopped. to shut down the servertool, type quit and press the Enter key.


πŸ’œ SEE ALSO πŸ’œ


and that's the whole page, bestie!! 🫢 this one's living in JDK 8, dated 21 November 2013 β€” vintage but she ate, fr fr. go forth and bind your names, icon πŸ‘‘πŸ’–