You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Eric Yung <er...@jspectrum.com> on 2003/10/07 16:37:28 UTC
[HiveMind] extending BuilderFactory
Hi,
Since I would like to store the ids of object created in the
BuilderFactory, I think I could have 2 choices to extend the
functionality of the BuilderFactory from the document.
(1) create a sub-class of BuilderFactory and overwrite the method
createCoreServiceImplementation(), create a new service and use that
service id in the <invoke-factory> configuration.
(2) create a new interceptor which intercepts the call to method
createCoreServiceImplementation() in the BuilderFactory and the
corresponding configuration in the hivemindmodule.xml.
Since using the 1st choice requires to copy the definitions of service
"hivemind.BuilderFactory" from hivemind's to my copy of
hivemindmodule.xml file, I prefer the 2nd way (more simple - in setup
the configuration file hivemindmodule.xml - than the 1st one and not
affected by the changes of <parameters-schema> defined in
"hivemind.BuilderFactory") and try it out.
But I notes from the debug log that the system creates multiple
instances of the BuilderFactory & the interceptor - one for each
<invoke-factory> config in the xml file. If I replace my interceptor
with the "hivemind.LoggingInterceptor", the behavior is the same.
I would like to know if this is the system behavior if I add a
interceptor in the service "hivemind.BuilderFactory" since the
instantiation of interceptor requests the "hivemind.BuilderFactory" service.
And could you suggest a better way to do that? Otherwise I will go for
the 1st one.
Thanks,
Eric
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: [HiveMind] extending BuilderFactory
Posted by Eric Yung <er...@jspectrum.com>.
Great to hear that.
I am now trying to use HiveMind as the kernel of my server (to replace
some home-built code). I use it to register all the services and manage
their lifecycle as needed. This allows me to separate the actual service
definition and implementation from the core server code.
Eric
Howard M. Lewis Ship wrote:
> Good, all is explained.
>
> We have plans afoot to allow a much more complicated environment in the future using a two-step
> registry process. Basically, we build one registry, a bootstrap registry, and use that registry to
> build the actual runtime registry. Haven't thought through the details fully, yet, and this is
> something I want to do after the 1.0 release.
>
> --
> Howard M. Lewis Ship
> Creator, Tapestry: Java Web Components
> http://jakarta.apache.org/tapestry
> http://jakarta.apache.org/commons/sandbox/hivemind/
> http://javatapestry.blogspot.com
>
>
>>-----Original Message-----
>>From: news [mailto:news@sea.gmane.org] On Behalf Of Eric Yung
>>Sent: Thursday, October 09, 2003 8:53 AM
>>To: commons-dev@jakarta.apache.org
>>Subject: Re: [HiveMind] extending BuilderFactory
>>
>>
>>Since I would like to record the ids of the services created by the
>>BuilderFactory, I want to use an interceptor to do the job. Before I
>>implements that solution, I take the logging interceptor as a test to
>>check if HiveMind allows such setup.
>>
>>And the result is that I cannot take this approach - HiveMind
>>does NOT
>>allow such setup. Add an interceptor to an BuilderFactory since the
>>interceptor uses the BuilderFactory service.
>>
>>
>>Regards,
>>Eric
>>
>>
>>Howard M. Lewis Ship wrote:
>>
>>>Did you add a logging interceptor to BuilderFactory?
>>>
>>>--
>>>Howard M. Lewis Ship
>>>Creator, Tapestry: Java Web Components
>>>http://jakarta.apache.org/tapestry
>>>http://jakarta.apache.org/commons/sandbox/hivemind/
>>>http://javatapestry.blogspot.com
>>>
>>>
>>>
>>>>-----Original Message-----
>>>>From: news [mailto:news@sea.gmane.org] On Behalf Of Eric Yung
>>>>Sent: Thursday, October 09, 2003 5:44 AM
>>>>To: commons-dev@jakarta.apache.org
>>>>Subject: Re: [HiveMind] extending BuilderFactory
>>>>
>>>>
>>>>Hi,
>>>>
>>>>After the testing I have built the newest version from the
>>>>CVS. When I
>>>>re-run the test today, it shows the following error.
>>>>
>>>>
>>>>[junit] Unable to construct service js.util.testA: Unable to
>>>>construct
>>>>service hivemind.BuilderFactory: Unable to construct service
>>>>hivemind.LoggingInterceptor: A recursive call to construct service
>>>>hivemind.BuilderFactory has occured. This indicates a cycle
>>>>between one
>>>>or more services or configurations.
>>>>
>>>>
>>>>And that's OK since the code can detect the cyclic dependency of the
>>>>services.
>>>>
>>>>
>>>>BTW, I have changed my code to extend the BuilderFactory and create
>>>>another service point by copying the default BuilderFactory
>>>>definition.
>>>>
>>>>
>>>>Regards,
>>>>Eric
>>>>
>>>>
>>>>Howard M. Lewis Ship wrote:
>>>>
>>>>
>>>>>>But I notes from the debug log that the system creates multiple
>>>>>>instances of the BuilderFactory & the interceptor - one for each
>>>>>><invoke-factory> config in the xml file. If I replace my
>>>>
>>>>interceptor
>>>>
>>>>
>>>>>>with the "hivemind.LoggingInterceptor", the behavior is the same.
>>>>>>
>>>>>>I would like to know if this is the system behavior if I add a
>>>>>>interceptor in the service "hivemind.BuilderFactory" since the
>>>>>>instantiation of interceptor requests the
>>
>>"hivemind.BuilderFactory"
>>
>>>>>>service.
>>>>>>
>>>>>
>>>>>
>>>>>hivemind.BuilderFactory is a singleton; it is created
>>>>
>>>>exactly once.
>>>>
>>>>
>>>>>I'd like to see the debug output you mention; there must be
>>>>
>>>>misleading
>>>>
>>>>
>>>>>output (perhaps due to the recent refactoring).
>>>>>
>>>>>--
>>>>>Howard M. Lewis Ship
>>>>>Creator, Tapestry: Java Web Components
>>>>>http://jakarta.apache.org/tapestry
>>>>>http://jakarta.apache.org/commons/sandbox/hivemind/
>>>>>http://javatapestry.blogspot.com
>>>>
>>>>
>>>>
>>>>------------------------------------------------------------
>>
>>---------
>>
>>>>To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>>>>For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>>>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: [HiveMind] extending BuilderFactory
Posted by Christian Essl <ch...@yahoo.de>.
Have you tried to use <create-instance> or defining your own
ServiceImplementationFactory which creates the Interceptor? I think this
way you don't need the BuilderFactory to create the
ServiceInterceptorFactory service.
On Thu, 09 Oct 2003 20:52:39 +0800, Eric Yung <er...@jspectrum.com>
wrote:
> Since I would like to record the ids of the services created by the
> BuilderFactory, I want to use an interceptor to do the job. Before I
> implements that solution, I take the logging interceptor as a test to
> check if HiveMind allows such setup.
>
> And the result is that I cannot take this approach - HiveMind does NOT
> allow such setup. Add an interceptor to an BuilderFactory since the
> interceptor uses the BuilderFactory service.
>
>
> Regards,
> Eric
>
>
> Howard M. Lewis Ship wrote:
>> Did you add a logging interceptor to BuilderFactory?
>>
>> --
>> Howard M. Lewis Ship
>> Creator, Tapestry: Java Web Components
>> http://jakarta.apache.org/tapestry
>> http://jakarta.apache.org/commons/sandbox/hivemind/
>> http://javatapestry.blogspot.com
>>
>>
>>> -----Original Message-----
>>> From: news [mailto:news@sea.gmane.org] On Behalf Of Eric Yung
>>> Sent: Thursday, October 09, 2003 5:44 AM
>>> To: commons-dev@jakarta.apache.org
>>> Subject: Re: [HiveMind] extending BuilderFactory
>>>
>>>
>>> Hi,
>>>
>>> After the testing I have built the newest version from the CVS. When I
>>> re-run the test today, it shows the following error.
>>>
>>>
>>> [junit] Unable to construct service js.util.testA: Unable to construct
>>> service hivemind.BuilderFactory: Unable to construct service
>>> hivemind.LoggingInterceptor: A recursive call to construct service
>>> hivemind.BuilderFactory has occured. This indicates a cycle between
>>> one or more services or configurations.
>>>
>>>
>>> And that's OK since the code can detect the cyclic dependency of the
>>> services.
>>>
>>>
>>> BTW, I have changed my code to extend the BuilderFactory and create
>>> another service point by copying the default BuilderFactory definition.
>>>
>>>
>>> Regards,
>>> Eric
>>>
>>>
>>> Howard M. Lewis Ship wrote:
>>>
>>>>> But I notes from the debug log that the system creates multiple
>>>>> instances of the BuilderFactory & the interceptor - one for each
>>>>> <invoke-factory> config in the xml file. If I replace my
>>>
>>> interceptor
>>>
>>>>> with the "hivemind.LoggingInterceptor", the behavior is the same.
>>>>>
>>>>> I would like to know if this is the system behavior if I add a
>>>>> interceptor in the service "hivemind.BuilderFactory" since the
>>>>> instantiation of interceptor requests the "hivemind.BuilderFactory"
>>>>> service.
>>>>>
>>>>
>>>>
>>>> hivemind.BuilderFactory is a singleton; it is created
>>>
>>> exactly once.
>>>
>>>> I'd like to see the debug output you mention; there must be
>>>
>>> misleading
>>>
>>>> output (perhaps due to the recent refactoring).
>>>>
>>>> --
>>>> Howard M. Lewis Ship
>>>> Creator, Tapestry: Java Web Components
>>>> http://jakarta.apache.org/tapestry
>>>> http://jakarta.apache.org/commons/sandbox/hivemind/
>>>> http://javatapestry.blogspot.com
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
--
--
Christian Essl http://jucas.sourceforge.net
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
RE: [HiveMind] extending BuilderFactory
Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
Good, all is explained.
We have plans afoot to allow a much more complicated environment in the future using a two-step
registry process. Basically, we build one registry, a bootstrap registry, and use that registry to
build the actual runtime registry. Haven't thought through the details fully, yet, and this is
something I want to do after the 1.0 release.
--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry
http://jakarta.apache.org/commons/sandbox/hivemind/
http://javatapestry.blogspot.com
> -----Original Message-----
> From: news [mailto:news@sea.gmane.org] On Behalf Of Eric Yung
> Sent: Thursday, October 09, 2003 8:53 AM
> To: commons-dev@jakarta.apache.org
> Subject: Re: [HiveMind] extending BuilderFactory
>
>
> Since I would like to record the ids of the services created by the
> BuilderFactory, I want to use an interceptor to do the job. Before I
> implements that solution, I take the logging interceptor as a test to
> check if HiveMind allows such setup.
>
> And the result is that I cannot take this approach - HiveMind
> does NOT
> allow such setup. Add an interceptor to an BuilderFactory since the
> interceptor uses the BuilderFactory service.
>
>
> Regards,
> Eric
>
>
> Howard M. Lewis Ship wrote:
> > Did you add a logging interceptor to BuilderFactory?
> >
> > --
> > Howard M. Lewis Ship
> > Creator, Tapestry: Java Web Components
> > http://jakarta.apache.org/tapestry
> > http://jakarta.apache.org/commons/sandbox/hivemind/
> > http://javatapestry.blogspot.com
> >
> >
> >>-----Original Message-----
> >>From: news [mailto:news@sea.gmane.org] On Behalf Of Eric Yung
> >>Sent: Thursday, October 09, 2003 5:44 AM
> >>To: commons-dev@jakarta.apache.org
> >>Subject: Re: [HiveMind] extending BuilderFactory
> >>
> >>
> >>Hi,
> >>
> >>After the testing I have built the newest version from the
> >>CVS. When I
> >>re-run the test today, it shows the following error.
> >>
> >>
> >>[junit] Unable to construct service js.util.testA: Unable to
> >>construct
> >>service hivemind.BuilderFactory: Unable to construct service
> >>hivemind.LoggingInterceptor: A recursive call to construct service
> >>hivemind.BuilderFactory has occured. This indicates a cycle
> >>between one
> >>or more services or configurations.
> >>
> >>
> >>And that's OK since the code can detect the cyclic dependency of the
> >>services.
> >>
> >>
> >>BTW, I have changed my code to extend the BuilderFactory and create
> >>another service point by copying the default BuilderFactory
> >>definition.
> >>
> >>
> >>Regards,
> >>Eric
> >>
> >>
> >>Howard M. Lewis Ship wrote:
> >>
> >>>>But I notes from the debug log that the system creates multiple
> >>>>instances of the BuilderFactory & the interceptor - one for each
> >>>><invoke-factory> config in the xml file. If I replace my
> >>
> >>interceptor
> >>
> >>>>with the "hivemind.LoggingInterceptor", the behavior is the same.
> >>>>
> >>>>I would like to know if this is the system behavior if I add a
> >>>>interceptor in the service "hivemind.BuilderFactory" since the
> >>>>instantiation of interceptor requests the
> "hivemind.BuilderFactory"
> >>>>service.
> >>>>
> >>>
> >>>
> >>>hivemind.BuilderFactory is a singleton; it is created
> >>
> >>exactly once.
> >>
> >>>I'd like to see the debug output you mention; there must be
> >>
> >>misleading
> >>
> >>>output (perhaps due to the recent refactoring).
> >>>
> >>>--
> >>>Howard M. Lewis Ship
> >>>Creator, Tapestry: Java Web Components
> >>>http://jakarta.apache.org/tapestry
> >>>http://jakarta.apache.org/commons/sandbox/hivemind/
> >>>http://javatapestry.blogspot.com
> >>
> >>
> >>
> >>------------------------------------------------------------
> ---------
> >>To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: [HiveMind] extending BuilderFactory
Posted by Eric Yung <er...@jspectrum.com>.
Since I would like to record the ids of the services created by the
BuilderFactory, I want to use an interceptor to do the job. Before I
implements that solution, I take the logging interceptor as a test to
check if HiveMind allows such setup.
And the result is that I cannot take this approach - HiveMind does NOT
allow such setup. Add an interceptor to an BuilderFactory since the
interceptor uses the BuilderFactory service.
Regards,
Eric
Howard M. Lewis Ship wrote:
> Did you add a logging interceptor to BuilderFactory?
>
> --
> Howard M. Lewis Ship
> Creator, Tapestry: Java Web Components
> http://jakarta.apache.org/tapestry
> http://jakarta.apache.org/commons/sandbox/hivemind/
> http://javatapestry.blogspot.com
>
>
>>-----Original Message-----
>>From: news [mailto:news@sea.gmane.org] On Behalf Of Eric Yung
>>Sent: Thursday, October 09, 2003 5:44 AM
>>To: commons-dev@jakarta.apache.org
>>Subject: Re: [HiveMind] extending BuilderFactory
>>
>>
>>Hi,
>>
>>After the testing I have built the newest version from the
>>CVS. When I
>>re-run the test today, it shows the following error.
>>
>>
>>[junit] Unable to construct service js.util.testA: Unable to
>>construct
>>service hivemind.BuilderFactory: Unable to construct service
>>hivemind.LoggingInterceptor: A recursive call to construct service
>>hivemind.BuilderFactory has occured. This indicates a cycle
>>between one
>>or more services or configurations.
>>
>>
>>And that's OK since the code can detect the cyclic dependency of the
>>services.
>>
>>
>>BTW, I have changed my code to extend the BuilderFactory and create
>>another service point by copying the default BuilderFactory
>>definition.
>>
>>
>>Regards,
>>Eric
>>
>>
>>Howard M. Lewis Ship wrote:
>>
>>>>But I notes from the debug log that the system creates multiple
>>>>instances of the BuilderFactory & the interceptor - one for each
>>>><invoke-factory> config in the xml file. If I replace my
>>
>>interceptor
>>
>>>>with the "hivemind.LoggingInterceptor", the behavior is the same.
>>>>
>>>>I would like to know if this is the system behavior if I add a
>>>>interceptor in the service "hivemind.BuilderFactory" since the
>>>>instantiation of interceptor requests the
>>>>"hivemind.BuilderFactory" service.
>>>>
>>>
>>>
>>>hivemind.BuilderFactory is a singleton; it is created
>>
>>exactly once.
>>
>>>I'd like to see the debug output you mention; there must be
>>
>>misleading
>>
>>>output (perhaps due to the recent refactoring).
>>>
>>>--
>>>Howard M. Lewis Ship
>>>Creator, Tapestry: Java Web Components
>>>http://jakarta.apache.org/tapestry
>>>http://jakarta.apache.org/commons/sandbox/hivemind/
>>>http://javatapestry.blogspot.com
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
RE: [HiveMind] extending BuilderFactory
Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
Did you add a logging interceptor to BuilderFactory?
--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry
http://jakarta.apache.org/commons/sandbox/hivemind/
http://javatapestry.blogspot.com
> -----Original Message-----
> From: news [mailto:news@sea.gmane.org] On Behalf Of Eric Yung
> Sent: Thursday, October 09, 2003 5:44 AM
> To: commons-dev@jakarta.apache.org
> Subject: Re: [HiveMind] extending BuilderFactory
>
>
> Hi,
>
> After the testing I have built the newest version from the
> CVS. When I
> re-run the test today, it shows the following error.
>
>
> [junit] Unable to construct service js.util.testA: Unable to
> construct
> service hivemind.BuilderFactory: Unable to construct service
> hivemind.LoggingInterceptor: A recursive call to construct service
> hivemind.BuilderFactory has occured. This indicates a cycle
> between one
> or more services or configurations.
>
>
> And that's OK since the code can detect the cyclic dependency of the
> services.
>
>
> BTW, I have changed my code to extend the BuilderFactory and create
> another service point by copying the default BuilderFactory
> definition.
>
>
> Regards,
> Eric
>
>
> Howard M. Lewis Ship wrote:
> >>But I notes from the debug log that the system creates multiple
> >>instances of the BuilderFactory & the interceptor - one for each
> >><invoke-factory> config in the xml file. If I replace my
> interceptor
> >>with the "hivemind.LoggingInterceptor", the behavior is the same.
> >>
> >>I would like to know if this is the system behavior if I add a
> >>interceptor in the service "hivemind.BuilderFactory" since the
> >>instantiation of interceptor requests the
> >>"hivemind.BuilderFactory" service.
> >>
> >
> >
> > hivemind.BuilderFactory is a singleton; it is created
> exactly once.
> > I'd like to see the debug output you mention; there must be
> misleading
> > output (perhaps due to the recent refactoring).
> >
> > --
> > Howard M. Lewis Ship
> > Creator, Tapestry: Java Web Components
> > http://jakarta.apache.org/tapestry
> > http://jakarta.apache.org/commons/sandbox/hivemind/
> > http://javatapestry.blogspot.com
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: [HiveMind] extending BuilderFactory
Posted by Eric Yung <er...@jspectrum.com>.
Hi,
After the testing I have built the newest version from the CVS. When I
re-run the test today, it shows the following error.
[junit] Unable to construct service js.util.testA: Unable to construct
service hivemind.BuilderFactory: Unable to construct service
hivemind.LoggingInterceptor: A recursive call to construct service
hivemind.BuilderFactory has occured. This indicates a cycle between one
or more services or configurations.
And that's OK since the code can detect the cyclic dependency of the
services.
BTW, I have changed my code to extend the BuilderFactory and create
another service point by copying the default BuilderFactory definition.
Regards,
Eric
Howard M. Lewis Ship wrote:
>>But I notes from the debug log that the system creates multiple
>>instances of the BuilderFactory & the interceptor - one for each
>><invoke-factory> config in the xml file. If I replace my interceptor
>>with the "hivemind.LoggingInterceptor", the behavior is the same.
>>
>>I would like to know if this is the system behavior if I add a
>>interceptor in the service "hivemind.BuilderFactory" since the
>>instantiation of interceptor requests the
>>"hivemind.BuilderFactory" service.
>>
>
>
> hivemind.BuilderFactory is a singleton; it is created exactly once. I'd like to see the debug
> output you mention; there must be misleading output (perhaps due to the recent refactoring).
>
> --
> Howard M. Lewis Ship
> Creator, Tapestry: Java Web Components
> http://jakarta.apache.org/tapestry
> http://jakarta.apache.org/commons/sandbox/hivemind/
> http://javatapestry.blogspot.com
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
RE: [HiveMind] extending BuilderFactory
Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
>
> But I notes from the debug log that the system creates multiple
> instances of the BuilderFactory & the interceptor - one for each
> <invoke-factory> config in the xml file. If I replace my interceptor
> with the "hivemind.LoggingInterceptor", the behavior is the same.
>
> I would like to know if this is the system behavior if I add a
> interceptor in the service "hivemind.BuilderFactory" since the
> instantiation of interceptor requests the
> "hivemind.BuilderFactory" service.
>
hivemind.BuilderFactory is a singleton; it is created exactly once. I'd like to see the debug
output you mention; there must be misleading output (perhaps due to the recent refactoring).
--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry
http://jakarta.apache.org/commons/sandbox/hivemind/
http://javatapestry.blogspot.com
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org