JavaBeans are using a design pattern for simple write-read attributes or simple read-only attributes. These attributes are mapped to .NET properties. This example uses a Java class that offers some attributes. The access to these Java attributes is achieved by implementing standard .NET properties.
get/set/is <---> .NET Attributes
public interface Greetings extends Remote
{
void setFirstName( String name) throws RemoteException;
String getFirstName() throws RemoteException;
void setBar( boolean oBar) throws RemoteException;
boolean isBar() throws RemoteException;
boolean getBar() throws RemoteException;
}
|
oGreetings.bar = false;
System.Console.WriteLine("Bar: {0}", oGreetings.bar);
System.Console.WriteLine("getBar: {0}", oGreetings.getBar());
|
> 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.