Hi Paul,

On Jun 21, 2011, at 6:54 PM, Paul Morris wrote:

> Can somebody give me a hint as to how to use spring bean injection to do the 
> following within the Component?
> 
> Here is the functionality I need to achieve within my applicationContext.xml:
> 
> Engine.getInstance().getRegisteredAuthenticators().add(new 
> AuthenticatorHelper());

I do this by making the helper self-register via the InitializingBean 
interface. Example:

https://github.com/NUBIC/psc-mirror/blob/trunk/web/src/main/java/edu/northwestern/bioinformatics/studycalendar/restlets/PscAuthenticatorHelper.java

Rhett

> 
> This is as far as I've gotten in the beans xml:
> 
> <bean id="component" class="org.restlet.ext.spring.SpringComponent">
>               <property name="name" value="APIUS Identity component" />
>               <property name="description" value="Authentication and 
> authorization. Session management." />
>               <property name="owner" value="apius.org" />
>               <property name="author" value="Paul Morris" />
>               <property name="client" value="http" />
>               <property name="defaultHost" ref="defaultHost" />
>       </bean>
>       
>       <bean id="defaultHost" class="org.restlet.ext.spring.SpringHost">
>               <constructor-arg ref="component" />
>               <property name="defaultAttachment" ref="proxyApplication" />
>       </bean>
>       
>       <bean id="componentChildContext" class="org.restlet.Context">
>               <lookup-method name="createChildContext" 
> bean="component.context" />
>       </bean>
>       
>       <bean id="proxyApplication" class="org.restlet.Application">
>               <constructor-arg ref="componentChildContext" />
>               <property name="name" value="OpenAM Proxy Application"/>
>               <property name="description" value="Proxy between the APIUS 
> session API and the OpenAM RESTful API" />
>               <property name="owner" value="apius.org" />
>               <property name="author" value="Paul Morris" />
>               <property name="inboundRoot">
>                       <bean class="org.restlet.ext.spring.SpringRouter">
>                               <constructor-arg ref="componentChildContext" />
>                               <property name="attachments">
>                                       <map>
>                                               <entry key="/session" 
> value="org.apius.identity.openam.session.SessionProxyImpl" />
>                                               <entry 
> key="/session/attributes" 
> value="org.apius.identity.openam.session.SessionAttributesImpl" />
>                                       </map>
>                               </property>
>                       </bean>
>               </property>
>       </bean>
>       
>       <bean id="engine" class="org.restlet.engine.Engine">
>               
>       </bean>
> 
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2771784

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2772127

Reply via email to