Identify a distributed system that already exists

Assignment Help JAVA Programming
Reference no: EM131760119

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.

Reference no: EM131760119

Questions Cloud

Scripps uses product placement on the food network : Describe some of the ways that scripps uses product placement on the food network.
Virtual team performance in cross-cultural setting : What factors influence a virtual team’s performance in cross-cultural setting?
Discuss michek intends to hold this loan to maturity : Prepare the journal entry(ies) at December 31, 2017, and December 31, 2019, for Michek related to these bonds
Substantiate your answer with a brief explanation : Substantiate your answer with a brief explanation. According to CAPM, the market portfolio has beta of one. Therefore, all assets with beta=1, must.
Identify a distributed system that already exists : Identify a distributed system that already exists or create one that is necessary for a current business, church, or school.
Issue to fully fund their venture : The direct issuing costs are $ 850,000, and the underwriting spread is 4%. How many shares must be issue to fully fund their venture?
Negotiating trade offs and helping management : Negotiating trade offs and helping management and project team members ameliorate the impact of trade offs in adverse conditions is a unique set of skills
Capm assists in measuring both risk and return : Explain how the CAPM assists in measuring both risk and return.
Discuss disposing or replacing old assets : Why are businesses sometimes hesitant about disposing or replacing old assets or antiquated technology

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd