[omniORB] CorbaScript on omniORB2

Philippe.Merle@lifl.fr Philippe.Merle@lifl.fr
Tue, 20 Jul 1999 14:59:17 +0200 (MET DST)


Hello,

I apologize for sending this email a second time. But as I have no reply
I think this email was lost in the cyberspace :-(
Please, could you confirm reception of this email?


I have started (once again :-() the port of CorbaScript on top of omniORB2.
I have some comments:

* Have you plan to implement the Interface Repository?
  Currently I use the IFR provided by ORBacus and this works.

* Why is it not possible to insert a nil object reference into a DynAny?
  See the following patch:

  void
  DynAnyImpl::insert_reference(CORBA::Object_ptr value)
  {
    if ( !CORBA::Object::PR_is_valid(value) )
      throw CORBA::BAD_PARAM(0,CORBA::COMPLETED_NO);

  // Merle Philippe
  //  if( CORBA::is_nil(value) )  throw CORBA::DynAny::InvalidValue();

    Lock sync(this);
    CORBA::Object::marshalObjRef(value, doWrite(CORBA::tk_objref));
  }

  void
  DynAnyConstrBase::insert_reference(CORBA::Object_ptr value)
  {
    if ( !CORBA::Object::PR_is_valid(value) )
      throw CORBA::BAD_PARAM(0,CORBA::COMPLETED_NO);
  
  // Merle Philippe
  //  if( CORBA::is_nil(value) )  throw CORBA::DynAny::InvalidValue();

    Lock sync(this);
    CORBA::Object::marshalObjRef(value, writeCurrent(CORBA::tk_objref));
  }

  void
  DynUnionImpl::insert_reference(CORBA::Object_ptr value)
  {
    if ( !CORBA::Object::PR_is_valid(value) )
      throw CORBA::BAD_PARAM(0,CORBA::COMPLETED_NO);

  // Merle Philippe
  //  if( CORBA::is_nil(value) )  throw CORBA::DynAny::InvalidValue();

    Lock sync(this);
    CORBA::Object::marshalObjRef(value, writeCurrent(CORBA::tk_objref));
    discriminatorHasChanged();
  }


* Why is it not possible to create a DynAny with a IDL void type?
  See the following patch:

  static DynAnyImplBase*
  create_dyn_any(TypeCode_base* tc, CORBA::Boolean is_root)
  {
    if ( !CORBA::TypeCode::PR_is_valid(tc) )
      throw CORBA::BAD_PARAM(0,CORBA::COMPLETED_NO);

    if( CORBA::is_nil(tc) )
      throw CORBA::BAD_TYPECODE(0, CORBA::COMPLETED_NO);

    DynAnyImplBase* da = 0;

    try {
      switch( tc->NP_kind() ) {
// ADD Merle Philippe
      case CORBA::tk_void:
// END
      case CORBA::tk_short:

  CORBA::DynAny_ptr
  CORBA::ORB::create_basic_dyn_any(TypeCode_ptr tc)
  {
    if (!CORBA::TypeCode::PR_is_valid(tc))
      throw CORBA::BAD_PARAM(0,CORBA::COMPLETED_NO);

    TypeCode_base* aetc = TypeCode_base::aliasExpand(ToTcBase_Checked(tc));

    switch( aetc->kind() ) {
// ADD Merle Philippe
      case CORBA::tk_void:
// END
    case CORBA::tk_short:


* Is it normal that a subclass of CORBA::BOA::DynamicImplementation
  must handle "_is_a" CORBA calls into the implementation of the invoke() method?

* How can I narrow an object reference to a DynamicImplementation subclass instance?
  I would like to write the following:

  class MyDSI : public CORBA::BOA::DynamicImplementation {
  public:
    ........
    static MyDSI* _narrow(CORBA::Object_ptr o) { ???? }
  };

  Why the DynamicImplementation doesn't directly inherit from omniObject and
  CORBA::Object classes?
  I have seen that you use a delegation pattern with the internal DsiObject, isn't it?


* Here is a report bug:

  unix> cssh
  CorbaScript 1.3.1 (Jul 20 1999) for omniORB2 for C++
  Copyright 1996-99 LIFL, France
  >>> TestCS.SeqShort
  < OMG-IDL typedef sequence<short> TestCS::SeqShort; >
  >>> TestCS.SeqShort(1,2,3,4,5,6)
  Caught omniORB2 fatalException. This indicates a bug is caught within omniORB2.
  Please send a bug report.
  The exception was thrown in file: ../typecode.cc
                              line: 949
  The error message is: TypeCode_base::NP_aliasExpand() - should not have been called
  unix>

  I have this report several times in my demonstration.


I work on Solaris 5.7, Sun CC 4.2 and omniORB2.8.0_pre1 but I don't think
that it is a configuration problem.

Even with these problems (and corrections), CorbaScript begins to work
on top of omniORB2:-)

Information on CorbaScript are available at: http://corbaweb.lifl.fr/CorbaScript/

Thank you in advance for your support.

A+
Philippe Merle
--
________________________________________________________________________________
Philippe Merle
Universite des Sciences et Technologies de Lille
URA 369 CNRS
Laboratoire d'Informatique Fondamentale de Lille  Tel:    (33) 03 20 43 47 21
U.F.R. I.E.E.A. batiment M3                       Fax:    (33) 03 20 43 65 66
59655 Villeneuve d'Ascq CEDEX France              E-Mail: merle@lifl.fr
						  Web: http://www.lifl.fr/~merle
________________________________________________________________________________