You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Paul Stanton <pa...@gunnsoft.com.au> on 2007/05/09 05:21:15 UTC
instantiate abstract asset class
What is the best way to instantiate an abstract class defining an asset?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: instantiate abstract asset class
Posted by Paul Stanton <pa...@gunnsoft.com.au>.
maybe my problem is more to do with hivemind:
basically i have an asset class (developed by someone else) which is non
abstract, but still needs to reference a hivemind service.
How can I have the service injected?
I've tried using setter method injection, but since the asset class is
not registered with hivemind injection never occurs.
help appreciated.
thanks.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: instantiate abstract asset class
Posted by Kalle Korhonen <ka...@gmail.com>.
You can't instantiate an abstract class, that's why it's abstract.
Instantiating an anonymous inner class derived from it wouldn't work?
MyAsset myAsset = new MyAsset() {
@Override
public InjectedObject getInjectedObject() {return null;}
};
Kalle
On 5/9/07, Paul Stanton <pa...@gunnsoft.com.au> wrote:
>
> no, I have a class which implements IAsset, and I need to be able to
> keep it abstract for injections, yet instantiate it or get a handle to
> an instance on demand.
>
> Is there a pool/procedure in tapestry I can retrieve an instance from?
>
> Thanks.
>
> Jesse Kuhnert wrote:
> > I don't think you can instantiate an abstract class.
> >
> > Were you trying to test a component?
> >
> > http://tapestry.apache.org/tapestry4.1/tapestry-test/components.html
> >
> > On 5/8/07, Paul Stanton <pa...@gunnsoft.com.au> wrote:
> >>
> >> What is the best way to instantiate an abstract class defining an
> asset?
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >> For additional commands, e-mail: users-help@tapestry.apache.org
> >>
> >>
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
Re: instantiate abstract asset class
Posted by Paul Stanton <pa...@gunnsoft.com.au>.
no, I have a class which implements IAsset, and I need to be able to
keep it abstract for injections, yet instantiate it or get a handle to
an instance on demand.
Is there a pool/procedure in tapestry I can retrieve an instance from?
Thanks.
Jesse Kuhnert wrote:
> I don't think you can instantiate an abstract class.
>
> Were you trying to test a component?
>
> http://tapestry.apache.org/tapestry4.1/tapestry-test/components.html
>
> On 5/8/07, Paul Stanton <pa...@gunnsoft.com.au> wrote:
>>
>> What is the best way to instantiate an abstract class defining an asset?
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: instantiate abstract asset class
Posted by Jesse Kuhnert <jk...@gmail.com>.
I don't think you can instantiate an abstract class.
Were you trying to test a component?
http://tapestry.apache.org/tapestry4.1/tapestry-test/components.html
On 5/8/07, Paul Stanton <pa...@gunnsoft.com.au> wrote:
>
> What is the best way to instantiate an abstract class defining an asset?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
Jesse Kuhnert
Tapestry/Dojo team member/developer
Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com