JavaNames - Java Names starting with Illegal Unicode Characters

Description:

Java names may contain characters illegal within OMG IDL identifiers, like '$' or other illegal Unicode character (i.e. outside ISO Latin 1). These characters will be replaced (according to the OMG Java-to-IDL mapping) with an 'U' followed by 4 upper case hexadecimal characters representing the Unicode value of the replaced character.

Another problem may be a leading underscore which serves as escape character for IDL identifiers colliding with reserved OMG IDL keywords. The underscore, however, is not transmitted over the wire.

To circumvent the lack of an underscore all Java identifiers with a leading underscore acquire a 'J_' instead of the plain underscore. The example shows this behavior.

Source:

\DemoJava\JavaNames

Mapping:

_name <---> J_name
Unicode char <---> Uxxxx


Example

Step 1. Write the Java server:

  public interface Greetings extends Remote  
  {
    boolean _foo() throws RemoteException;
    int  FeeIn$US() throws RemoteException;
  }	

Step 2. Write the .NET client:

Call the Server

  ...
  System.Console.WriteLine( "Foo:{0}", oGreetings.J_foo());
  System.Console.WriteLine( "FreeIn$US:{0}", oGreetings.FeeInU0024US());  
  ...

Step 3. Run the example

a.) Start the sun name service on port 10050:

    > start orbd -ORBInitialPort 10050  

(could also use startNameService.bat located in the DemoJava directory to quick start the name service)

b.) Start the java server by using JNDI CosNaming and work with a name service running on 'localhost' at port '10050':

    > start java -cp .;Server.jar -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory -Djava.naming.provider.url=iiop://localhost:10050 Server  

(could also use buildServer.bat and startServer.bat located in the JavaServer directory to quick build and run the Java Server)

c.) Start the .NET Client.