Maybe I can ask the question a little differently. I'm trying to develop an external producer client that requires muse's NotificationProducer to expose publish() and addTopic() methods (I don't understand why the current NotificationProducerClient implementation doesn't expose them). What in your opinion is the best way to achieve my goal? Like I mentioned, I'm very new to Muse and appreciate your response below but I'm having some difficulties grasping how to proceed with the below recommendation.
Thanks, Lei -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, February 25, 2008 10:51 AM To: [email protected] Subject: RE: referencing NotificationProducer from user defined classes Hi Lei, It really depends on your environment as to how to integrate. The simplest thing to do is just customise your existing muse platform to provide that information. Its simple to enhance and you have 3 different environments from which to copy sample code (axis, mini soap, j2me / osgi). I would recommend looking at the mini soap platform, its a simple servlet and very easy to follow. Wrapping the platform itself allows you to directly access it without resorting to use of statics, jmx, jndi etc. cheers, Chris -----Original Message----- From: Huang, Lei [USA] [mailto:[EMAIL PROTECTED] Sent: Monday, February 25, 2008 4:24 PM To: [email protected] Subject: RE: referencing NotificationProducer from user defined classes Chris, Thanks for your quick response. I'm actually trying to access the NotificationProducer from external code. I'm still new to Muse, so can you elaborate more on how to provide a hook to the ResourceManager? Some sample code will be greatly appreciated. Thanks, Lei -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, February 25, 2008 4:26 AM To: [email protected] Subject: RE: referencing NotificationProducer from user defined classes Hi Lei, Are you trying to access the NotificationProducer from code external to muse or just another capability that isn't part of your resource? If its from another capability or resource you can use : public Resource getDefaultResource(String resourceName) { Resource resource = null; try { resource = manager.getResource(new EndpointReference( new URI(museIsoLayer.getRouter().getEnvironment().getDefaultURI()+resourceNa me))); } catch (URISyntaxException e) { // handle the case wherethe uri is bad } // got a resource? if (resource == null) { // throw some kind of exception etc } return resource; } where manager = ( (SimpleResourceRouter) museIsoLayer.getRouter() ).getResourceManager(); or manager = getResource().getResourceManager(); and the resourceName is the resource name present in your muse.xml and that you only have one instance of that resource. If the code is to be accessed from outside of Muse resources or capabilities then you must provide a hook to the ResourceManager. You can pass the instance via a custom capability into the code that needs it. cheers, Chris -----Original Message----- From: Huang, Lei [USA] [mailto:[EMAIL PROTECTED] Sent: Sunday, February 24, 2008 10:50 PM To: [email protected] Subject: referencing NotificationProducer from user defined classes hi everyone, I'm currently developing some business logic for a notification producer and able to get a reference to the muse NotificationProducer class through resource manager with this statement: final NotificationProducer wsn = (NotificationProducer) getResource().getCapability(WsnConstants.PRODUCER_URI); My question is how do I get the muse NotificationProducer reference in other than MyCapability class. If I use NotificationProducerClient object, it doesn't provide me with APIs such as addTopic(), publish() and etc. Please advise. Thanks in advance for everyone's help. Lei --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
