excercise 2 done
This commit is contained in:
BIN
week1_TinsaeGhilay/Task1/HelloApp/Hello.class
Normal file
BIN
week1_TinsaeGhilay/Task1/HelloApp/Hello.class
Normal file
Binary file not shown.
13
week1_TinsaeGhilay/Task1/HelloApp/Hello.java
Normal file
13
week1_TinsaeGhilay/Task1/HelloApp/Hello.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package HelloApp;
|
||||
|
||||
|
||||
/**
|
||||
* HelloApp/Hello.java .
|
||||
* Generated by the IDL-to-Java compiler (portable), version "3.2"
|
||||
* from Hello.idl
|
||||
* Sunday, November 9, 2025 2:43:24 PM CET
|
||||
*/
|
||||
|
||||
public interface Hello extends HelloOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity
|
||||
{
|
||||
} // interface Hello
|
||||
BIN
week1_TinsaeGhilay/Task1/HelloApp/HelloHelper.class
Normal file
BIN
week1_TinsaeGhilay/Task1/HelloApp/HelloHelper.class
Normal file
Binary file not shown.
85
week1_TinsaeGhilay/Task1/HelloApp/HelloHelper.java
Normal file
85
week1_TinsaeGhilay/Task1/HelloApp/HelloHelper.java
Normal file
@@ -0,0 +1,85 @@
|
||||
package HelloApp;
|
||||
|
||||
|
||||
/**
|
||||
* HelloApp/HelloHelper.java .
|
||||
* Generated by the IDL-to-Java compiler (portable), version "3.2"
|
||||
* from Hello.idl
|
||||
* Sunday, November 9, 2025 2:43:24 PM CET
|
||||
*/
|
||||
|
||||
abstract public class HelloHelper
|
||||
{
|
||||
private static String _id = "IDL:HelloApp/Hello:1.0";
|
||||
|
||||
public static void insert (org.omg.CORBA.Any a, HelloApp.Hello that)
|
||||
{
|
||||
org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
|
||||
a.type (type ());
|
||||
write (out, that);
|
||||
a.read_value (out.create_input_stream (), type ());
|
||||
}
|
||||
|
||||
public static HelloApp.Hello extract (org.omg.CORBA.Any a)
|
||||
{
|
||||
return read (a.create_input_stream ());
|
||||
}
|
||||
|
||||
private static org.omg.CORBA.TypeCode __typeCode = null;
|
||||
synchronized public static org.omg.CORBA.TypeCode type ()
|
||||
{
|
||||
if (__typeCode == null)
|
||||
{
|
||||
__typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (HelloApp.HelloHelper.id (), "Hello");
|
||||
}
|
||||
return __typeCode;
|
||||
}
|
||||
|
||||
public static String id ()
|
||||
{
|
||||
return _id;
|
||||
}
|
||||
|
||||
public static HelloApp.Hello read (org.omg.CORBA.portable.InputStream istream)
|
||||
{
|
||||
return narrow (istream.read_Object (_HelloStub.class));
|
||||
}
|
||||
|
||||
public static void write (org.omg.CORBA.portable.OutputStream ostream, HelloApp.Hello value)
|
||||
{
|
||||
ostream.write_Object ((org.omg.CORBA.Object) value);
|
||||
}
|
||||
|
||||
public static HelloApp.Hello narrow (org.omg.CORBA.Object obj)
|
||||
{
|
||||
if (obj == null)
|
||||
return null;
|
||||
else if (obj instanceof HelloApp.Hello)
|
||||
return (HelloApp.Hello)obj;
|
||||
else if (!obj._is_a (id ()))
|
||||
throw new org.omg.CORBA.BAD_PARAM ();
|
||||
else
|
||||
{
|
||||
org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();
|
||||
HelloApp._HelloStub stub = new HelloApp._HelloStub ();
|
||||
stub._set_delegate(delegate);
|
||||
return stub;
|
||||
}
|
||||
}
|
||||
|
||||
public static HelloApp.Hello unchecked_narrow (org.omg.CORBA.Object obj)
|
||||
{
|
||||
if (obj == null)
|
||||
return null;
|
||||
else if (obj instanceof HelloApp.Hello)
|
||||
return (HelloApp.Hello)obj;
|
||||
else
|
||||
{
|
||||
org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();
|
||||
HelloApp._HelloStub stub = new HelloApp._HelloStub ();
|
||||
stub._set_delegate(delegate);
|
||||
return stub;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
BIN
week1_TinsaeGhilay/Task1/HelloApp/HelloHolder.class
Normal file
BIN
week1_TinsaeGhilay/Task1/HelloApp/HelloHolder.class
Normal file
Binary file not shown.
38
week1_TinsaeGhilay/Task1/HelloApp/HelloHolder.java
Normal file
38
week1_TinsaeGhilay/Task1/HelloApp/HelloHolder.java
Normal file
@@ -0,0 +1,38 @@
|
||||
package HelloApp;
|
||||
|
||||
/**
|
||||
* HelloApp/HelloHolder.java .
|
||||
* Generated by the IDL-to-Java compiler (portable), version "3.2"
|
||||
* from Hello.idl
|
||||
* Sunday, November 9, 2025 2:43:24 PM CET
|
||||
*/
|
||||
|
||||
public final class HelloHolder implements org.omg.CORBA.portable.Streamable
|
||||
{
|
||||
public HelloApp.Hello value = null;
|
||||
|
||||
public HelloHolder ()
|
||||
{
|
||||
}
|
||||
|
||||
public HelloHolder (HelloApp.Hello initialValue)
|
||||
{
|
||||
value = initialValue;
|
||||
}
|
||||
|
||||
public void _read (org.omg.CORBA.portable.InputStream i)
|
||||
{
|
||||
value = HelloApp.HelloHelper.read (i);
|
||||
}
|
||||
|
||||
public void _write (org.omg.CORBA.portable.OutputStream o)
|
||||
{
|
||||
HelloApp.HelloHelper.write (o, value);
|
||||
}
|
||||
|
||||
public org.omg.CORBA.TypeCode _type ()
|
||||
{
|
||||
return HelloApp.HelloHelper.type ();
|
||||
}
|
||||
|
||||
}
|
||||
BIN
week1_TinsaeGhilay/Task1/HelloApp/HelloOperations.class
Normal file
BIN
week1_TinsaeGhilay/Task1/HelloApp/HelloOperations.class
Normal file
Binary file not shown.
15
week1_TinsaeGhilay/Task1/HelloApp/HelloOperations.java
Normal file
15
week1_TinsaeGhilay/Task1/HelloApp/HelloOperations.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package HelloApp;
|
||||
|
||||
|
||||
/**
|
||||
* HelloApp/HelloOperations.java .
|
||||
* Generated by the IDL-to-Java compiler (portable), version "3.2"
|
||||
* from Hello.idl
|
||||
* Sunday, November 9, 2025 2:43:24 PM CET
|
||||
*/
|
||||
|
||||
public interface HelloOperations
|
||||
{
|
||||
String sayHello ();
|
||||
void shutdown ();
|
||||
} // interface HelloOperations
|
||||
BIN
week1_TinsaeGhilay/Task1/HelloApp/HelloPOA.class
Normal file
BIN
week1_TinsaeGhilay/Task1/HelloApp/HelloPOA.class
Normal file
Binary file not shown.
80
week1_TinsaeGhilay/Task1/HelloApp/HelloPOA.java
Normal file
80
week1_TinsaeGhilay/Task1/HelloApp/HelloPOA.java
Normal file
@@ -0,0 +1,80 @@
|
||||
package HelloApp;
|
||||
|
||||
|
||||
/**
|
||||
* HelloApp/HelloPOA.java .
|
||||
* Generated by the IDL-to-Java compiler (portable), version "3.2"
|
||||
* from Hello.idl
|
||||
* Sunday, November 9, 2025 2:43:24 PM CET
|
||||
*/
|
||||
|
||||
public abstract class HelloPOA extends org.omg.PortableServer.Servant
|
||||
implements HelloApp.HelloOperations, org.omg.CORBA.portable.InvokeHandler
|
||||
{
|
||||
|
||||
// Constructors
|
||||
|
||||
private static java.util.Hashtable _methods = new java.util.Hashtable ();
|
||||
static
|
||||
{
|
||||
_methods.put ("sayHello", new java.lang.Integer (0));
|
||||
_methods.put ("shutdown", new java.lang.Integer (1));
|
||||
}
|
||||
|
||||
public org.omg.CORBA.portable.OutputStream _invoke (String $method,
|
||||
org.omg.CORBA.portable.InputStream in,
|
||||
org.omg.CORBA.portable.ResponseHandler $rh)
|
||||
{
|
||||
org.omg.CORBA.portable.OutputStream out = null;
|
||||
java.lang.Integer __method = (java.lang.Integer)_methods.get ($method);
|
||||
if (__method == null)
|
||||
throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
|
||||
|
||||
switch (__method.intValue ())
|
||||
{
|
||||
case 0: // HelloApp/Hello/sayHello
|
||||
{
|
||||
String $result = null;
|
||||
$result = this.sayHello ();
|
||||
out = $rh.createReply();
|
||||
out.write_string ($result);
|
||||
break;
|
||||
}
|
||||
|
||||
case 1: // HelloApp/Hello/shutdown
|
||||
{
|
||||
this.shutdown ();
|
||||
out = $rh.createReply();
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
|
||||
}
|
||||
|
||||
return out;
|
||||
} // _invoke
|
||||
|
||||
// Type-specific CORBA::Object operations
|
||||
private static String[] __ids = {
|
||||
"IDL:HelloApp/Hello:1.0"};
|
||||
|
||||
public String[] _all_interfaces (org.omg.PortableServer.POA poa, byte[] objectId)
|
||||
{
|
||||
return (String[])__ids.clone ();
|
||||
}
|
||||
|
||||
public Hello _this()
|
||||
{
|
||||
return HelloHelper.narrow(
|
||||
super._this_object());
|
||||
}
|
||||
|
||||
public Hello _this(org.omg.CORBA.ORB orb)
|
||||
{
|
||||
return HelloHelper.narrow(
|
||||
super._this_object(orb));
|
||||
}
|
||||
|
||||
|
||||
} // class HelloPOA
|
||||
BIN
week1_TinsaeGhilay/Task1/HelloApp/_HelloStub.class
Normal file
BIN
week1_TinsaeGhilay/Task1/HelloApp/_HelloStub.class
Normal file
Binary file not shown.
88
week1_TinsaeGhilay/Task1/HelloApp/_HelloStub.java
Normal file
88
week1_TinsaeGhilay/Task1/HelloApp/_HelloStub.java
Normal file
@@ -0,0 +1,88 @@
|
||||
package HelloApp;
|
||||
|
||||
|
||||
/**
|
||||
* HelloApp/_HelloStub.java .
|
||||
* Generated by the IDL-to-Java compiler (portable), version "3.2"
|
||||
* from Hello.idl
|
||||
* Sunday, November 9, 2025 2:43:24 PM CET
|
||||
*/
|
||||
|
||||
public class _HelloStub extends org.omg.CORBA.portable.ObjectImpl implements HelloApp.Hello
|
||||
{
|
||||
|
||||
public String sayHello ()
|
||||
{
|
||||
org.omg.CORBA.portable.InputStream $in = null;
|
||||
try {
|
||||
org.omg.CORBA.portable.OutputStream $out = _request ("sayHello", true);
|
||||
$in = _invoke ($out);
|
||||
String $result = $in.read_string ();
|
||||
return $result;
|
||||
} catch (org.omg.CORBA.portable.ApplicationException $ex) {
|
||||
$in = $ex.getInputStream ();
|
||||
String _id = $ex.getId ();
|
||||
throw new org.omg.CORBA.MARSHAL (_id);
|
||||
} catch (org.omg.CORBA.portable.RemarshalException $rm) {
|
||||
return sayHello ( );
|
||||
} finally {
|
||||
_releaseReply ($in);
|
||||
}
|
||||
} // sayHello
|
||||
|
||||
public void shutdown ()
|
||||
{
|
||||
org.omg.CORBA.portable.InputStream $in = null;
|
||||
try {
|
||||
org.omg.CORBA.portable.OutputStream $out = _request ("shutdown", false);
|
||||
$in = _invoke ($out);
|
||||
return;
|
||||
} catch (org.omg.CORBA.portable.ApplicationException $ex) {
|
||||
$in = $ex.getInputStream ();
|
||||
String _id = $ex.getId ();
|
||||
throw new org.omg.CORBA.MARSHAL (_id);
|
||||
} catch (org.omg.CORBA.portable.RemarshalException $rm) {
|
||||
shutdown ( );
|
||||
} finally {
|
||||
_releaseReply ($in);
|
||||
}
|
||||
} // shutdown
|
||||
|
||||
// Type-specific CORBA::Object operations
|
||||
private static String[] __ids = {
|
||||
"IDL:HelloApp/Hello:1.0"};
|
||||
|
||||
public String[] _ids ()
|
||||
{
|
||||
return (String[])__ids.clone ();
|
||||
}
|
||||
|
||||
private void readObject (java.io.ObjectInputStream s) throws java.io.IOException
|
||||
{
|
||||
String str = s.readUTF ();
|
||||
com.sun.corba.se.impl.orbutil.IORCheckImpl.check(str, "HelloApp._HelloStub");
|
||||
String[] args = null;
|
||||
java.util.Properties props = null;
|
||||
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props);
|
||||
try {
|
||||
org.omg.CORBA.Object obj = orb.string_to_object (str);
|
||||
org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate ();
|
||||
_set_delegate (delegate);
|
||||
} finally {
|
||||
orb.destroy() ;
|
||||
}
|
||||
}
|
||||
|
||||
private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException
|
||||
{
|
||||
String[] args = null;
|
||||
java.util.Properties props = null;
|
||||
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props);
|
||||
try {
|
||||
String str = orb.object_to_string (this);
|
||||
s.writeUTF (str);
|
||||
} finally {
|
||||
orb.destroy() ;
|
||||
}
|
||||
}
|
||||
} // class _HelloStub
|
||||
Reference in New Issue
Block a user