API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.beans.beancontext. BeanContextServiceRevokedEvent View Javadoc
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

/*
 * @(#)BeanContextServiceRevokedEvent.java	1.10 03/12/19
 *
 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */

package java.beans.beancontext;

import java.beans.beancontext.BeanContextEvent;

import java.beans.beancontext.BeanContextServices;

/**
 * <p>
 * This event type is used by the 
 * <code>BeanContextServiceRevokedListener</code> in order to
 * identify the service being revoked.
 * </p>
 */
public class BeanContextServiceRevokedEvent extends BeanContextEvent {

    /**
     * Construct a <code>BeanContextServiceEvent</code>.
     * @param bcs the <code>BeanContextServices</code> 
     * from which this service is being revoked
     * @param sc the service that is being revoked
     * @param invalidate <code>true</code> for immediate revocation 
     */
    public BeanContextServiceRevokedEvent(BeanContextServices bcs, Class sc, boolean invalidate) {
	super((BeanContext)bcs);

	serviceClass    = sc;
	invalidateRefs  = invalidate;
    }

    /**
     * Gets the source as a reference of type <code>BeanContextServices</code>
     * @return the <code>BeanContextServices</code> from which 
     * this service is being revoked
     */
    public BeanContextServices getSourceAsBeanContextServices() {
	return (BeanContextServices)getBeanContext();
    }

    /**
     * Gets the service class that is the subject of this notification
     * @return A <code>Class</code> reference to the 
     * service that is being revoked
     */
    public Class getServiceClass() { return serviceClass; }

    /**
     * Checks this event to determine whether or not
     * the service being revoked is of a particular class.
     * @param service the service of interest (should be non-null)
     * @return <code>true</code> if the service being revoked is of the
     * same class as the specified service
     */
    public boolean isServiceClass(Class service) {
	return serviceClass.equals(service);
    }

    /**
     * Reports if the current service is being forcibly revoked,
     * in which case the references are now invalidated and unusable.
     * @return <code>true</code> if current service is being forcibly revoked
     */
    public boolean isCurrentServiceInvalidNow() { return invalidateRefs; }

    /**
     * fields
     */

    /**
     * A <code>Class</code> reference to the service that is being revoked.
     */
    protected Class			 serviceClass;
    private   boolean			 invalidateRefs;
}

Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar