1 Reply Latest reply on May 15, 2009 7:01 AM by marklittle

    Where can I set the jacorb BIDIRECTIONAL policy

    christian.gruber

      I'd like to use the jacorb BiDirectional GIOP to avoid opening a socket on the client, which fails because of NAT.
      In the jacorb documentation (http://www.jacorb.org/documentation.html) two steps are mentioned:

      1. Setting an ORBInitializer property and creating the BiDir policy
      2. Adding this policy to the servant's POA.


      Setting the ORBInitializer property can easily be done in jacorb.properties.
      For the other step the manual (http://www.jacorb.org/documentation.html) explains the following:

      Creating the necessary BiDir Policy is done via a policy factory hidden in the ORB.
      import org.omg.BiDirPolicy.*;
      86 BiDirectional GIOP
      import org.omg.CORBA.*;
      [...]
      Any any = orb.create_any();
      BidirectionalPolicyValueHelper.insert( any, BOTH.value );
      Policy p = orb.create_policy( BIDIRECTIONAL_POLICY_TYPE.value,
      any );
      The value of the new policy is passed to the factory inside of an any. The ORB is the told to create a
      policy of the specified type with the specified value. The newly created policy is then used to create a user
      POA. Please note that if any POA of has this policy set, all connections will be enabled for BiDirectional
      GIOP, that is even those targeted at object of POAs that don't have this policy set. For the full source code,
      please have a look at the bidir demo in the demo directory


      But where should I add this in an jboss as (version 4.2.2) configuration or jboss-transactions code to make it work?

      Any help is appreciated.

        • 1. Re: Where can I set the jacorb BIDIRECTIONAL policy
          marklittle

          You're going to have to modify the code to support this. Take a look at the ORB Portability code and you'll see specific classes for JacORB. You could hack the policy in there so it's hard coded, but I'd wouldn't recommend that. Consider making it some configurable runtime option instead. If it works then you can even consider donating it back to the community :-)