diff options
author | mk1 <mk1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-04-11 15:01:53 +0000 |
---|---|---|
committer | mk1 <mk1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-04-11 15:01:53 +0000 |
commit | bdd1f13d8dad67820cf3ee036b8299aa2cde162a (patch) | |
tree | 0253925f786ec4ff8c476b43f170baf06248c562 | |
parent | 1cc19531a83245e7d6fdbca7ebc4225fb701c6cf (diff) | |
download | ATCD-bdd1f13d8dad67820cf3ee036b8299aa2cde162a.tar.gz |
Sat Apr 11 10:00:09 1998 Michael Kircher <mk1@cs.wustl.edu>
-rw-r--r-- | TAO/ChangeLog-98c | 12 | ||||
-rw-r--r-- | TAO/examples/Simulator/DOVEBrowser/DOVEBrowser.html | 18 | ||||
-rw-r--r-- | TAO/examples/Simulator/DOVEBrowser/DOVEBrowser.java | 41 | ||||
-rw-r--r-- | TAO/examples/Simulator/DOVEBrowser/DOVEBrowserApplet.java | 47 | ||||
-rw-r--r-- | TAO/examples/Simulator/DOVEBrowser/PushConsumerFactory.java | 28 | ||||
-rw-r--r-- | TAO/examples/Simulator/README | 8 |
6 files changed, 112 insertions, 42 deletions
diff --git a/TAO/ChangeLog-98c b/TAO/ChangeLog-98c index df93f4adfd8..571bea7530d 100644 --- a/TAO/ChangeLog-98c +++ b/TAO/ChangeLog-98c @@ -1,3 +1,15 @@ +Sat Apr 11 10:00:09 1998 Michael Kircher <mk1@cs.wustl.edu> + + * orbsvcs/tests/Simulator/DOVEBrowser/DOVEBrowser.java: + modified to be used only when the DOVE Browser is running as + an Java Application. + + * orbsvcs/tests/Simulator/DOVEBrowser/DOVEBrowserApplet.java: + used when the DOVE Browser is running as an Applet. + + * orbsvcs/tests/Simulator/DOVEBrowser/*: minor changes to handle + the afore mentioned changes. + Fri Apr 10 22:55:09 1998 Douglas C. Schmidt <schmidt@cs.wustl.edu> * TAO version 0.0.1 released. diff --git a/TAO/examples/Simulator/DOVEBrowser/DOVEBrowser.html b/TAO/examples/Simulator/DOVEBrowser/DOVEBrowser.html index 06b64f8723e..c7410019908 100644 --- a/TAO/examples/Simulator/DOVEBrowser/DOVEBrowser.html +++ b/TAO/examples/Simulator/DOVEBrowser/DOVEBrowser.html @@ -7,17 +7,14 @@ <BODY> Note: The gatekeeper must run in the DOVEBrowser directory! +Note: The IORs are different for each machine! + NT Name Service IOR -<PARAM NAME="NSIOR" VALUE="IOR:010000002000000049444c3a436f734e616d696e672f4e616d696e67436f -6e746578743a312e30000100000000000000520000000101000015000000636f727269646f2e63732e777573746 -c2e65647500001d272e0000005033353265373531333030303732343230526f6f74504f412f6368696c645f706f -612f4e616d6553657276696365"> +<PARAM NAME="NSIOR" VALUE="IOR:010000002000000049444c3a436f734e616d696e672f4e616d696e67436f6e746578743a312e30000100000000000000520000000101000015000000636f727269646f2e63732e777573746c2e65647500003a272e0000005033353265633733313030303537613538526f6f74504f412f6368696c645f706f612f4e616d6553657276696365"> Unix Name ServiceIOR -<PARAM NAME="NSIOR" VALUE="IOR:000000000000002049444c3a436f734e616d696e672f4e616d696e67436f -6e746578743a312e3000000000010000000000000042000100000000000674616e676f00953f0000002e5033353 -265623733353030306533653133526f6f74504f412f6368696c645f706f612f4e616d6553657276696365"> +<PARAM NAME="NSIOR" VALUE="IOR:000000000000002049444c3a436f734e616d696e672f4e616d696e67436f6e746578743a312e3000000000010000000000000042000100000000000674616e676f00953f0000002e5033353265623733353030306533653133526f6f74504f412f6368696c645f706f612f4e616d6553657276696365"> Use this to run it with the appletviewer <param name=org.omg.CORBA.ORBClass value=com.visigenic.vbroker.orb.ORB> @@ -25,10 +22,9 @@ Use this to run it with the appletviewer Use this to run it within Netscape <param name=USE_ORB_LOCATOR value=true> -<APPLET code="DOVEBrowser.class" width=700 height=600> -<PARAM NAME="NSIOR" VALUE="IOR:000000000000002049444c3a436f734e616d696e672f4e616d696e67436f6e746578743a312e3000000000010000000000000042000100000000000674616e676f00953f0000002e5033353265623733353030306533653133526f6f74504f412f6368696c645f706f612f4e616d6553657276696365"> -<param name=USE_ORB_LOCATOR value=true> - +<APPLET code="DOVEBrowserApplet.class" width=700 height=600> +<param name=org.omg.CORBA.ORBClass value=com.visigenic.vbroker.orb.ORB> +<PARAM NAME="NSIOR" VALUE="IOR:000000000000002049444c3a436f734e616d696e672f4e616d696e67436f6e746578743a312e3000000000010000000000000042000100000000000674616e676f00953f0000002e5033353266383364653030306364306437526f6f74504f412f6368696c645f706f612f4e616d6553657276696365"> </APPLET> </BODY> diff --git a/TAO/examples/Simulator/DOVEBrowser/DOVEBrowser.java b/TAO/examples/Simulator/DOVEBrowser/DOVEBrowser.java index d1bd7cf4338..fc653f45c1d 100644 --- a/TAO/examples/Simulator/DOVEBrowser/DOVEBrowser.java +++ b/TAO/examples/Simulator/DOVEBrowser/DOVEBrowser.java @@ -1,10 +1,10 @@ // $Id$ // // = FILENAME -// NewDemo.java +// DOVEBrowser.java // // = AUTHOR -// Michael Kircher (mk1@cs.wustl.edu) +// Michael Kircher (mk1@cs.wustl.edu) // // = DESCRIPTION // Entry point for the demo. @@ -14,43 +14,34 @@ import java.awt.*; -public class DOVEBrowser extends java.applet.Applet { +public class DOVEBrowser { DemoCore demoCore_; - static String nameServiceIOR_ = null; public DOVEBrowser () { super (); } - public void init () { - // in case of an applet use the following line, else not! - nameServiceIOR_ = this.getParameter ("NSIOR"); + public void init (String nameServiceIOR) { - if (nameServiceIOR_ == null) { - System.out.println ("No NameSerivce IOR: Will use Name Service Lookup Protokol."); - } - - demoCore_ = new DemoCore (nameServiceIOR_, this); + demoCore_ = new DemoCore (nameServiceIOR, null); demoCore_.show (); demoCore_.run (); } - - public void paint (Graphics g) { - - g.drawString ("Michael is here",10,10); - } - - public static void main (String[] args) - { + public static void main (String[] args) { + String nameServiceIOR = null; + + if (args.length == 2) { if (args[0] == "-ORBnameserviceior") { - nameServiceIOR_ = args[1]; + nameServiceIOR = args[1]; } - - DOVEBrowser doveBrowser = new DOVEBrowser(); - doveBrowser.init (); - } + } + + DOVEBrowser doveBrowser = new DOVEBrowser(); + doveBrowser.init (nameServiceIOR); + } } + diff --git a/TAO/examples/Simulator/DOVEBrowser/DOVEBrowserApplet.java b/TAO/examples/Simulator/DOVEBrowser/DOVEBrowserApplet.java new file mode 100644 index 00000000000..622ceb0536e --- /dev/null +++ b/TAO/examples/Simulator/DOVEBrowser/DOVEBrowserApplet.java @@ -0,0 +1,47 @@ +// $Id$ +// +// = FILENAME +// DOVEBrowserApplet.java +// +// = AUTHOR +// Michael Kircher (mk1@cs.wustl.edu) +// +// = DESCRIPTION +// Entry point for the demo when started inside an applet. +// +// ============================================================================ + + +import java.awt.*; + +public class DOVEBrowserApplet extends java.applet.Applet { + + DemoCore demoCore_; + static String nameServiceIOR_ = null; + + public DOVEBrowserApplet () { + super (); + } + + public void init () { + // in case of an applet use the following line, else not! + nameServiceIOR_ = this.getParameter ("NSIOR"); + + if (nameServiceIOR_ == null) { + System.out.println ("The DOVE Browser cannot run, because no Naming Service IOR was found!"); + return; + } + + demoCore_ = new DemoCore (nameServiceIOR_, this); + demoCore_.show (); + demoCore_.run (); + } +} + + + + + + + + diff --git a/TAO/examples/Simulator/DOVEBrowser/PushConsumerFactory.java b/TAO/examples/Simulator/DOVEBrowser/PushConsumerFactory.java index 505e06bb502..7fcf2326fa2 100644 --- a/TAO/examples/Simulator/DOVEBrowser/PushConsumerFactory.java +++ b/TAO/examples/Simulator/DOVEBrowser/PushConsumerFactory.java @@ -31,12 +31,25 @@ public class PushConsumerFactory { { try { dataHandler_ = dataHandler; - orb_ = org.omg.CORBA.ORB.init (applet, null); + + // if the DOVE Browser is running as an Applet + if (applet != null) { + orb_ = org.omg.CORBA.ORB.init (applet, null); + } + else { // not running as an Applet, but as an normal Application + orb_ = org.omg.CORBA.ORB.init (); + } boa_ = orb_.BOA_init (); // Get the Naming Service initial reference - if (nameServiceIOR == null) { + // Name Service Lookup cannot be used when running as an Applet + if (nameServiceIOR == null && applet != null) { + System.out.println (" Name Service Lookup cannot be used when running as an Applet! Quit!"); + System.exit (1); + } + + if (nameServiceIOR == null) { // only used when running via "java" or "vbj" System.out.println ("Using the lookup protocol!"); NS_Resolve ns_resolve_ = new NS_Resolve (); naming_service_object_ = ns_resolve_.resolve_name_service (orb_); @@ -48,7 +61,7 @@ public class PushConsumerFactory { } catch(org.omg.CORBA.SystemException e) { - System.err.println ("Client constructur: Failure"); + System.err.println ("PushConsumerFactory constructor: ORB and Name Service initialization"); System.err.println(e); } @@ -77,6 +90,7 @@ public class PushConsumerFactory { System.err.println ("The Naming Context is null"); System.exit (1); } + System.out.println ("Reference to the Naming Service is ok."); // Get a reference for the EventService @@ -92,6 +106,8 @@ public class PushConsumerFactory { RtecEventChannelAdmin.EventChannel event_channel_ = RtecEventChannelAdmin.EventChannelHelper.narrow (event_channel_object_); + System.out.println ("Reference to the Event Service is ok."); + // Get a reference for the ScheduleService CosNaming.NameComponent[] s_name_components_ = new CosNaming.NameComponent[1]; @@ -105,10 +121,14 @@ public class PushConsumerFactory { RtecScheduler.Scheduler scheduler_ = RtecScheduler.SchedulerHelper.narrow (scheduler_object_); + + System.out.println ("Reference to the Naming Service is ok."); // Start the consumer + System.out.println ("Instantiating the Push Consumer."); PushConsumer pushConsumer_ = new PushConsumer (orb_, dataHandler_); + System.out.println ("Initializing the Push Consumer."); pushConsumer_.open_consumer (event_channel_, scheduler_, "demo_consumer"); // Tell the CORBA environment that we are ready @@ -141,7 +161,7 @@ public class PushConsumerFactory { } catch(org.omg.CORBA.SystemException e) { - System.err.println ("Client run: Failure"); + System.err.println ("PushConsumerFactory.run: Failure"); System.err.println(e); } } diff --git a/TAO/examples/Simulator/README b/TAO/examples/Simulator/README index 1b3a7b9bcdf..9596e1fce25 100644 --- a/TAO/examples/Simulator/README +++ b/TAO/examples/Simulator/README @@ -150,12 +150,16 @@ Starting: DOVE Browser: - // vbj DOVEBrowser - // (also supported: vbj DOVEBrowser -ORBnameserviceior <IOR> ) + vbj DOVEBrowser + (also supported: vbj DOVEBrowser -ORBnameserviceior <IOR> ) + + or + gatekeeper cd /visigenic/vbroker/lib jar xf vbjorb.jar jar xf vbjtools.jar + "setting the Naming Service IOR in the DOVEBrowser.html file" appletviewer DOVEBrowser.html |