You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hivemind.apache.org by "Kurt R. Hoehn" <kh...@etechstudios.com> on 2004/07/10 18:18:29 UTC

Service creating another service

Hello,

    I'm trying to create a service factory that takes another service as 
a parameter.  All the services get registered but when I try to use the 
service factory I have no idea how to get the parameters to the service 
that is a parameter to the service factory.  I'm using the EJBProxy 
service as a model but the documentation

 invoke-factory (service-id=hivemind.lib.EJBProxy)
  {
    parameters (home-interface=... jndi-name=... name-lookup-service=...)
  } 

"..." does little good on how to set the parameters of name-lookup-service.

If someone could enlighten me on how this is done I would greatly 
appreciate it.  I would then like to put together a demo of what I'm 
trying to do, which is create an implementation of Apache OJB in Hivemind.

TIA,
kurt h.


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


Re: Service creating another service

Posted by Achim Huegen <ah...@gmx-topmail.de>.
This would mean, that the factory B is responsible for creating two 
services at once: an instance of Q and an instance of A. This is be a 
rather uncommon use of a service implementation factory. It is be possible 
to do, but the factory needs its own schema like BuilderFactory or 
BeanFactory.

What about defining the service A which should be used by Q as a separate 
service point?
That way it would work 'out of the box'. No need for a 
ServiceImplementationFactory:

service-point (id=AForQ interface=A)
{
	invoke-factory (service-id=hivemind.BuilderFactory)
	{
		construct (class=AImpl)
		{
			set (property=one value=foo)
			set (property=two value=foo)
			set (property=three value=foo)
		}
	}
}

service-point (id=Q interface=Q)
{
	invoke-factory (service-id=hivemind.BuilderFactory)
	{
		construct (class=QImpl)
		{
			set-service (property=A service-id=AForQ)
		}
	}
}


Achim Huegen



Am Sun, 11 Jul 2004 11:47:47 -0400 schrieb Kurt R. Hoehn 
<kh...@etechstudios.com>:

> No problem.
>
> I'm using the EJBProxy as a model or example to build my own service.  
> My service has nothing to do with EJBProxy. Service A
>     attribute one is a required string
>     attribute two is a required string
>     attribute three is a required string
>
> Service B implements org.apache.hivemind.ServiceImplementationFactory
>     attribute one is a required string
>     attribute two is required Service A
>
> service-point (id=Q interface=com.myinterface.Q )
> {
>     invoke-factory (service-id=B)
>     {
>         parameters ( one=default two=??? )
>     }
> }
>
> Main Program
>         Registry registry = RegistryBuilder.constructDefaultRegistry();
>         Q q = (Q)registry.getService("Q", Q.class);
>          A a = q.getA();
>
> Attribute two in service Q is service A and that service has 3 
> attributes that need to be set, what is the syntax to set those 3 
> attributes?
>
> HTH,
> -kurt h
>
> Achim Huegen wrote:
>
>> I don't think I'm understanding your problem.
>> Do you just need more information on using the name-lookup-service 
>> attribute?
>> Maybe you could rephrase your question?
>>
>> Achim Huegen
>>
>> Am Sat, 10 Jul 2004 12:18:29 -0400 schrieb Kurt R. Hoehn 
>> <kh...@etechstudios.com>:
>>
>>> Hello,
>>>
>>>     I'm trying to create a service factory that takes another service 
>>> as a parameter.  All the services get registered but when I try to use 
>>> the service factory I have no idea how to get the parameters to the 
>>> service that is a parameter to the service factory.  I'm using the 
>>> EJBProxy service as a model but the documentation
>>>
>>>  invoke-factory (service-id=hivemind.lib.EJBProxy)
>>>   {
>>>     parameters (home-interface=... jndi-name=... 
>>> name-lookup-service=...)
>>>   } "..." does little good on how to set the parameters of 
>>> name-lookup-service.
>>>
>>> If someone could enlighten me on how this is done I would greatly 
>>> appreciate it.  I would then like to put together a demo of what I'm 
>>> trying to do, which is create an implementation of Apache OJB in 
>>> Hivemind.
>>>
>>> TIA,
>>> kurt h.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
>>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
>



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


Re: Service creating another service

Posted by "Kurt R. Hoehn" <kh...@etechstudios.com>.
No problem.

I'm using the EJBProxy as a model or example to build my own service.  
My service has nothing to do with EJBProxy. 

Service A
    attribute one is a required string
    attribute two is a required string
    attribute three is a required string

Service B implements org.apache.hivemind.ServiceImplementationFactory
    attribute one is a required string
    attribute two is required Service A

service-point (id=Q interface=com.myinterface.Q )
{
    invoke-factory (service-id=B)
    {
        parameters ( one=default two=??? )
    }
}

Main Program
        Registry registry = RegistryBuilder.constructDefaultRegistry();
        Q q = (Q)registry.getService("Q", Q.class);
         A a = q.getA();

Attribute two in service Q is service A and that service has 3 
attributes that need to be set, what is the syntax to set those 3 
attributes?

HTH,
-kurt h

Achim Huegen wrote:

> I don't think I'm understanding your problem.
> Do you just need more information on using the name-lookup-service 
> attribute?
> Maybe you could rephrase your question?
>
> Achim Huegen
>
> Am Sat, 10 Jul 2004 12:18:29 -0400 schrieb Kurt R. Hoehn 
> <kh...@etechstudios.com>:
>
>> Hello,
>>
>>     I'm trying to create a service factory that takes another service 
>> as a parameter.  All the services get registered but when I try to 
>> use the service factory I have no idea how to get the parameters to 
>> the service that is a parameter to the service factory.  I'm using 
>> the EJBProxy service as a model but the documentation
>>
>>  invoke-factory (service-id=hivemind.lib.EJBProxy)
>>   {
>>     parameters (home-interface=... jndi-name=... 
>> name-lookup-service=...)
>>   } "..." does little good on how to set the parameters of 
>> name-lookup-service.
>>
>> If someone could enlighten me on how this is done I would greatly 
>> appreciate it.  I would then like to put together a demo of what I'm 
>> trying to do, which is create an implementation of Apache OJB in 
>> Hivemind.
>>
>> TIA,
>> kurt h.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
>
>
>


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


Re: Service creating another service

Posted by Achim Huegen <ah...@gmx-topmail.de>.
I don't think I'm understanding your problem.
Do you just need more information on using the name-lookup-service 
attribute?
Maybe you could rephrase your question?

Achim Huegen

Am Sat, 10 Jul 2004 12:18:29 -0400 schrieb Kurt R. Hoehn 
<kh...@etechstudios.com>:

> Hello,
>
>     I'm trying to create a service factory that takes another service as 
> a parameter.  All the services get registered but when I try to use the 
> service factory I have no idea how to get the parameters to the service 
> that is a parameter to the service factory.  I'm using the EJBProxy 
> service as a model but the documentation
>
>  invoke-factory (service-id=hivemind.lib.EJBProxy)
>   {
>     parameters (home-interface=... jndi-name=... name-lookup-service=...)
>   } "..." does little good on how to set the parameters of 
> name-lookup-service.
>
> If someone could enlighten me on how this is done I would greatly 
> appreciate it.  I would then like to put together a demo of what I'm 
> trying to do, which is create an implementation of Apache OJB in 
> Hivemind.
>
> TIA,
> kurt h.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
>



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