01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: org_postgresql_Driver.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package com.uwyn.rife.cmf.dam.contentstores.rawstoredrivers;
09:
10: import com.uwyn.rife.cmf.dam.ContentDataUser;
11: import com.uwyn.rife.cmf.dam.exceptions.ContentManagerException;
12: import com.uwyn.rife.database.Datasource;
13: import com.uwyn.rife.database.DbTransactionUser;
14: import com.uwyn.rife.database.DbTransactionUserWithoutResult;
15: import com.uwyn.rife.database.queries.Select;
16: import com.uwyn.rife.engine.ElementSupport;
17: import com.uwyn.rife.tools.InnerClassException;
18:
19: public class org_postgresql_Driver extends generic {
20: public org_postgresql_Driver(Datasource datasource) {
21: super (datasource);
22: }
23:
24: protected <ResultType> ResultType _useContentData(
25: final Select retrieveContentChunks, final int id,
26: final ContentDataUser user) throws ContentManagerException {
27: return (ResultType) inTransaction(new DbTransactionUser<ResultType, Object>() {
28: public ResultType useTransaction()
29: throws InnerClassException {
30: return (ResultType) org_postgresql_Driver.super
31: ._useContentData(retrieveContentChunks, id,
32: user);
33: }
34: });
35: }
36:
37: protected void _serveContentData(
38: final Select retrieveContentChunks,
39: final ElementSupport element, final int id)
40: throws ContentManagerException {
41: inTransaction(new DbTransactionUserWithoutResult() {
42: public void useTransactionWithoutResult()
43: throws InnerClassException {
44: org_postgresql_Driver.super._serveContentData(
45: retrieveContentChunks, element, id);
46: }
47: });
48: }
49: }
|