4 Replies Latest reply on Jun 17, 2010 7:52 AM by weberj

    CORBA servant MBean?

    jiwils

      There have been several posts recently asking how one might plug a CORBA servant into JBoss as a method to wrap EJB calls behind customized IDL or to just utilize extant servants "as is". Given this interest, it seems like writing an MBean that could load/manage any CORBA servant class would be a good idea, and I would like to contribute such a bean.

      Here are some quick thoughts about functionality:

      * This MBean would depend on at least the CorbaORB MBean.

      * The servant after being activated, could be registered with the CORBA naming service provided by JBoss via the CORBANaming MBean (and a third party one as well).

      * Since MBeans have a definate lifecycle, it might be a good idea for this MBean to really represent a named POA, since the MBean lifecycle could be mapped to a POA lifecycle. This would also allow for the configuration of the POA's policies and the inclusion of a POAManager if need be.

      Is this a worthwhile effort? Is this something that could be a part of JBoss, or would this be better served as a "thirdparty" MBean (the contributed MBeans wiki)? Is there any other functionality that might be useful to have?

        • 1. Re: CORBA servant MBean?
          dimitris

          Looks interesting. At the very least, it could be used as a skeleton for people that want to do this sort of things.

          • 2. Re: CORBA servant MBean?

            Do you have a simple example how to get started using CORBA in JBoss5.1.0.

            Thanks.

            • 3. CORBA servant MBean works, cannot get CorbaNaming
              weberj

              I tried that, got the JBoss (4.3) default Orb with

               

              ObjectName ORB_NAME = ObjectNameFactory.create("jboss:service=CorbaORB");
              ORB orb = (ORB)server.getAttribute(ORB_NAME, "ORB");

              narrowed the POA, and added a servant, output its IOR to stdout, ran a client using this IOR, worked fine.

               

              Next I wanted to put the servant into nameservice. I tried to access the nameservice with

               

              ObjectName CN_NAME = ObjectNameFactory.create("jboss:service=CorbaNaming");
              Object n = server.getAttribute(CN_NAME, "CorbaNaming");

               

              This fails with

              javax.management.AttributeNotFoundException: not found: CorbaNaming

               

              Neither works

              orb.resolve_initial_references("NameService")

               

              I got a dependeny to

              <depends>jboss:service=CorbaNaming</depends>

               

              Anybody got an idea how to get the nameservice?

               

              Thanks,

              Juergen

              • 4. Re: CORBA servant MBean works, cannot get CorbaNaming
                weberj

                OK, found a way to get the NamingService.

                 

                InitialContext ctx = new InitialContext();

                Object jcn = ctx.lookup("java:JBossCorbaNaming");

                 

                No idea why it is called java:JBossCorbaNaming and not java:CorbaNaming