[jacorb-developer] Reposted: Requests management in JacORB

Kujtim Hyseni kujtimhyseni at hotmail.com
Thu Apr 17 18:01:44 CEST 2014


Hi again Phil,
 
I have modified the demo interceptor example, implemented the classes ServerInitializer and ServerForwardInterceptor and tried to use as:
 
        org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args, null);
        org.omg.PortableServer.POA poa =
            org.omg.PortableServer.POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
 
        poa.the_POAManager().activate();
 
        org.omg.CORBA.Object o = poa.servant_to_reference(new GridImpl());
 
        PrintWriter ps = new PrintWriter(new FileOutputStream(new File( args[0] )));
        String ior_id = orb.object_to_string( o );
        ps.println( ior_id );
        ps.close();
 
        java.util.Properties props = new java.util.Properties();
        props.put("org.omg.PortableInterceptor.ORBInitializerClass.ForwardInit", "ServerInitializer");
 
        //BufferedReader reader = new BufferedReader(new FileReader(args[1]));
        props.put("ORBInitRef.Target2", ior_id);        
 
        if (args.length == 2)
        {
            File killFile = new File(args[1]);
            while(!killFile.exists())
            {
                Thread.sleep(1000);
            }
            orb.shutdown(true);
        }
        else
        {
            orb.run();
        }        
 
but it notified that only client request interceptor is running. I have to admit that ServerForwardInterceptor's class methods are empty. Can you figure out what I am doing wrong?
 
Regards,
Kujtim
 
> From: mesnier_p at ociweb.com
> Date: Wed, 16 Apr 2014 10:19:54 -0500
> To: jacorb-developer at lists.spline.inf.fu-berlin.de
> Subject: Re: [jacorb-developer] Requests management in JacORB
> 
> Hi Kujtim,
> 
> On Apr 16, 2014, at 8:08 AM, Kujtim Hyseni wrote:
> 
> > Phil, 
> > 
> > the demo in $JACORB_HOME/demo/interceptors is about client request interceptors and I need a server request interceptor or it is the same?
> > 
> 
> The principals are the same but the interfaces are a little different. Where the demo has a ClientForwardInterceptor that implements the ClientRequestInterceptor interface, you will implement the ServerRequestInterceptor interface.  The interfaces are provided in $JACORB_HOME/idl/omg/PortableInterceptor.idl. The orb initializer used to install the initializer is pretty much the same between client and server.
> 
>  Lots of good information can be found by googling "CORBA server request interceptor."
> 
> Good luck,
> Phil
> 
> --
> Phil Mesnier
> Principal Software Engineer and Partner,   http://www.ociweb.com
> Object Computing, Inc.                     +01.314.579.0066 x225
> 
> 
> 
> 
> _______________________________________________
> jacorb-developer maillist  -  jacorb-developer at lists.spline.inf.fu-berlin.de
> https://lists.spline.inf.fu-berlin.de/mailman/listinfo/jacorb-developer
 		 	   		  
_______________________________________________
jacorb-developer maillist  -  jacorb-developer at lists.spline.inf.fu-berlin.de
https://lists.spline.inf.fu-berlin.de/mailman/listinfo/jacorb-developer 		 	   		  


More information about the jacorb-developer mailing list