Re: Event Service problem

João Gomes <[email protected]> Thu, 24 Nov 2005 12:40:01 +0000
Newsgroups gmane.comp.corba.orbacus
Message-ID <[email protected]>
Hello,

I solved it by passing null to connect_pull_consumer():

try{
	    eventChannel = EventChannelHelper.narrow(obj);
	    consumerAdmin = eventChannel.for_consumers();
	    pullSupplier = consumerAdmin.obtain_pull_supplier();
	
	    pullSupplier.connect_pull_consumer( null );

	    event = pullSupplier.pull();
}(...)


And did the same to connect_push_supplier() on the server side - it's all
working OK now. Here are two fine links on this matter, if anyone ever needs
it:
http://www.iona.com/support/docs/orbix2000/2.0/pguide_cpp/html/Events4.html#151985
http://www.iona.com/support/docs/manuals/orbix/33/html/orbixevents33_pguide/PullModel.html


Thanks for the help :)



On 11/22/05, David Weir <[email protected]> wrote:
>
> 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