Re: Event Service problem

David Weir <[email protected]> Tue, 22 Nov 2005 14:25:46 -0330
Newsgroups gmane.comp.corba.orbacus
Organization Object Oriented Concepts, Inc. - An IONA Company
Message-ID <[email protected]>
Hello,

On Tue, Nov 22, 2005 at 12:57:02PM +0000, João Gomes wrote:
>  Greetings :)
> I'm new to ORBacus with Java and I'm having a problem when trying to use the
> Event Service. I have this pull client:
> 
> (...)
> Any event=null;
> EventChannel eventChannel=null;
> ConsumerAdmin consumerAdmin=null;
> ProxyPullSupplier pullSupplier=null;
> try{
> 	    eventChannel = EventChannelHelper.narrow(obj);
> 	    consumerAdmin = eventChannel.for_consumers();
> 	    pullSupplier = consumerAdmin.obtain_pull_supplier();
> 	
>             // I need to do this to bind proxy to the Event Stream, correct?
>            // The problem is on the parameter it takes, a PullConsumer
> 	    pullSupplier.connect_pull_consumer( new MOTDPullConsumer() );
> 
> 	    event = pullSupplier.pull();
> }(...)
> 
> So i'm actually having problems implementing the PullConsumer interface:
> 
> import org.omg.CORBA.*;
> import org.omg.CosEventChannelAdmin.*;
> import org.omg.CosEventComm.*
> public class MOTDPullConsumer implements PullConsumer{
> 
>     public void disconnect_pull_consumer(){
> 	System.out.println("Pull consumer off!");
>     }
> }
> 
> This causes a compilation error which I can't determine why, the interface
> only specifies the method implemented above:
> MOTDPullConsumer is not abstract and does not override abstract
> method_create_request(org.omg.CORBA.Context,java.lang.String,
> org.omg.CORBA.NVList,org.omg.CORBA.NamedValue, org.omg.CORBA.ExceptionList,
> org.omg.CORBA.ContextList) in org.omg.CORBA.Object
> 
> Anyone seen this happen before?
> 
> Thanks in advance :)

Take a look at the ".../JOB-4.3.0/event/test/PullEventClient.java" file,
specifically the "EventPullConsumer_impl" class definition. This is a
good template for you to follow. You will notice that this class
inherits from "PullConsumerPOA", which is what your implementation class
should be doing as well.

The problem is that the "PullConsumer" interface actually extends some
base classes, which are taken care of behind the scenes in the 
"PullConsumerPOA" class, allowing you to inherit from that directly.

Cheers,
Dave

-- 
David Weir                          
Team Orbacus - Your CORBA Source
E-Mail: [email protected]
WWW: http://www.orbacus.com
_______________________________________________
OB-Users Mailing List - [email protected]
http://mail.ooc.nf.ca/mailman/listinfo/ob-users
Visit our support FAQ before you send a message.
http://www.orbacus.com/faq/support.html