Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

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.

Java, Programming

  • Category:- Java
  • Reference No.:- M92568802
  • Price:- $75

Guranteed 36 Hours Delivery, In Price:- $75

Have any Question?


Related Questions in Java

Can someone please help me with the following java

can someone please help me with the following java question The input is an N by N matrix of nonnegative integers. Each individual row is a decreasing sequence from left to right. Each individual column is a decreasing s ...

Assessment -java program using array of Assessment -JAVA Program using array of objects

Assessment -JAVA Program using array of objects Objectives This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details For this assignment, you are required to develop a Windowed G ...

Assessment database and multithread programmingtasktask 1

Assessment: Database and Multithread Programming Task Task 1: Grade Processing University grading system maintains a database called "GradeProcessing" that contains number of tables to store, retrieve and manipulate stud ...

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

Operating systems assignment -problem 1 sharing the bridgea

Operating Systems Assignment - Problem 1: Sharing the Bridge A new single lane bridge is constructed to connect the North Island of New Zealand to the South Island of New Zealand. Farmers from each island use the bridge ...

Assignment game prototypeoverviewfor this assessment task

Assignment: Game Prototype Overview For this assessment task you are expected to construct a prototype level/area as a "proof of concept" for the game that you have designed in Assignment 1. The prototype should function ...

Assessment database and multithread programmingtasktask 1

Assessment: Database and Multithread Programming Task Task 1: Grade Processing University grading system maintains a database called "GradeProcessing" that contains number of tables to store, retrieve and manipulate stud ...

Assessment instructionsin this assessment you will complete

Assessment Instructions In this assessment, you will complete the programming of two Java class methods in a console application that registers students for courses in a term of study. The application is written using th ...

Part a specification - robot simulationpart a

PART A Specification - Robot Simulation PART A Requirements To complete this assignment you will use the supplied eclipse project Robot P1/. It is already set up to execute a simple arm movement loop which you will build ...

Can someone kindly help me to consider whether java

Can someone kindly help me to consider whether Java provides the facility of operator overloading? If it does, may you kindly describe how overloading operators can be accomplished? If not, may you kindly describe why yo ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As