Dec 10

To add a single Protocol you can set the client property of the Component to the required Protocol. For example to wire up a Component and add the file:// protocol you would use the following.

   <bean id="component" class="org.restlet.ext.spring.SpringComponent">
      <property name="server">
         <bean class="org.restlet.ext.spring.SpringServer">
            <constructor-arg value="http" />
            <constructor-arg value="8080" />
         </bean>
      </property>
      <property name="client">
         <util:constant static-field="org.restlet.data.Protocol.FILE"/>
      </property>
      <property name="defaultTarget" ref="router" />
</bean>

written by objects \\ tags: , ,

Dec 10

Static constants can be used in your Spring wiring using either FieldRetrievingFactoryBean, or the newer util schema.

(2.0+) util schema


<bean id="myBean" class="au.com.objects.MyBean">
   <property name="dayOfWeek">
      <util:constant static-field="java.util.Calendar.MONDAY"/>
   </property>
</bean>

(Pre-2.0) FieldRetrievingFactoryBean


<bean id="myBean" class="au.com.objects.MyBean">
   <property name="dayOfWeek">
      <bean id="java.util.Calendar.MONDAY"
         class="org.springframework.beans.factory.config.FieldRetrievingFactoryBean"/>
   </property>
</bean>

written by objects \\ tags: , , , ,

Oct 11

There is a getSessionFactory() method in LocalContainerEntityManagerFactoryBean, so you can define a session factory bean in spring using the following:


<bean id="sessionFactory" 
   factory-bean="entityManagerFactory" 
   factory-method="getSessionFactory" />

written by objects \\ tags: , ,