You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsrf-dev@ws.apache.org by Stefan Lischke <li...@novacom.net> on 2005/03/03 17:36:42 UTC

Same instance of ResourceHome for 2 services

Hi guys,

i'm just struggling using one instance of a ResourceHome for 2 service. 
I can name the same class in both <resource name="home" 
type="ResourceHome"> but they get 2 different instances. So it is not 
possible to share one resource with 2 or more services.

Is this a feature or a bug?

I need this for the following stuff: i have a Resource which is a 
Subscription, but i need 2 different services for it. The first one gets 
all notifications with usenotify=false (that means with no notify tag 
around, so im using my own WSRFMsg Handler) the second one gets the 
SubscriptionEnd Message.

any ideas?

stefan


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


Re: Same instance of ResourceHome for 2 services

Posted by Samuel Meder <me...@mcs.anl.gov>.
On Thu, 2005-03-03 at 19:15 +0100, Stefan Lischke wrote:
> Hi Sam
> 
> >That is the way jndi works. To create a link you need to use the
> >resourceLink element (it has a name attribute and a target attribute).
> >This should allow you to declare the home in one service (or where ever
> >you want really) and link to it from the other services.
> >  
> >
> It does not seem to work, if i'm doing it right.
> First my service where i define the resource nad after this the 
> resourceLink:
> 
>    <service name="SubscriptionEndPort">
>       <resource name="home" type="org.apache.ws.eventing.SubscriptionHome">
>          <resourceParams>
>             <parameter>
>                <name>serviceClassName</name>
>                
> <value>org.apache.ws.eventing.services.subscriber.SubscriberService</value>
>             </parameter>
>             <parameter>
>                <name>resourceClassName</name>
>                <value>org.apache.ws.eventing.Subscription</value>
>             </parameter>
>             <parameter>
>                <name>wsdlTargetNamespace</name>
>                
> <value>http://ws.apache.org/eventing/services/SubscriptionEndPort</value>
>             </parameter>           
>             <parameter>
>                <name>resourceKeyName</name>
>                
> <value>{http://schemas.xmlsoap.org/ws/2004/08/eventing}Identifier</value>
>             </parameter>
>          </resourceParams>
>       </resource>
>    </service>     
>   
>    <service name="NotificationPort">
>         <resourceLink name="home" target="SubscriptionEndPort" />
>    </service>
> 
> but it still gives me the error " Name SubscriptionEndPort is not bound 
> in this Context"
> 
> any ideas

Yea, you're not using the right target name. You need something like
target="java:/comp/env/SubscriptionEndPort/home".

/Sam

> >/Sam
> >
> >  
> >
> >>I need this for the following stuff: i have a Resource which is a 
> >>Subscription, but i need 2 different services for it. The first one gets 
> >>all notifications with usenotify=false (that means with no notify tag 
> >>around, so im using my own WSRFMsg Handler) the second one gets the 
> >>SubscriptionEnd Message.
> >>
> >>any ideas?
> >>
> >>stefan
> >>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: apollo-dev-unsubscribe@ws.apache.org
> >>For additional commands, e-mail: apollo-dev-help@ws.apache.org
> >>
> >>    
> >>
> 
> 
-- 
Sam Meder <me...@mcs.anl.gov>
The Globus Alliance - University of Chicago
630-252-1752



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


Re: Same instance of ResourceHome for 2 services

Posted by Ian Springer <ip...@apache.org>.
Stefan,

I'm sure the resourceLink stuff works in the original Globus impl. In 
Apollo, we refactored the config file parsing to utilize XmlBeans, and I 
suspect we forgot to tie in initialization of resourceLinks. I'll add 
this to the TODO list.

In the meantime, I'm glad Sal's suggestion is doing the trick.

Ian

Stefan Lischke wrote:

> Hi Sam
>
>> That is the way jndi works. To create a link you need to use the
>> resourceLink element (it has a name attribute and a target attribute).
>> This should allow you to declare the home in one service (or where ever
>> you want really) and link to it from the other services.
>>  
>>
> It does not seem to work, if i'm doing it right.
> First my service where i define the resource nad after this the 
> resourceLink:
>
>   <service name="SubscriptionEndPort">
>      <resource name="home" 
> type="org.apache.ws.eventing.SubscriptionHome">
>         <resourceParams>
>            <parameter>
>               <name>serviceClassName</name>
>               
> <value>org.apache.ws.eventing.services.subscriber.SubscriberService</value> 
>
>            </parameter>
>            <parameter>
>               <name>resourceClassName</name>
>               <value>org.apache.ws.eventing.Subscription</value>
>            </parameter>
>            <parameter>
>               <name>wsdlTargetNamespace</name>
>               
> <value>http://ws.apache.org/eventing/services/SubscriptionEndPort</value>
>            </parameter>                      <parameter>
>               <name>resourceKeyName</name>
>               
> <value>{http://schemas.xmlsoap.org/ws/2004/08/eventing}Identifier</value>
>            </parameter>
>         </resourceParams>
>      </resource>
>   </service>      
>   <service name="NotificationPort">
>        <resourceLink name="home" target="SubscriptionEndPort" />
>   </service>
>
> but it still gives me the error " Name SubscriptionEndPort is not 
> bound in this Context"
>
> any ideas
>
>> /Sam
>>
>>  
>>
>>> I need this for the following stuff: i have a Resource which is a 
>>> Subscription, but i need 2 different services for it. The first one 
>>> gets all notifications with usenotify=false (that means with no 
>>> notify tag around, so im using my own WSRFMsg Handler) the second 
>>> one gets the SubscriptionEnd Message.
>>>
>>> any ideas?
>>>
>>> stefan
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: apollo-dev-unsubscribe@ws.apache.org
>>> For additional commands, e-mail: apollo-dev-help@ws.apache.org
>>>
>>>   
>>
>
>


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


Re: Same instance of ResourceHome for 2 services

Posted by Stefan Lischke <li...@novacom.net>.
Hi Sam

>That is the way jndi works. To create a link you need to use the
>resourceLink element (it has a name attribute and a target attribute).
>This should allow you to declare the home in one service (or where ever
>you want really) and link to it from the other services.
>  
>
It does not seem to work, if i'm doing it right.
First my service where i define the resource nad after this the 
resourceLink:

   <service name="SubscriptionEndPort">
      <resource name="home" type="org.apache.ws.eventing.SubscriptionHome">
         <resourceParams>
            <parameter>
               <name>serviceClassName</name>
               
<value>org.apache.ws.eventing.services.subscriber.SubscriberService</value>
            </parameter>
            <parameter>
               <name>resourceClassName</name>
               <value>org.apache.ws.eventing.Subscription</value>
            </parameter>
            <parameter>
               <name>wsdlTargetNamespace</name>
               
<value>http://ws.apache.org/eventing/services/SubscriptionEndPort</value>
            </parameter>           
            <parameter>
               <name>resourceKeyName</name>
               
<value>{http://schemas.xmlsoap.org/ws/2004/08/eventing}Identifier</value>
            </parameter>
         </resourceParams>
      </resource>
   </service>     
  
   <service name="NotificationPort">
        <resourceLink name="home" target="SubscriptionEndPort" />
   </service>

but it still gives me the error " Name SubscriptionEndPort is not bound 
in this Context"

any ideas

>/Sam
>
>  
>
>>I need this for the following stuff: i have a Resource which is a 
>>Subscription, but i need 2 different services for it. The first one gets 
>>all notifications with usenotify=false (that means with no notify tag 
>>around, so im using my own WSRFMsg Handler) the second one gets the 
>>SubscriptionEnd Message.
>>
>>any ideas?
>>
>>stefan
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: apollo-dev-unsubscribe@ws.apache.org
>>For additional commands, e-mail: apollo-dev-help@ws.apache.org
>>
>>    
>>


-- 
My place : http://user.cs.tu-berlin.de/~lischke


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


Re: Same instance of ResourceHome for 2 services

Posted by Samuel Meder <me...@mcs.anl.gov>.
On Thu, 2005-03-03 at 17:36 +0100, Stefan Lischke wrote:
> Hi guys,
> 
> i'm just struggling using one instance of a ResourceHome for 2 service. 
> I can name the same class in both <resource name="home" 
> type="ResourceHome"> but they get 2 different instances. So it is not 
> possible to share one resource with 2 or more services.
> 
> Is this a feature or a bug?

That is the way jndi works. To create a link you need to use the
resourceLink element (it has a name attribute and a target attribute).
This should allow you to declare the home in one service (or where ever
you want really) and link to it from the other services.

/Sam

> I need this for the following stuff: i have a Resource which is a 
> Subscription, but i need 2 different services for it. The first one gets 
> all notifications with usenotify=false (that means with no notify tag 
> around, so im using my own WSRFMsg Handler) the second one gets the 
> SubscriptionEnd Message.
> 
> any ideas?
> 
> stefan
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: apollo-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: apollo-dev-help@ws.apache.org
> 
-- 
Sam Meder <me...@mcs.anl.gov>
The Globus Alliance - University of Chicago
630-252-1752



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