KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > perseus > connector > ra > Writing


1 /**
2  * ObjectWeb Connector: an implementation of JCA Sun specification along
3  * with some extensions of this specification.
4  * Copyright (C) 2001-2002 France Telecom R&D - INRIA
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  * Release: 0.1
21  *
22  * Contact: jorm@objectweb.org
23  *
24  * Author: S. Chassande-Barrioz, P. Dechamboux
25  *
26  */

27
28 package org.objectweb.perseus.connector.ra;
29
30 import javax.resource.cci.Connection JavaDoc;
31
32 /**
33  * This interface defines a writing test. A test consist to write and read
34  * a value from a support. The value can be in only two states: before
35  * the writing or after the writing.
36  * The test passes if the read function return true in both case
37  * - read(false) == true
38  * - write() ; read(true) == true
39  */

40 public interface Writing {
41
42     void init(Connection JavaDoc c) throws Exception JavaDoc;
43
44     void init() throws Exception JavaDoc;
45
46     /**
47      * Read a data from the support, and check the value. The boolean
48      * parameter is used to check the read value.
49      * The method returns true is the data state is right
50      * The method throws Exceptions if an error occures during the test
51      */

52     boolean read(Connection JavaDoc c, boolean isWritten) throws Exception JavaDoc;
53
54     boolean read(boolean isWritten) throws Exception JavaDoc;
55
56     /**
57      *
58      * The method throws Exceptions if an error occures during the test
59      */

60     void write(Connection JavaDoc c) throws Exception JavaDoc;
61
62     void write() throws Exception JavaDoc;
63
64     void setConnection(Connection JavaDoc c) throws Exception JavaDoc;
65 }
66
Popular Tags