Hi Jan, The approach seems great, just don't forget you must have a different endpoint for each created resource, using reference parameters. The link I sent covers that but it makes a lot of sense to play with it as a learning tool :-)
cheers, Chris -----Original Message----- From: Jan Torben Heuer [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 21, 2008 1:23 PM To: [email protected] Subject: Re: Dynamically register notification producers On Thursday 15 May 2008 20:06:44 Vinh Nguyen (vinguye2) wrote: Hallo, I started to implement the Producer-creator. It will still take some time for me to understand how muse works, but maybe you can tell me if I got it correctly: > Chris is correct. Jan, I think what you are looking for is a resource > which creates other producer resources. In this case, you need to > create a custom resource (i.e. call it FactoryService) which exposes > some operation (i.e. createProducer()). You also need another custom > resource that The code was taken form the pullpoint class you mentioned: public class MyAdvertisementCapability extends AbstractWsResourceCapability implements AdvertisementCapability { // is called to create a new producer public EndpointReference addAdvertisement() throws SoapFault { ResourceManager manager = getResource().getResourceManager(); String endpoint = getAdvertiseContextPath(); WsResource advertise = null; advertise = (WsResource) manager.createResource(endpoint); EndpointReference epr = advertise.getEndpointReference(); return epr; } @Override public void initialize() throws SoapFault { super.initialize(); // // find pullpoint resource type so we can create instances of it // in createPullPoint() // ResourceManager manager = getResource().getResourceManager(); advertisePath = manager.getResourceContextPath(AdvertisementCapability.class); } } Just to make things clear: If I set up the muse.xml so that the wsdl of my advertise maps to the AdvertisementCapability.class, then this class above is called? The next step would be then to create the notificationproducer and put the EPR into the response? > implements wsn:NotificationProducer (i.e. call it ProducerResource). > > So when FactoryService.createProducer() is called, it must dynamically > create a new instance of ProducerResource and pass the EPR back to the > client. Then the client can Subscribe/Unsubscribe directly on that > new ProducerResource instance. Thanks again, (Chris, I have your link still in mind, but It may be useful for me to start from scratch at least for a prototype in order to understand how muse works) Jan -- Jan Torben Heuer Institute for Geoinformatics [EMAIL PROTECTED] Robert-Koch-Strasse 26-28 +49 251 83-31960 48151 Münster, Germany --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
