You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-user@ws.apache.org by Pushkar Sachdeva <pu...@gmail.com> on 2006/07/06 16:48:26 UTC

Re: Help regarding muse notifications

Thanks for your reply Balan.
I tried a lot, still i am not able to get notification events on consumer
side for *ManagementEventTopics*. Please direct me if there is any sample
code showing its implementation. I already tried the *filesystem* and *
enterprise* example that comes along with muse1.0.

In filesystem example, the code provieded for publishing via
ManagementEventTopic is as follows:

  public void updateOperationalStatus(
org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.OperationalStatusDocument.OperationalStatus.EnumnewStatus)
    {
        org.apache.ws.notification.base.NotificationProducerResourceresource = (
org.apache.ws.notification.base.NotificationProducerResource)getResource();
        org.apache.ws.resource.properties.ResourceProperty statusProp =
resource.getResourcePropertySet().get(
FilesystemPropertyQNames.OPERATIONALSTATUS);

org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.OperationalStatusDocument.OperationalStatuscurrentStatus
= (
org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.OperationalStatusDocument.OperationalStatus)
statusProp.get(0);
        if (!currentStatus.enumValue().equals(newStatus))
        {
            org.apache.xmlbeans.XmlObject oldStatus =
org.apache.ws.util.XmlBeanUtils.copyXmlBean(currentStatus);
            currentStatus.set(newStatus);
*            org.apache.ws.notification.topics.TopicSpace muwsTopicSpace =
resource.getTopicSpaceSet().getTopicSpace(
org.apache.ws.muws.v1_0.MuwsConstants.NSURI_MUWS_PART2_TOPICS);

org.apache.ws.muws.v1_0.topics.impl.XmlBeansManagementEventTopicImplstatusTopic
= (
org.apache.ws.muws.v1_0.topics.impl.XmlBeansManagementEventTopicImpl)
muwsTopicSpace.getTopic(
org.apache.ws.muws.v1_0.capability.OperationalStatusCapability.TOPIC_NAME);

org.apache.ws.resource.properties.ResourcePropertyValueChangeEventstatusChangeEvent
= new
org.apache.ws.resource.properties.v2004_06.impl.XmlBeansResourcePropertyValueChangeEvent(new
Object[]{oldStatus}, new Object[]{currentStatus});
            statusTopic.propertyChanged(statusChangeEvent);  // publish the
event
*        }
        return;
    }


But the consumer subscribed for OperationalStatusCapability is not getting
notifications i.e  the notify method on consumer is not getting invoked.

So i tried using the ReqourcePropertyValueChangeTopic and made the following
changes.


    public void updateOperationalStatus(
org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.OperationalStatusDocument.OperationalStatus.EnumnewStatus)
    {
     System.out.println("UPDATING OPERATIONAL STATUS");
        org.apache.ws.notification.base.NotificationProducerResourceresource = (
org.apache.ws.notification.base.NotificationProducerResource)getResource();
        org.apache.ws.resource.properties.ResourceProperty statusProp =
((FilesystemResource)getResource()).getResourcePropertySet().get(
FilesystemPropertyQNames.OPERATIONALSTATUS);

org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.OperationalStatusDocument.OperationalStatuscurrentStatus
= (
org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.OperationalStatusDocument.OperationalStatus)
statusProp.get(0);
        if (!currentStatus.enumValue().equals(newStatus))
        {
            org.apache.xmlbeans.XmlObject oldStatus =
org.apache.ws.util.XmlBeanUtils.copyXmlBean(currentStatus);
            currentStatus.set(newStatus);

 *           org.apache.ws.notification.topics.TopicSpace muwsTopicSpace =
resource.getTopicSpaceSet().getTopicSpace(statusProp.getMetaData
().getName().getNamespaceURI());

org.apache.ws.notification.topics.ResourcePropertyValueChangeTopicvalueChangeTopic=(
org.apache.ws.notification.topics.ResourcePropertyValueChangeTopic
)muwsTopicSpace.getTopic("OperationalStatus");

org.apache.ws.resource.properties.ResourcePropertyValueChangeEventstatusChangeEvent
= new
org.apache.ws.resource.properties.v2004_06.impl.XmlBeansResourcePropertyValueChangeEvent(new
Object[]{oldStatus}, new Object[]{currentStatus});

            valueChangeTopic.propertyChanged(statusChangeEvent);  // publish
the event
*        }

        return;
    }

It worked. The consumer subscribing for OperationalStatus Topic is able to
get the notification events. But I think it may not be the clean way to do
things, how can I make use of MUWS defined Management Event CapabilityTopics
for acheiving this??

Please help.. I appreciate your help in this matter.






On 6/28/06, Balan Subramanian <bs...@us.ibm.com> wrote:
>
> Hi Pushkar,
> I hope I understood your question properly.....
> The ResourcePropertyValueChangeTopic is used to publish notifications
> about property changes among the resource properties defined for that
> resource. Each notification carries the new value of the property and may
> carry the old value of the property as well. This is particularly useful
> in monitoring scenarios. These events are described in the WS-RP
> specifications.
>
> The ManagementEventTopic is used to publish notifications of WSDM events
> in the WSDM Event Format. The format is specificed in the muws-1 spec.
> Typically these would be events that are generated by the resource other
> than property change notifications for example, a heart beat sent by a
> resource.
>
> I am not sure why you cannot get the ManagementEvents in the notify method
> if you are subscribed to the topic properly. I'll try out some samples
> today but maybe someone has an answer to that already.
>
> Thanks,
> Balan
>
> Balan Subramanian
> Autonomic Computing, IBM, RTP, NC
> 919.543.0197 | bsubram@us.ibm.com
>
>
>
>
>
>
> "Pushkar Sachdeva" <pu...@gmail.com>
> 06/28/2006 09:50 AM
> Please respond to
> muse-user@ws.apache.org
>
>
> To
> muse-user@ws.apache.org
> cc
>
> Subject
> Help regarding muse notifications
>
>
>
>
>
>
> I am new to using notifications in muse. I have the following queries:-
>
> 1) What is the difference between *ResourcePropertyValueChangeTopic* and *
> ManagementEventTopic* ??
>
> 2) If in the Notification Producer,
> *ResourcePropertyValueChangeTopic*sends
> *ResourcePropertyValueChangeEvent* then that notification can be obtained
> in
> the notify function of Notification Consumer, but on the other hand If *
> ManagementEventTopic* sends the *ResourcePropertyValueChangeEvent* then
> the
> notification is not automatically received in the notify function of the
> Notification Consumer. However, in the latter case, Consumer can obtain
> the
> notification sent through *getCurrentMessage* request. How can i obtain
> this
> notification triggered by  *ManagementEventTopic* automatically without
> actually sending the request(the same way I obtained through *
> ResourcePropertyValueChangeTopic*) ??
>
> Please help me answer these questions or atleast direct me from where I
> could clear my doubts.
>
> Thanks a lot in advance.
>
> -Regards
> Pushkar
>
>
>

Re: Help regarding muse notifications

Posted by Pushkar Sachdeva <pu...@gmail.com>.
Thanks Dan for addressing my issue.  My client (notification consumer) is a
normal WSDM compliant Web Service exposing single resource.I have attached
the wsdl for it.
  I am using filesystem example , which creates two topics for the *Operational
Status* property :

1) *ManagementEventTopic*  with Topic name *OperationalStatusCapability*. I
have attached the subscription request for this topic as
ManagementEventSubscription. But if the client subscribes for this topic
then it is not able to receive notifications(notify method is not getting
invoked) on sending mount/unmount requests :-(

2)*ResourcePropertyValueChangeTopic* with Topic Name
OperationalStatus.Ihave attached the subcription request for this
topic
as ValueChangeSubscripton. To publish notification events through this
topic, I have made the changes in the updateOperationalStatus method (in
FileSystemService Calass) as I mentioned in my previous mail. Now if the
same consumer subscribes for this Topic then it is able to get back the
notifications(notify method is getting invoked :-)

I am sure that both the subscriptions are working fine as there are no
faults received. I am receiving back the MessageID on subscription
successfully.

 There are no errors while publishing the notifications in either case, but
unfortunately while publishing these notifications via ManagementEventTopic
the notify method of consumer is not getting triggered. However,
when consumer sends the request for GetCurrentMessage to get the last
notification, it receives the notification response as expected(wrapped
within ManagementEvent). The problem is that this notification is not being
sent automatically as was the case with ResourcePropertyValueChangeEvent. I
have attached the response for GetCurrentMessage under
GetCurrentMessageResponse.

Please me help out of this problem..
Let me know in case you require anything else from me...

-Regards
 Pushkar


On 7/6/06, Daniel Jemiolo <da...@us.ibm.com> wrote:
>
> Are you certain the client is sending the right topic expression? Are the
> subscriptions working and the notifications failing, or is the
> subscription failing early and then the side effect is no notifications?
> Can you send your client code for subscribing so we can eliminate that as
> a possible error?
>
> thanks,
> Dan
>
>
>
> "Pushkar Sachdeva" <pu...@gmail.com> wrote on 07/06/2006
> 10:48:26 AM:
>
> > Thanks for your reply Balan.
> > I tried a lot, still i am not able to get notification events on
> consumer
> > side for *ManagementEventTopics*. Please direct me if there is any
> sample
> > code showing its implementation. I already tried the *filesystem* and *
> > enterprise* example that comes along with muse1.0.
> >
> > In filesystem example, the code provieded for publishing via
> > ManagementEventTopic is as follows:
> >
> >   public void updateOperationalStatus(
> > org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.
> > OperationalStatusDocument.OperationalStatus.EnumnewStatus)
> >     {
> > org.apache.ws.notification.base.NotificationProducerResourceresource = (
> >
> org.apache.ws.notification.base.NotificationProducerResource
> )getResource();
> >         org.apache.ws.resource.properties.ResourceProperty statusProp =
> > resource.getResourcePropertySet().get(
> > FilesystemPropertyQNames.OPERATIONALSTATUS);
> >
> > org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.
> > OperationalStatusDocument.OperationalStatuscurrentStatus
> > = (
> > org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.
> > OperationalStatusDocument.OperationalStatus)
> > statusProp.get(0);
> >         if (!currentStatus.enumValue().equals(newStatus))
> >         {
> >             org.apache.xmlbeans.XmlObject oldStatus =
> > org.apache.ws.util.XmlBeanUtils.copyXmlBean(currentStatus);
> >             currentStatus.set(newStatus);
> > *            org.apache.ws.notification.topics.TopicSpace muwsTopicSpace
> =
> > resource.getTopicSpaceSet().getTopicSpace(
> > org.apache.ws.muws.v1_0.MuwsConstants.NSURI_MUWS_PART2_TOPICS);
> >
> >
>
> org.apache.ws.muws.v1_0.topics.impl.XmlBeansManagementEventTopicImplstatusTopic
> > = (
> > org.apache.ws.muws.v1_0.topics.impl.XmlBeansManagementEventTopicImpl)
> > muwsTopicSpace.getTopic(
> >
> org.apache.ws.muws.v1_0.capability.OperationalStatusCapability.TOPIC_NAME
> );
> >
> >
>
> org.apache.ws.resource.properties.ResourcePropertyValueChangeEventstatusChangeEvent
> > = new
> > org.apache.ws.resource.properties.v2004_06.impl.
> > XmlBeansResourcePropertyValueChangeEvent(new
> > Object[]{oldStatus}, new Object[]{currentStatus});
> >             statusTopic.propertyChanged(statusChangeEvent);  // publish
> the
> > event
> > *        }
> >         return;
> >     }
> >
> >
> > But the consumer subscribed for OperationalStatusCapability is not
> getting
> > notifications i.e  the notify method on consumer is not getting invoked.
> >
> > So i tried using the ReqourcePropertyValueChangeTopic and made the
> following
> > changes.
> >
> >
> >     public void updateOperationalStatus(
> > org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.
> > OperationalStatusDocument.OperationalStatus.EnumnewStatus)
> >     {
> >      System.out.println("UPDATING OPERATIONAL STATUS");
> > org.apache.ws.notification.base.NotificationProducerResourceresource = (
> >
> org.apache.ws.notification.base.NotificationProducerResource
> )getResource();
> >         org.apache.ws.resource.properties.ResourceProperty statusProp =
> > ((FilesystemResource)getResource()).getResourcePropertySet().get(
> > FilesystemPropertyQNames.OPERATIONALSTATUS);
> >
> > org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.
> > OperationalStatusDocument.OperationalStatuscurrentStatus
> > = (
> > org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.
> > OperationalStatusDocument.OperationalStatus)
> > statusProp.get(0);
> >         if (!currentStatus.enumValue().equals(newStatus))
> >         {
> >             org.apache.xmlbeans.XmlObject oldStatus =
> > org.apache.ws.util.XmlBeanUtils.copyXmlBean(currentStatus);
> >             currentStatus.set(newStatus);
> >
> >  *           org.apache.ws.notification.topics.TopicSpace muwsTopicSpace
> =
> > resource.getTopicSpaceSet().getTopicSpace(statusProp.getMetaData
> > ().getName().getNamespaceURI());
> >
> >
>
> org.apache.ws.notification.topics.ResourcePropertyValueChangeTopicvalueChangeTopic=
> (
> > org.apache.ws.notification.topics.ResourcePropertyValueChangeTopic
> > )muwsTopicSpace.getTopic("OperationalStatus");
> >
> >
>
> org.apache.ws.resource.properties.ResourcePropertyValueChangeEventstatusChangeEvent
> > = new
> > org.apache.ws.resource.properties.v2004_06.impl.
> > XmlBeansResourcePropertyValueChangeEvent(new
> > Object[]{oldStatus}, new Object[]{currentStatus});
> >
> >             valueChangeTopic.propertyChanged(statusChangeEvent);  //
> publish
> > the event
> > *        }
> >
> >         return;
> >     }
> >
> > It worked. The consumer subscribing for OperationalStatus Topic is able
> to
> > get the notification events. But I think it may not be the clean way to
> do
> > things, how can I make use of MUWS defined Management Event
> CapabilityTopics
> > for acheiving this??
> >
> > Please help.. I appreciate your help in this matter.
> >
> >
> >
> >
> >
> >
> > On 6/28/06, Balan Subramanian <bs...@us.ibm.com> wrote:
> > >
> > > Hi Pushkar,
> > > I hope I understood your question properly.....
> > > The ResourcePropertyValueChangeTopic is used to publish notifications
> > > about property changes among the resource properties defined for that
> > > resource. Each notification carries the new value of the property and
> may
> > > carry the old value of the property as well. This is particularly
> useful
> > > in monitoring scenarios. These events are described in the WS-RP
> > > specifications.
> > >
> > > The ManagementEventTopic is used to publish notifications of WSDM
> events
> > > in the WSDM Event Format. The format is specificed in the muws-1 spec.
> > > Typically these would be events that are generated by the resource
> other
> > > than property change notifications for example, a heart beat sent by a
> > > resource.
> > >
> > > I am not sure why you cannot get the ManagementEvents in the notify
> method
> > > if you are subscribed to the topic properly. I'll try out some samples
> > > today but maybe someone has an answer to that already.
> > >
> > > Thanks,
> > > Balan
> > >
> > > Balan Subramanian
> > > Autonomic Computing, IBM, RTP, NC
> > > 919.543.0197 | bsubram@us.ibm.com
> > >
> > >
> > >
> > >
> > >
> > >
> > > "Pushkar Sachdeva" <pu...@gmail.com>
> > > 06/28/2006 09:50 AM
> > > Please respond to
> > > muse-user@ws.apache.org
> > >
> > >
> > > To
> > > muse-user@ws.apache.org
> > > cc
> > >
> > > Subject
> > > Help regarding muse notifications
> > >
> > >
> > >
> > >
> > >
> > >
> > > I am new to using notifications in muse. I have the following
> queries:-
> > >
> > > 1) What is the difference between *ResourcePropertyValueChangeTopic*
> and *
> > > ManagementEventTopic* ??
> > >
> > > 2) If in the Notification Producer,
> > > *ResourcePropertyValueChangeTopic*sends
> > > *ResourcePropertyValueChangeEvent* then that notification can be
> obtained
> > > in
> > > the notify function of Notification Consumer, but on the other hand If
> *
> > > ManagementEventTopic* sends the *ResourcePropertyValueChangeEvent*
> then
> > > the
> > > notification is not automatically received in the notify function of
> the
> > > Notification Consumer. However, in the latter case, Consumer can
> obtain
> > > the
> > > notification sent through *getCurrentMessage* request. How can i
> obtain
> > > this
> > > notification triggered by  *ManagementEventTopic* automatically
> without
> > > actually sending the request(the same way I obtained through *
> > > ResourcePropertyValueChangeTopic*) ??
> > >
> > > Please help me answer these questions or atleast direct me from where
> I
> > > could clear my doubts.
> > >
> > > Thanks a lot in advance.
> > >
> > > -Regards
> > > Pushkar
> > >
> > >
> > >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
>
>

Re: Help regarding muse notifications

Posted by Pushkar Sachdeva <pu...@gmail.com>.
On 7/6/06, Daniel Jemiolo <da...@us.ibm.com> wrote:

> Are you certain the client is sending the right topic expression? Are the
> subscriptions working and the notifications failing, or is the
> subscription failing early and then the side effect is no notifications?
> Can you send your client code for subscribing so we can eliminate that as
> a possible error?
>
> thanks,
> Dan


  Thanks Dan for addressing my issue.
  My client (notification consumer) is a normal WSDM compliant Web Service
exposing single resource.I have attached the wsdl for it.
  I am using filesystem example , which creates two topics for the *Operational
Status* property :

1) *ManagementEventTopic*  with Topic name *OperationalStatusCapability*. I
have attached the subscription request for this topic as
ManagementEventSubscription. But if the client subscribes for this topic
then it is not able to receive notifications(notify method is not getting
invoked) on sending mount/unmount requests :-(

2)ResourcePropertyValueChangeTopic with Topic Name OperationalStatus.I have
attached the subcription request for this topic as ValueChangeSubscripton.
To publish notification events through this topic, I have made the changes
in the updateOperationalStatus method (in FileSystemService Calass) as
I mentioned in my previous mail. Now if the same consumer subscribes for
this Topic then it is able to get back the notifications(notify method is
getting invoked :-)

I am sure that both the subscriptions are working fine as there are no
faults received. I am receiving back the MessageID on subscription
successfully.

 There are no errors while publishing the notifications in either case, but
unfortunately while publishing these notifications via ManagementEventTopic
the notify method of consumer is not getting triggered. However,
when consumer sends the request for GetCurrentMessage to get the last
notification, it receives the notification response as expected(wrapped
within ManagementEvent). The problem is that this notification is not being
sent automatically as was the case with ResourcePropertyValueChangeEvent. I
have attached the response for GetCurrentMessage under
GetCurrentMessageResponse.

Please me help out of this problem..
Let me know in case you require anything else from me...

-Regards
Pushkar







> "Pushkar Sachdeva" <pu...@gmail.com> wrote on 07/06/2006
> 10:48:26 AM:
>
> > Thanks for your reply Balan.
> > I tried a lot, still i am not able to get notification events on
> consumer
> > side for *ManagementEventTopics*. Please direct me if there is any
> sample
> > code showing its implementation. I already tried the *filesystem* and *
> > enterprise* example that comes along with muse1.0.
> >
> > In filesystem example, the code provieded for publishing via
> > ManagementEventTopic is as follows:
> >
> >   public void updateOperationalStatus(
> > org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.
> > OperationalStatusDocument.OperationalStatus.EnumnewStatus)
> >     {
> > org.apache.ws.notification.base.NotificationProducerResourceresource = (
> >
> org.apache.ws.notification.base.NotificationProducerResource
> )getResource();
> >         org.apache.ws.resource.properties.ResourceProperty statusProp =
> > resource.getResourcePropertySet().get(
> > FilesystemPropertyQNames.OPERATIONALSTATUS);
> >
> > org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.
> > OperationalStatusDocument.OperationalStatuscurrentStatus
> > = (
> > org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.
> > OperationalStatusDocument.OperationalStatus)
> > statusProp.get(0);
> >         if (!currentStatus.enumValue().equals(newStatus))
> >         {
> >             org.apache.xmlbeans.XmlObject oldStatus =
> > org.apache.ws.util.XmlBeanUtils.copyXmlBean(currentStatus);
> >             currentStatus.set(newStatus);
> > *            org.apache.ws.notification.topics.TopicSpace muwsTopicSpace
> =
> > resource.getTopicSpaceSet().getTopicSpace(
> > org.apache.ws.muws.v1_0.MuwsConstants.NSURI_MUWS_PART2_TOPICS);
> >
> >
>
> org.apache.ws.muws.v1_0.topics.impl.XmlBeansManagementEventTopicImplstatusTopic
> > = (
> > org.apache.ws.muws.v1_0.topics.impl.XmlBeansManagementEventTopicImpl)
> > muwsTopicSpace.getTopic(
> >
> org.apache.ws.muws.v1_0.capability.OperationalStatusCapability.TOPIC_NAME
> );
> >
> >
>
> org.apache.ws.resource.properties.ResourcePropertyValueChangeEventstatusChangeEvent
> > = new
> > org.apache.ws.resource.properties.v2004_06.impl.
> > XmlBeansResourcePropertyValueChangeEvent(new
> > Object[]{oldStatus}, new Object[]{currentStatus});
> >             statusTopic.propertyChanged(statusChangeEvent);  // publish
> the
> > event
> > *        }
> >         return;
> >     }
> >
> >
> > But the consumer subscribed for OperationalStatusCapability is not
> getting
> > notifications i.e  the notify method on consumer is not getting invoked.
> >
> > So i tried using the ReqourcePropertyValueChangeTopic and made the
> following
> > changes.
> >
> >
> >     public void updateOperationalStatus(
> > org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.
> > OperationalStatusDocument.OperationalStatus.EnumnewStatus)
> >     {
> >      System.out.println("UPDATING OPERATIONAL STATUS");
> > org.apache.ws.notification.base.NotificationProducerResourceresource = (
> >
> org.apache.ws.notification.base.NotificationProducerResource
> )getResource();
> >         org.apache.ws.resource.properties.ResourceProperty statusProp =
> > ((FilesystemResource)getResource()).getResourcePropertySet().get(
> > FilesystemPropertyQNames.OPERATIONALSTATUS);
> >
> > org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.
> > OperationalStatusDocument.OperationalStatuscurrentStatus
> > = (
> > org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.
> > OperationalStatusDocument.OperationalStatus)
> > statusProp.get(0);
> >         if (!currentStatus.enumValue().equals(newStatus))
> >         {
> >             org.apache.xmlbeans.XmlObject oldStatus =
> > org.apache.ws.util.XmlBeanUtils.copyXmlBean(currentStatus);
> >             currentStatus.set(newStatus);
> >
> >  *           org.apache.ws.notification.topics.TopicSpace muwsTopicSpace
> =
> > resource.getTopicSpaceSet().getTopicSpace(statusProp.getMetaData
> > ().getName().getNamespaceURI());
> >
> >
>
> org.apache.ws.notification.topics.ResourcePropertyValueChangeTopicvalueChangeTopic=
> (
> > org.apache.ws.notification.topics.ResourcePropertyValueChangeTopic
> > )muwsTopicSpace.getTopic("OperationalStatus");
> >
> >
>
> org.apache.ws.resource.properties.ResourcePropertyValueChangeEventstatusChangeEvent
> > = new
> > org.apache.ws.resource.properties.v2004_06.impl.
> > XmlBeansResourcePropertyValueChangeEvent(new
> > Object[]{oldStatus}, new Object[]{currentStatus});
> >
> >             valueChangeTopic.propertyChanged(statusChangeEvent);  //
> publish
> > the event
> > *        }
> >
> >         return;
> >     }
> >
> > It worked. The consumer subscribing for OperationalStatus Topic is able
> to
> > get the notification events. But I think it may not be the clean way to
> do
> > things, how can I make use of MUWS defined Management Event
> CapabilityTopics
> > for acheiving this??
> >
> > Please help.. I appreciate your help in this matter.
> >
> >
> >
> >
> >
> >
> > On 6/28/06, Balan Subramanian <bs...@us.ibm.com> wrote:
> > >
> > > Hi Pushkar,
> > > I hope I understood your question properly.....
> > > The ResourcePropertyValueChangeTopic is used to publish notifications
> > > about property changes among the resource properties defined for that
> > > resource. Each notification carries the new value of the property and
> may
> > > carry the old value of the property as well. This is particularly
> useful
> > > in monitoring scenarios. These events are described in the WS-RP
> > > specifications.
> > >
> > > The ManagementEventTopic is used to publish notifications of WSDM
> events
> > > in the WSDM Event Format. The format is specificed in the muws-1 spec.
> > > Typically these would be events that are generated by the resource
> other
> > > than property change notifications for example, a heart beat sent by a
> > > resource.
> > >
> > > I am not sure why you cannot get the ManagementEvents in the notify
> method
> > > if you are subscribed to the topic properly. I'll try out some samples
> > > today but maybe someone has an answer to that already.
> > >
> > > Thanks,
> > > Balan
> > >
> > > Balan Subramanian
> > > Autonomic Computing, IBM, RTP, NC
> > > 919.543.0197 | bsubram@us.ibm.com
> > >
> > >
> > >
> > >
> > >
> > >
> > > "Pushkar Sachdeva" <pu...@gmail.com>
> > > 06/28/2006 09:50 AM
> > > Please respond to
> > > muse-user@ws.apache.org
> > >
> > >
> > > To
> > > muse-user@ws.apache.org
> > > cc
> > >
> > > Subject
> > > Help regarding muse notifications
> > >
> > >
> > >
> > >
> > >
> > >
> > > I am new to using notifications in muse. I have the following
> queries:-
> > >
> > > 1) What is the difference between *ResourcePropertyValueChangeTopic*
> and *
> > > ManagementEventTopic* ??
> > >
> > > 2) If in the Notification Producer,
> > > *ResourcePropertyValueChangeTopic*sends
> > > *ResourcePropertyValueChangeEvent* then that notification can be
> obtained
> > > in
> > > the notify function of Notification Consumer, but on the other hand If
> *
> > > ManagementEventTopic* sends the *ResourcePropertyValueChangeEvent*
> then
> > > the
> > > notification is not automatically received in the notify function of
> the
> > > Notification Consumer. However, in the latter case, Consumer can
> obtain
> > > the
> > > notification sent through *getCurrentMessage* request. How can i
> obtain
> > > this
> > > notification triggered by  *ManagementEventTopic* automatically
> without
> > > actually sending the request(the same way I obtained through *
> > > ResourcePropertyValueChangeTopic*) ??
> > >
> > > Please help me answer these questions or atleast direct me from where
> I
> > > could clear my doubts.
> > >
> > > Thanks a lot in advance.
> > >
> > > -Regards
> > > Pushkar
> > >
> > >
> > >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
>
>

Re: Help regarding muse notifications

Posted by Daniel Jemiolo <da...@us.ibm.com>.
Are you certain the client is sending the right topic expression? Are the 
subscriptions working and the notifications failing, or is the 
subscription failing early and then the side effect is no notifications? 
Can you send your client code for subscribing so we can eliminate that as 
a possible error?

thanks,
Dan



"Pushkar Sachdeva" <pu...@gmail.com> wrote on 07/06/2006 
10:48:26 AM:

> Thanks for your reply Balan.
> I tried a lot, still i am not able to get notification events on 
consumer
> side for *ManagementEventTopics*. Please direct me if there is any 
sample
> code showing its implementation. I already tried the *filesystem* and *
> enterprise* example that comes along with muse1.0.
> 
> In filesystem example, the code provieded for publishing via
> ManagementEventTopic is as follows:
> 
>   public void updateOperationalStatus(
> org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.
> OperationalStatusDocument.OperationalStatus.EnumnewStatus)
>     {
> org.apache.ws.notification.base.NotificationProducerResourceresource = (
> 
org.apache.ws.notification.base.NotificationProducerResource)getResource();
>         org.apache.ws.resource.properties.ResourceProperty statusProp =
> resource.getResourcePropertySet().get(
> FilesystemPropertyQNames.OPERATIONALSTATUS);
> 
> org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.
> OperationalStatusDocument.OperationalStatuscurrentStatus
> = (
> org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.
> OperationalStatusDocument.OperationalStatus)
> statusProp.get(0);
>         if (!currentStatus.enumValue().equals(newStatus))
>         {
>             org.apache.xmlbeans.XmlObject oldStatus =
> org.apache.ws.util.XmlBeanUtils.copyXmlBean(currentStatus);
>             currentStatus.set(newStatus);
> *            org.apache.ws.notification.topics.TopicSpace muwsTopicSpace 
=
> resource.getTopicSpaceSet().getTopicSpace(
> org.apache.ws.muws.v1_0.MuwsConstants.NSURI_MUWS_PART2_TOPICS);
> 
> 
org.apache.ws.muws.v1_0.topics.impl.XmlBeansManagementEventTopicImplstatusTopic
> = (
> org.apache.ws.muws.v1_0.topics.impl.XmlBeansManagementEventTopicImpl)
> muwsTopicSpace.getTopic(
> 
org.apache.ws.muws.v1_0.capability.OperationalStatusCapability.TOPIC_NAME);
> 
> 
org.apache.ws.resource.properties.ResourcePropertyValueChangeEventstatusChangeEvent
> = new
> org.apache.ws.resource.properties.v2004_06.impl.
> XmlBeansResourcePropertyValueChangeEvent(new
> Object[]{oldStatus}, new Object[]{currentStatus});
>             statusTopic.propertyChanged(statusChangeEvent);  // publish 
the
> event
> *        }
>         return;
>     }
> 
> 
> But the consumer subscribed for OperationalStatusCapability is not 
getting
> notifications i.e  the notify method on consumer is not getting invoked.
> 
> So i tried using the ReqourcePropertyValueChangeTopic and made the 
following
> changes.
> 
> 
>     public void updateOperationalStatus(
> org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.
> OperationalStatusDocument.OperationalStatus.EnumnewStatus)
>     {
>      System.out.println("UPDATING OPERATIONAL STATUS");
> org.apache.ws.notification.base.NotificationProducerResourceresource = (
> 
org.apache.ws.notification.base.NotificationProducerResource)getResource();
>         org.apache.ws.resource.properties.ResourceProperty statusProp =
> ((FilesystemResource)getResource()).getResourcePropertySet().get(
> FilesystemPropertyQNames.OPERATIONALSTATUS);
> 
> org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.
> OperationalStatusDocument.OperationalStatuscurrentStatus
> = (
> org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.
> OperationalStatusDocument.OperationalStatus)
> statusProp.get(0);
>         if (!currentStatus.enumValue().equals(newStatus))
>         {
>             org.apache.xmlbeans.XmlObject oldStatus =
> org.apache.ws.util.XmlBeanUtils.copyXmlBean(currentStatus);
>             currentStatus.set(newStatus);
> 
>  *           org.apache.ws.notification.topics.TopicSpace muwsTopicSpace 
=
> resource.getTopicSpaceSet().getTopicSpace(statusProp.getMetaData
> ().getName().getNamespaceURI());
> 
> 
org.apache.ws.notification.topics.ResourcePropertyValueChangeTopicvalueChangeTopic=(
> org.apache.ws.notification.topics.ResourcePropertyValueChangeTopic
> )muwsTopicSpace.getTopic("OperationalStatus");
> 
> 
org.apache.ws.resource.properties.ResourcePropertyValueChangeEventstatusChangeEvent
> = new
> org.apache.ws.resource.properties.v2004_06.impl.
> XmlBeansResourcePropertyValueChangeEvent(new
> Object[]{oldStatus}, new Object[]{currentStatus});
> 
>             valueChangeTopic.propertyChanged(statusChangeEvent);  // 
publish
> the event
> *        }
> 
>         return;
>     }
> 
> It worked. The consumer subscribing for OperationalStatus Topic is able 
to
> get the notification events. But I think it may not be the clean way to 
do
> things, how can I make use of MUWS defined Management Event 
CapabilityTopics
> for acheiving this??
> 
> Please help.. I appreciate your help in this matter.
> 
> 
> 
> 
> 
> 
> On 6/28/06, Balan Subramanian <bs...@us.ibm.com> wrote:
> >
> > Hi Pushkar,
> > I hope I understood your question properly.....
> > The ResourcePropertyValueChangeTopic is used to publish notifications
> > about property changes among the resource properties defined for that
> > resource. Each notification carries the new value of the property and 
may
> > carry the old value of the property as well. This is particularly 
useful
> > in monitoring scenarios. These events are described in the WS-RP
> > specifications.
> >
> > The ManagementEventTopic is used to publish notifications of WSDM 
events
> > in the WSDM Event Format. The format is specificed in the muws-1 spec.
> > Typically these would be events that are generated by the resource 
other
> > than property change notifications for example, a heart beat sent by a
> > resource.
> >
> > I am not sure why you cannot get the ManagementEvents in the notify 
method
> > if you are subscribed to the topic properly. I'll try out some samples
> > today but maybe someone has an answer to that already.
> >
> > Thanks,
> > Balan
> >
> > Balan Subramanian
> > Autonomic Computing, IBM, RTP, NC
> > 919.543.0197 | bsubram@us.ibm.com
> >
> >
> >
> >
> >
> >
> > "Pushkar Sachdeva" <pu...@gmail.com>
> > 06/28/2006 09:50 AM
> > Please respond to
> > muse-user@ws.apache.org
> >
> >
> > To
> > muse-user@ws.apache.org
> > cc
> >
> > Subject
> > Help regarding muse notifications
> >
> >
> >
> >
> >
> >
> > I am new to using notifications in muse. I have the following 
queries:-
> >
> > 1) What is the difference between *ResourcePropertyValueChangeTopic* 
and *
> > ManagementEventTopic* ??
> >
> > 2) If in the Notification Producer,
> > *ResourcePropertyValueChangeTopic*sends
> > *ResourcePropertyValueChangeEvent* then that notification can be 
obtained
> > in
> > the notify function of Notification Consumer, but on the other hand If 
*
> > ManagementEventTopic* sends the *ResourcePropertyValueChangeEvent* 
then
> > the
> > notification is not automatically received in the notify function of 
the
> > Notification Consumer. However, in the latter case, Consumer can 
obtain
> > the
> > notification sent through *getCurrentMessage* request. How can i 
obtain
> > this
> > notification triggered by  *ManagementEventTopic* automatically 
without
> > actually sending the request(the same way I obtained through *
> > ResourcePropertyValueChangeTopic*) ??
> >
> > Please help me answer these questions or atleast direct me from where 
I
> > could clear my doubts.
> >
> > Thanks a lot in advance.
> >
> > -Regards
> > Pushkar
> >
> >
> >


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org