summaryrefslogtreecommitdiff
path: root/java/demo/book/freeze_filesystem/FileI.java
blob: 12c92654a1b8f0503ff87da5dd27ea80ea77da4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// **********************************************************************
//
// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************

import Filesystem.*;

public final class FileI extends PersistentFile
{
    public
    FileI()
    {
    }

    public
    FileI(Ice.Identity id)
    {
        _id = id;
    }

    public String
    name(Ice.Current current)
    {
        return nodeName;
    }

    public void
    destroy(Ice.Current current)
        throws PermissionDenied
    {
        parent.removeNode(nodeName);
        _evictor.remove(_id);
    }

    public synchronized String[]
    read(Ice.Current current)
    {
        return (String[])text.clone();
    }

    public synchronized void
    write(String[] text, Ice.Current current)
        throws GenericError
    {
        this.text = text;
    }

    public static Freeze.Evictor _evictor;
    public Ice.Identity _id;
}