Thanks for your precise answer.

In your proposal I note that I could perhaps do the read somewhere else than
in the initializeComplete() ?
If their is a more natural way to read the filterTopic I can do it... I'm
just in lack of some code sample which could help me in this progress.

I can also overwrite the SimpleSubscriptionManager but again the lack of
code sample is blocking me. Can I do that starting from the wsn-producer ?
Do you have a code sample I could re-use to do that ?

Thanks for your help

Cheers

Vpl


Daniel Jemiolo wrote:
> 
> 
> 
> I'm a little confused - it sounds like you are trying to read the values
> in
> order to respond to a subscription (subscribe request), but you are doing
> the read in initializeCompleted(). It seems like you would really want to
> do this by extending the SubscriptionManager capability
> (org.apache.muse.ws.notification.impl.SimpleSubscriptionManager),
> overriding initializeCompleted() and use the value of the subscription's
> topic to figure out what steps to take next (SubscriptionManager.getFilter
> () will return a TopicFilter if you're subscribing to topics). This is
> different than trying to add a capability to the producer resource (which
> creates the subscriptions).
> 
> Dan
> 
> 
> 
> vpl <[EMAIL PROTECTED]> wrote on 10/01/2007 11:18:05 AM:
> 
>>
>> Thanks for your answer. I appreciate. Here is the objective we have:
>>
>> We want a client to be able to subscribe to different Topics.
>> We have for example
>>  - subscribe to Group Notification (each time a group of user is
> modified)
>>  - subscribe to contentRoom (each time a contentRoom is updated).
>> On the server side,  we have several ContentRoom and Group which are
>> identified by Id (anf java listener via hashtable)
>> So we would like the Client to subscribe for example
>>    group=groupId1 or
>>    ContentRoom=contentRoomId2
>>
>> On the server side we need the code to parse correctly the topic value,
>> such as it (the server) extracts the groupId or ContentRoomId and then
> drill
>> down into the low level API (SIP etc..) to start the appropriate listener
>> for these Ids...
>>
>> this is the reason why I try to extract the content of the Topic set by
> the
>> Client.
>>
>> I appreciate your responsive support.
>>
>> Thanks for your help
>>
>> Cheers
>>
>>
>> Daniel Jemiolo wrote:
>> >
>> >
>> >
>> > I see what the problem is. Resource initialization is done before any
>> > request processing, so the WS-A headers have not been parsed and
> included
>> > in the context yet. The steps that are happening are:
>> >
>> > 1. Request sent to server..
>> > 2. Server sees request is for Muse app, starts the app.
>> > 3. Muse code runs its initialization routine, loading all resources and
>> > calling initialize*() methods.
>> > 4. Request is parsed - headers go to context, body is deserialized into
>> > objects.
>> > 5. Proper method invoked on resource.
>> >
>> >
>> > As you can see, #4 would have to happen before #3 in order for you to
> use
>> > the WS-A context in initializeCompleted(). What are you trying to do?
>> > Maybe
>> > we can offer suggestions on how to get there outside of
>> > initializeCompleted
>> > ().
>> >
>> > Dan
>> >
>> >
>> >
>> > vpl <[EMAIL PROTECTED]> wrote on 10/01/2007 09:35:23 AM:
>> >
>> >>
>> >> Thanks for your help
>> >>
>> >> No this is not the case.
>> >> The place where I call this
>> >> getResource().getEnvironment().getAddressingContext() is in the
>> >> initializeCompleted()
>> >> I call the super.initializeCompleted() before trying to retrieve the
>> >> getAddressingContext().
>> >> this is the wsn-producer code from which I try to retrieve the
>> >> SubscribeRequest message Content.
>> >>
>> >> Am I on the right way ?
>> >>
>> >> Thanks for your help
>> >>
>> >> Th code is the following:
>> >>
>> >> public class MyCapabilityImpl extends AbstractWsResourceCapability
>> >> implements MyCapability
>> >> {
>> >>     private static final QName[] _PROPERTIES = new QName[] {
>> >>             new QName(NAMESPACE_URI, "MessageInterval", PREFIX),
>> >>             new QName(NAMESPACE_URI, "ServerName", PREFIX)
>> >>     };
>> >>
>> >>     private static final QName _TOPIC_NAME = new QName(NAMESPACE_URI,
>> >> "MyTopic", PREFIX);
>> >>
>> >>     private static final QName _TOPIC_VPL = new QName(NAMESPACE_URI,
>> >> "/*/*/muws1:ManagementEvent", PREFIX);
>> >>
>> >>
>> >>     public QName[] getPropertyNames()
>> >>     {
>> >>         return _PROPERTIES;
>> >>     }
>> >>
>> >>     private int _MessageInterval = 10;
>> >>
>> >>     private String _ServerName = "16.16.235.174";
>> >>
>> >>     public int getMessageInterval()
>> >>     {
>> >>         return _MessageInterval;
>> >>     }
>> >>
>> >>     public void setMessageInterval(int param0)
>> >>     {
>> >>         _MessageInterval = param0;
>> >>     }
>> >>
>> >>     public String getServerName()
>> >>     {
>> >>         return _ServerName;
>> >>     }
>> >>
>> >>     public void setServerName(String param0)
>> >>     {
>> >>         _ServerName = param0;
>> >>     }
>> >>
>> >>
>> >>
>> >>     public void initializeCompleted()
>> >>         throws SoapFault
>> >>     {
>> >>         super.initializeCompleted();
>> >>
>> >>         //
>> >>         // access resource's WSN capability and create a new topic
>> >>         //
>> >>         final NotificationProducer wsn =
>> >> (NotificationProducer)getResource().getCapability
>> > (WsnConstants.PRODUCER_URI);
>> >>         wsn.addTopic(_TOPIC_NAME);
>> >>
>> >>    if (getResource().getEnvironment().getAddressingContext() == null)
>> >>       getLog().info("Vpl --
>> >> getResource().getEnvironment().getAddressingContext()  null");
>> >>    else
>> >>       getLog().info("Vpl -- getResource()getEnvironment().
>> >> getAddressingContext()
>> >> not null");
>> >>     }
>> >> }
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> Daniel Jemiolo wrote:
>> >> >
>> >> >
>> >> > A common cause of that is if you override the capability class'
>> > initialize
>> >> > () method but don't call super.initialize(). Is this the case?
>> >> >
>> >> > Dan
>> >> >
>> >> >
>> >> >
>> >> > vpl <[EMAIL PROTECTED]> wrote on 10/01/2007 08:28:51 AM:
>> >> >
>> >> >>
>> >> >> Hi,
>> >> >>
>> >> >> facing a problem. Did not find any clue in the distribution list.
> So I
>> >> > post
>> >> >> it.,...
>> >> >>
>> >> >> I'm extending the wsn-producer (sample) and would like to anayse
> the
>> >> > content
>> >> >> of the Filter value set by the Client
>> >> >> when it sends its SubscribeRequest
>> >> >>
>> >> >> MyCapabilityImpl extends AbstractWsResourceCapability. So I've
> tried a
>> >> >> getResource().getEnvironment().getAddressingContext() in my code
> and
>> > get
>> >> > a
>> >> >> null pointer, where getResource().getEnvironment() is not null. I'm
>> >> >> wondering:
>> >> >> - Is it normal as it seems to be the right way to get the
>> > messageHeader
>> >> >> values from the received message
>> >> >> - What is the good way to get this filter value set in the
>> >> > Subscriberequest
>> >> >> ?
>> >> >>
>> >> >> Thanks for your support
>> >> >>
>> >> >> Cheers
>> >> >>
>> >> >>
>> >> >>
>> >> >> --
>> >> >> View this message in context: http://www.nabble.com/getResource%28%
>> >> >> 29.getEnvironment%28%29.getAddressingContext%28%29-null-tf4548030.
>> >> >> html#a12978303
>> >> >> Sent from the Muse User mailing list archive at Nabble.com.
>> >> >>
>> >> >>
>> >> >>
> ---------------------------------------------------------------------
>> >> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> >> For additional commands, e-mail: [EMAIL PROTECTED]
>> >> >>
>> >> >
>> >>
>> >> --
>> >> View this message in context: http://www.nabble.com/getResource%28%
>> >> 29.getEnvironment%28%29.getAddressingContext%28%29-null-tf4548030.
>> >> html#a12979284
>> >> Sent from the Muse User mailing list archive at Nabble.com.
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> For additional commands, e-mail: [EMAIL PROTECTED]
>> >>
>> >
>>
>> --
>> View this message in context: http://www.nabble.com/getResource%28%
>> 29.getEnvironment%28%29.getAddressingContext%28%29-null-tf4548030.
>> html#a12981179
>> Sent from the Muse User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
> 

-- 
View this message in context: 
http://www.nabble.com/getResource%28%29.getEnvironment%28%29.getAddressingContext%28%29-null-tf4548030.html#a13111378
Sent from the Muse User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to