~ubuntu-branches/ubuntu/quantal/zeroc-ice/quantal

« back to all changes in this revision

Viewing changes to java/demo/book/freeze_filesystem/FileI.java

  • Committer: Bazaar Package Importer
  • Author(s): Cleto Martin Angelina
  • Date: 2011-04-25 18:44:24 UTC
  • mfrom: (6.1.14 sid)
  • Revision ID: james.westby@ubuntu.com-20110425184424-sep9i9euu434vq4c
Tags: 3.4.1-7
* Bug fix: "libdb5.1-java.jar was renamed to db.jar", thanks to Ondřej
  Surý (Closes: #623555).
* Bug fix: "causes noise in php5", thanks to Jayen Ashar (Closes:
  #623533).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// **********************************************************************
2
 
//
3
 
// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
4
 
//
5
 
// This copy of Ice is licensed to you under the terms described in the
6
 
// ICE_LICENSE file included in this distribution.
7
 
//
8
 
// **********************************************************************
9
 
 
10
 
import Filesystem.*;
11
 
 
12
 
public final class FileI extends PersistentFile
13
 
{
14
 
    public
15
 
    FileI()
16
 
    {
17
 
        _destroyed = false;
18
 
    }
19
 
 
20
 
    public
21
 
    FileI(Ice.Identity id)
22
 
    {
23
 
        _id = id;
24
 
        _destroyed = false;
25
 
    }
26
 
 
27
 
    public synchronized String
28
 
    name(Ice.Current current)
29
 
    {
30
 
        if(_destroyed)
31
 
        {
32
 
            throw new Ice.ObjectNotExistException(current.id, current.facet, current.operation);
33
 
        }
34
 
 
35
 
        return nodeName;
36
 
    }
37
 
 
38
 
    public void
39
 
    destroy(Ice.Current current)
40
 
        throws PermissionDenied
41
 
    {
42
 
        synchronized(this)
43
 
        {
44
 
            if(_destroyed)
45
 
            {
46
 
                throw new Ice.ObjectNotExistException(current.id, current.facet, current.operation);
47
 
            }
48
 
            _destroyed = true;
49
 
        }
50
 
 
51
 
        parent.removeNode(nodeName);
52
 
        _evictor.remove(_id);
53
 
    }
54
 
 
55
 
    public synchronized String[]
56
 
    read(Ice.Current current)
57
 
    {
58
 
        if(_destroyed)
59
 
        {
60
 
            throw new Ice.ObjectNotExistException(current.id, current.facet, current.operation);
61
 
        }
62
 
 
63
 
        return (String[])text.clone();
64
 
    }
65
 
 
66
 
    public synchronized void
67
 
    write(String[] text, Ice.Current current)
68
 
        throws GenericError
69
 
    {
70
 
        if(_destroyed)
71
 
        {
72
 
            throw new Ice.ObjectNotExistException(current.id, current.facet, current.operation);
73
 
        }
74
 
 
75
 
        this.text = text;
76
 
    }
77
 
 
78
 
    public static Freeze.Evictor _evictor;
79
 
    public Ice.Identity _id;
80
 
    private boolean _destroyed;
81
 
}