hivemind-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Jakarta-hivemind Wiki] Update of "Examples" by ChristianMittendorf
Date Sun, 23 Oct 2005 17:37:42 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jakarta-hivemind Wiki" for change
notification.

The following page has been changed by ChristianMittendorf:
http://wiki.apache.org/jakarta-hivemind/Examples

------------------------------------------------------------------------------
  
  Maybe someone with more knowledge with Cayenne could help you out with this. We use Hibernate
and have another service which sits on top. This is how our code was pre-HiveMind (I am looking
at persisting configuration before we go full steam on using HiveMind in this part of the
application.) We are using Hibernate and OSCache, so there are 3 properties/xml files that
form parts of the configuration before you factor in application specifics.
  
- ChristianMittendorf: I've done some testing on HiveMind integration of Cayenne. My solution
requires your webapp to use servlet specification 2.4 or newer (see [http://www.objectstyle.org/cayenne/userguide/deploy/webapplicationcontextprovider.html
WebApplicationContextProvider]).
+ ChristianMittendorf: Here is an idea for a HiveMind service providing CayenneIntegation.
  
- Put a listener entry to your web.xml:
- 
- {{{
- <?xml version="1.0" encoding="UTF-8"?>
- <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
-     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-     xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
-     version="2.4">
- 	
- 	<display-name>...</display-name>
- 	[...]
- 	<listener>
- 	   <listener-class>org.objectstyle.cayenne.conf.WebApplicationContextProvider</listener-class>
- 	</listener>
- 	[...]
- </web-app> 
- }}}
- 
- Add the service to your hivemind.xml:
- 
- {{{
- 	<service-point id="dataContextService" interface="de.example.hivemind.DataContextService"
/>
- 	
- 	<implementation service-id="dataContextService">
- 	 	<invoke-factory>
- 			<construct class="de.example.hivemind.impl.DataContextServiceImpl" />
- 		</invoke-factory>
- 	</implementation>
- }}}
- 
- Create the Interface
- 
- {{{
- package de.example.hivemind;
- 
- import org.objectstyle.cayenne.access.DataContext;
- 
- public interface DataContextService
- {
- 	public DataContext getDataContext();
- }
- }}}
- 
- and the Implementation
- 
- {{{
- package de.example.hivemind.impl;
- 
- import org.objectstyle.cayenne.access.DataContext;
- 
- import de.example.hivemind.DataContextService;
- 
- public class DataContextServiceImpl implements DataContextService
- {	
- 	public DataContext getDataContext()
- 	{
- 		return DataContext.getThreadDataContext();
- 	}
- }
- }}}
- 

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-cvs-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-cvs-help@jakarta.apache.org


Mime
View raw message