01: /*
02: * CoadunationLib: The coaduntion implementation library.
03: * Copyright (C) 2006 Rift IT Contracting
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation; either
08: * version 2.1 of the License, or (at your option) any later version.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library; if not, write to the Free Software
17: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18: *
19: * SubInterface1Impl.java
20: *
21: * This is a test object
22: */
23:
24: // package path
25: package com.rift.coad.lib.bean.test;
26:
27: // coadunation imports
28: import com.rift.coad.lib.Resource;
29: import com.rift.coad.lib.ResourceIndex;
30:
31: /**
32: * This is a test object.
33: *
34: * @author Brett Chaldecott
35: */
36: public class SubInterface1Impl implements SubInterface1, ResourceIndex,
37: Resource {
38:
39: // the release count
40: public static int releaseCount = 0;
41:
42: // private member variables
43: private String key = null;
44:
45: /** Creates a new instance of SubInterface1Impl */
46: public SubInterface1Impl(String key) {
47: this .key = key;
48: }
49:
50: /**
51: * The name of this interface
52: */
53: public String getName() {
54: return key;
55: }
56:
57: /**
58: * This method returns the primary key of this resource to enable indexing.
59: *
60: * @return The primary key of this object.
61: */
62: public Object getPrimaryKey() {
63: return key;
64: }
65:
66: /**
67: * This method is called to retrieve the name of the resource.
68: *
69: * @return The name of the resource.
70: */
71: public String getResourceName() {
72: return key;
73: }
74:
75: /**
76: * This method is called to release this resource.
77: */
78: public void releaseResource() {
79: releaseCount++;
80: }
81: }
|