Are you saying that the LastUpdated attribute is missing even after a call 
to SetResourceProperties?

You can plug in your own implementation of Metrics (and any other 
capability) by following these steps:

1. Implement the org.apache.muse.ws.dm.muws.Metrics interface.

 
http://ws.apache.org/muse/docs/2.2.0/javadoc/org/apache/muse/ws/dm/muws/Metric.html


You may want to reuse the Metric class (which is just a simple POJO), but 
the Metrics capability can be whatever you want.



2. Update your muse.xml file to use your class instead of Muse's 
(SimpleMetrics).



Bogdan Solomon <[EMAIL PROTECTED]> wrote on 04/18/2007 03:33:32 PM:

> 
> I have created a resource that has a property that is supposed to be a 
Muse
> Metric. I have followed the example of adding WSDM Metrics, and the
> application works, however the only metric that gets returned to the 
client
> is the duration, and it does not receive the last update. Part of the
> Resource definition looks like this
> 
> <wsrmd:Property modifiability="read-only" mutability="mutable"
>             name="myns:JVMMetric"
> xmlns:myns="http://ws.apache.org/muse/test/pmi/jvm";
> xmlns:muws2="http://docs.oasis-open.org/wsdm/muws2-2.xsd";>
> 
> <muws2:Capability>http://docs.oasis-open.
> org/wsdm/muws/capabilities/Metrics</muws2:Capability>
>           <muws2:TimeScope>Interval</muws2:TimeScope>
>           <muws2:GatheringTime>Periodic</muws2:GatheringTime>
>           <muws2:CalculationInterval>PT30S</muws2:CalculationInterval>
>            <muws2:ChangeType>Gauge</muws2:ChangeType>
>             <wsrmd:ValidValues/>
>             <wsrmd:StaticValues/>
>             <wsrmd:InitialValues/>
>         </wsrmd:Property>
> 
> and what I get returned to the client using the MetricsClient looks like
> this:
> 
> <soapenv:Body>
>         <wsrf-rp:GetResourcePropertyResponse
>             xmlns:tns="http://axis2.platform.core.muse.apache.org";
> xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/rp-2";>
>             <myns:JVMMetric Duration="PT30S"
> xmlns:myns="http://ws.apache.org/muse/test/pmi/jvm";>
>                 <myns:HeapSize>
>                     <myns:LowerBound>51200</myns:LowerBound>
>                     <myns:UpperBound>262144</myns:UpperBound>
>                     <myns:LowerHighMark>51200</myns:LowerHighMark>
>                     <myns:UpperHighMark>51838</myns:UpperHighMark>
>                     <myns:Current>51838</myns:Current>
>                 </myns:HeapSize>
>                 <myns:UpTime>
>                     <myns:Count>451279</myns:Count>
>                 </myns:UpTime>
>             </myns:JVMMetric>
>         </wsrf-rp:GetResourcePropertyResponse>
>     </soapenv:Body>
> </soapenv:Envelope>
> 
> The metric gets update certainly as the up time count keeps changing.
> 
> Is there anything extra that I need to do in order to make the change
> listener update the metric?
> 
> 
> 
> I also have a second question: how would I go about adding my own Metric
> capability in Muse - which would update the values of the metric fields
> differently then the default implementation. Is there any way to say 
what
> MetricCapability to use via XML, or do I have to change Muse source 
code?
> 
> -- 
> View this message in context: http://www.nabble.com/Muse-Metric-not-
> displaying-last-update-field-tf3602958.html#a10065444
> Sent from the Muse User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> 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]

Reply via email to