Está en la página 1de 32

CORBA:

Como instalar los


archivos para su
funcionamiento
Vamos a descargar e instalar el Kit de Desarrollo
de Java más conocido como JDK, así como el
IDE Eclipse (Phyton).
PARTE ADICIONAL IMPORTANTE >Para incluir y usar las librerias
Abrir cmd como administrador
1) Instalax jdk-8u211-windows-i586
2) Ejecutar como administrador//ojo correr como administrador
3) Para correr el programa: se va a Propiedades del sistema y se copia la carpeta
bin del JAVA.
4) dentro de Workspacede Eclipse copy el archivo HElloApp//
C:\Users\Alumno-M\workspace
cd C:\Users\Ángel Aramayo Chávez\workspace\HelloApp\src
cd C:\Users\Alumno-AFSD\Desktop\HelloApp\src
Idlj -fall Hello.idl

Javac *.java HelloApp\*.java

start orbd -ORBInitialPort 1050

start java HelloServer -ORBInitialPort 1050 -ORBInitialHost localhost

cd C:\Users\Ángel Aramayo Chávez\workspace\HelloApp\src

java HelloClient -ORBInitialPort 1050 -ORBInitialHost localhost(192.168.201.161)


Corba IDL

Es una implementación que permite que


dos objetos interactúen sobre diferentes
plataformas a través de una red.
Precompilador IDL-JAVA

El compilador idlj genera


enlaces Java desde un archivo
IDL.

• Idlj -fall Hello.idl

• idlj -fclient -fserver Hello.idl


module HelloApp

{
interface suma { // clase

long sumar(in long primernumero, in long segundonumero, in long x); //metodo


string iniciodesecion(in string user, in string pass);
string publicardatos(in string NombresyApellidos, in string Direccion,in string
….Correoelectronico,in string Numerodecelular,in string NumerodeDNI);

oneway void shutdown();


};
};
• Crea e inicializa una instancia ORB

ORB orb = ORB.init(args, null);


• Gets a reference to the root POA and activates
the POAManager

POA rootpoa = POAHelper.narrow(orb


.resolve_initial_references("RootPOA"));

rootpoa.the_POAManager().activate();
• Creates a servant instance (the implementation of one CORBA suma
object) and tells the ORB about it

org.omg.CORBA.Object ref = rootpoa.servant_to_reference(sumaImpl);


suma href = sumaHelper.narrow(ref);
• Gets a CORBA object reference for a naming context in which
to register the new CORBA object

// NameService invokes the name service


org.omg.CORBA.Object objRef = orb
.resolve_initial_references(“NameService”)
• Gets the root naming context

NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);


• Registers the new object in the naming context under the name “Suma”
String name = "Suma";
//se envia el nombre para que resiva la interface
NameComponent path[] = ncRef.to_name(name);
ncRef.rebind(path, href);
• Waits for invocations of the new object from the client

orb.run();
• Creates and initializes an ORB

• Obtains a reference to the root


naming context

• Looks up “Suma" in the naming


context and receives a reference to
that CORBA object

• Invokes the object's sayHello() and


shutdown() operations and prints the
result

También podría gustarte