KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > myoodb > selfHealing > FamilyDbImpl


1 ///////////////////////////////////////////////////////////////////////////////
2
//
3
// Copyright (C) 2003-@year@ by Thomas M. Hazel, MyOODB (www.myoodb.org)
4
//
5
// All Rights Reserved
6
//
7
// This program is free software; you can redistribute it and/or modify
8
// it under the terms of the GNU General Public License and GNU Library
9
// General Public License as published by the Free Software Foundation;
10
// either version 2, or (at your option) any later version.
11
//
12
// This program is distributed in the hope that it will be useful,
13
// but WITHOUT ANY WARRANTY; without even the implied warranty of
14
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
// GNU General Public License and GNU Library General Public License
16
// for more details.
17
//
18
// You should have received a copy of the GNU General Public License
19
// and GNU Library General Public License along with this program; if
20
// not, write to the Free Software Foundation, 675 Mass Ave, Cambridge,
21
// MA 02139, USA.
22
//
23
///////////////////////////////////////////////////////////////////////////////
24
package org.myoodb.selfHealing;
25
26 public class FamilyDbImpl extends org.myoodb.collectable.TreeSetDbImpl implements Family
27 {
28     private String JavaDoc m_name;
29
30     public FamilyDbImpl()
31     {
32         m_name = null;
33     }
34
35     public void cleanUpReference()
36     {
37         super.cleanUpReference();
38
39         // !!! Pseudocode !!!
40
//
41
// XXX: if this object actually referenced a MyOODB object, here is where
42
// XXX: we would clean a potential back pointer reference
43
//
44
/*
45
46         m_myFoobar.setFamily(null);
47         m_myFoobar = null;
48
49         */

50     }
51
52     public void fixUpReference(long fixUpTime)
53     {
54         if (referenceHasBeenFixedUp(fixUpTime) == true)
55         {
56             return;
57         }
58
59         super.fixUpReference(fixUpTime);
60
61         // !!! Pseudocode !!!
62
//
63
// XXX: if this object actually referenced a MyOODB object, here is where
64
// XXX: we would clean it up and/or reallocate a new object
65
//
66
/*
67
68         try
69         {
70             m_myFoobar.testReference();
71         }
72         catch (org.myoodb.exception.ObjectNotFoundException e)
73         {
74             m_myFoobar = null;
75
76             // XXX: or just maybe realloc
77
78             m_myFoobar = (FooBar) getDatabase.createObject(Foobar.class);
79             m_myFoobar.setFamily(this);
80         }
81
82         */

83     }
84
85     public void setName(String JavaDoc name)
86     {
87         m_name = name;
88     }
89
90     public String JavaDoc getName()
91     {
92         return m_name;
93     }
94
95     public String JavaDoc toString()
96     {
97         return getName();
98     }
99 }
100
Popular Tags