Identify a distributed system that already exists or create


LIBERTY ASSIGNMENT 1

INSTRUCTIONS

For this assignment, you will create and run an IDL interface using the provided example.

Applications Needed: Java JDK software and IDLTOJAVA compiler. The JDK has a built in ORB and API which enables CORBA distributed object interaction. The IDLTOJAVA compiler converts IDL-to-Java mapping in order to convert IDL interface definitions to Java methods, classes, and interfaces that can be used to implement the server and client code.

To get the latest version of the IDL-to-Java compiler, download the latest version of the JavaTM Platform, Standard Edition (Java SE). When Java SE is installed, idlj will be located in the bin directory.

Step 1: Create an IDL Interface

In this step you will map the IDL to Java in order to define the contract between the server and client for your application. The code for this is language independent and will not look like your traditional Java code. Create a new IDL file using your downloaded IDLTOJAVA compiler. Name the file, "Liberty.idl" and enter the following code:

moduleLibertyApp
{
interface Liberty
{
String libertyU();
};
};

This Liberty U application will only have a single operation. This is all the code that you will need for this step.

Step 2: Mapping Liberty.idl to Java

In this step you will create the required java files through the IDLTOJAVA tool. Open up your command line prompt. Change the directory to the location of your Liberty.idl file. Enter the compiler command:

idltojavaLiberty.idl

You will see that a directory called LibertyApp has been created and it will contain 5 files. Open up Liberty.java. I will contain these lines of code:

/* Liberty.java as generated by idltojava */
packageLibertyApp;
public interface Liberty
extendsorg.omg.CORBA.Object {
StringlibertyU();
}

Step 3: Create LibertyClient.java

Copy and paste the code into LibertyClient.java

importLibertyApp.*; // The package containing your stubs.
importorg.omg.CosNaming.*; // LibertyClient will use the naming service.
importorg.omg.CORBA.*; // All CORBA applications need these classes.

public class LibertyClient
{
public static void main(String args[])
{
try{

// create and initialize the ORB
ORB orb = ORB.init(args, null);

// get the root naming context
org.omg.CORBA.ObjectobjRef = orb.resolve_initial_references("NameService");
NamingContextncRef = NamingContextHelper.narrow(objRef);

// resolve the object reference in naming
NameComponentnc = new NameComponent("Liberty", "");
NameComponentpath[] = {nc};
Liberty libertyRef = LibertyHelper.narrow(ncRef.resolve(path));

// call the Liberty server object and print results
String liberty = libertyRef.libertyU();
System.out.println(liberty);

} catch(Exception e) {
System.out.println("ERROR : " + e);
e.printStackTrace(System.out);
}
}
}

Save and close LibertyClient.java

Step 4: Create a Liberty U Server

Create a file called LibertyServer.java

Copy and paste this code into your file:

// included are all packages imported in order to make this app work

importLibertyApp.*;
import org.omg.CosNaming.*;
import org.omg.CosNaming.NamingContextPackage.*;
import org.omg.CORBA.*;

public class LibertyServer
{
public static void main(String args[])
{
try{
// create and initialize the ORB
ORB orb = ORB.init(args, null);

// create the servant and register it with the ORB
LibertyServantlibertyRef = new LibertyServant();
orb.connect(libertyRef);

// get root naming context
org.omg.CORBA.ObjectobjRef = orb.resolve_initial_references("NameService");
NamingContextncRef = NamingContextHelper.narrow(objRef);

// bind the object reference in naming
NameComponentnc = new NameComponent("Liberty", "");
NameComponentpath[] = {nc};
ncRef.rebind(path, libertyRef);

// wait for invocations from clients
java.lang.Object sync = new java.lang.Object();
synchronized(sync){
sync.wait();
}
} catch(Exception e) {
System.err.println("ERROR: " + e);
e.printStackTrace(System.out);
}
}
}

classLibertyServant extends _LibertyImplBase
{
public String libertyU()
{
return "\nLibertyU!!\n";
}
}

Step 5: Compile and run LibertyU Application

Compile both LibertyClient.java and LibertyServer.java. You should see the following classes created once you do: LibertyClient.class, LibertyServer.class and LibertyServant.class.

Run the application from the command prompt. Start the Java IDL name server with the following command:

tnameserv -ORBInitialPortnameserverport

Open up a second command prompt and start the Liberty server with the following command:
javaLibertyServer -ORBInitialHostnameserverhost

-ORBInitialPortnameserverport

Open up a third command prompt and run the Liberty application client with the the following command:
javaLibertyClient -ORBInitialHostnameserverhost

-ORBInitialPortnameserverport

The client will return the string from the server to the command line: Liberty U!!
Turn off tnameserv and LibertyServer processes after the client application returns successfully.

PROJECT Assignemnt 2

INSTRUCTIONS

Welcome to your Final Project! The Final Project will consist of building a CORBA distributed application using Java IDL. You are to build a CORBA IDL program as a distributed application. The program will have multiple operations that return a string to be printed. The client will invoke the method of the server. The ORB will transfer that invocation to the servant object registered for that specific IDL interface. The server servant's method will return a Java string. The ORB will transfer that string back to the client. Finally, the client will print the value of that string.

To complete your Final Project, you will need to identify a distributed system that already exists or create one that is necessary for a current business, church, or school. Preferably, you need to select an organization that has business processes and operations you are familiar with. Develop a CORBA application that integrates with the identified distributed system. The LibertyU assignment that you recently completed provides a general example of this project. However, your CORBA application will be designed to meet the specific distributed business needs that you have identified. In addition, your project will design multiple interfaces that facilitate these needs. If you are uncertain of your business problem, make sure you contact your professor for prior approval. You will need to take a screenshot of multiple steps and save these throughout the creation of your Final Project.

Develop a 450-500 word, current APA-formatted report that describes:

• The business problem;
• The scope of the distributed system objectives; and
• The CORBA solution including its design and implementation.

Step 1: Start your project by identifying your server-side mappings. Justify your selection using scholarly or industry research and include this justification in your report.

• The inheritance model
• The delegation model

Step 2: Define your interfaces. Your project mustinclude at least 2 interfaces that meet the specified needs of the business.

Step 3: Implement your server that operates with EACH of your interfaces in Step 2. At the minimum, this mustinclude:

• Developing the ORB instance;
• Referencing the proper POA;
• Developing a servant instance;
• Designing a root naming context; and
• Registering your new objects.

Step 4: Implement your client application. Your client application must:

• Initialize an ORB;
• References the root naming context;
• References the appropriate naming contexts for your CORBA object; and
• Designs an invocates at least 2 operations and prints the results.

Step 5: Build and run the client-server application.

• Include at least 10 screenshots along the way that include a date, time, and visible element on your computer showing authenticity.
• Include a copy of your log files.
• Compile your .java files.
• Start ORBD.
• Start your new business server.
• Run your new client application.
• Take a screen shot of your program running.
• Save it to the java project folder.

Your Final Project must include the following items, compressed and submitted to the assignment link:

• 450-500 word report on the business problem and solution;
• At least 10 screenshots of each step to include: date, time, and visible element showing authenticity;
• Copy of your log files; and
• Screen shot of the running program.

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Identify a distributed system that already exists or create
Reference No:- TGS02555631

Expected delivery within 24 Hours