Hi nevez,

you could define your Factory as a service-point in hivemodule.xml, letting hivemind instantiate it for you.

Then you define your class as a 'normal' one, using simple java properties:

private IHandler handler ;
public IHandler getHandler() { return this.handler ; }
public void setHandler(IHandler handler) { this.handler = handler ; } ....

In hivemodule.xml you can set those properties:

<service-point id="manoInterceptoriusFactory" interface="ServiceInterceptorFactory">
        <invoke-factory>
                <construct class="...package.manoInterceptoriusFactory">
<set-object property="handler value="service:handleris"/> (depends on the source of handleris)
                </construct>
        </invoke-factory>
</service-point>

I hope this is right - I am very new to Tapestry/Hivemind - so I hope this handwritten code is ok.

Bye,
Gerald


nevez wrote:
i have


public abstract class manoInterceptoriusFactory implements 
ServiceInterceptorFactory
&#123;
&nbsp; &nbsp;@InjectObject&#40;"handleris"&#41; public abstract IHandler 
getHandler&#40;&#41;;
&nbsp; &nbsp;....
&nbsp; &nbsp;public void createInterceptor&#40;InterceptorStack stack, Module 
invokingModule, List parameters&#41;
&nbsp; &nbsp; &#123;

&nbsp; &nbsp; &nbsp;.....
&nbsp; &nbsp; &nbsp;getHandler&#40;&#41;;
&nbsp; &nbsp; &nbsp;...
&nbsp; &nbsp; &nbsp;&#125;
&#125;

and it doesnt work:
org.apache.hivemind.ApplicationRuntimeException: Unable to construct service 
tapestry.page.PagePool: Unable to construct service test1.manoInterceptorius: 
Unable to instantiate instance of class test1.manoInterceptoriusFactory: 
java.lang.InstantiationException 
[file:/C:/workspace/tomcatProjects/test1/exploded/WEB-INF/classes/META-INF/hivemodule.xml,
 line 17, column 61]

i think its because of abstract class.
so do you have any ideas on getting the object w/o using abstract class?


-------------------- m2f --------------------

Sent from www.TapestryForums.com

Read this topic online here: <<topic_link>>

http://www.tapestryforums.com/viewtopic.php?p=14148#14148

-------------------- m2f --------------------




--
Using Tapestry 4.0, Hivemind 1.1, Tomcat 5.5.12, Eclipse 3.1.1

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

Reply via email to