Skip to main content
summaryrefslogtreecommitdiffstats
blob: 569517099a57a0804c076d01101573c6dea79143 (plain) (blame)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*******************************************************************************
 * Copyright (c) 2001, 2008 Oracle Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *     Oracle Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jst.jsf.common.internal.managedobject;


/**
 * An abstraction for a manager that manages managed objects based on a KEYTYPE
 * 
 * @author cbateman
 * 
 * @param <T>
 * @param <KEYTYPE>
 */
public abstract class ObjectManager<T extends IManagedObject, KEYTYPE> extends
        AbstractManagedObject
{

    /**
     * A valid instance of T for the key. The instance of T may be unique on a
     * per-key basis or may not.
     * 
     * @param key
     * @return an instance of the managed object associated with key
     * @throws ManagedObjectException
     *             if an error occurs during construction
     */
    public abstract T getInstance(KEYTYPE key) throws ManagedObjectException;

    @Override
    public abstract void destroy();

    @Override
    public abstract void checkpoint();

    @Override
    public abstract void dispose();

    /**
     * Indicates a problem that occurred during a managed object operation
     * 
     * @author cbateman
     * 
     */
    public static class ManagedObjectException extends Exception
    {
        /**
         * 
         */
        private static final long serialVersionUID = -8723548990029368844L;

        /**
         * 
         */
        public ManagedObjectException()
        {
            super();
        }

        /**
         * @param message
         * @param cause
         */
        public ManagedObjectException(final String message, final Throwable cause)
        {
            super(message, cause);
        }

        /**
         * @param message
         */
        public ManagedObjectException(final String message)
        {
            super(message);
        }

        /**
         * @param cause
         */
        public ManagedObjectException(final Throwable cause)
        {
            super(cause);
        }
    }
}

Back to the top