0N/A/*
2362N/A * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/Apackage java.beans.beancontext;
0N/A
0N/Aimport java.util.EventObject;
0N/A
0N/Aimport java.beans.beancontext.BeanContext;
0N/A
0N/A/**
0N/A * <p>
0N/A * <code>BeanContextEvent</code> is the abstract root event class
0N/A * for all events emitted
0N/A * from, and pertaining to the semantics of, a <code>BeanContext</code>.
0N/A * This class introduces a mechanism to allow the propagation of
0N/A * <code>BeanContextEvent</code> subclasses through a hierarchy of
0N/A * <code>BeanContext</code>s. The <code>setPropagatedFrom()</code>
0N/A * and <code>getPropagatedFrom()</code> methods allow a
0N/A * <code>BeanContext</code> to identify itself as the source
0N/A * of a propagated event.
0N/A * </p>
0N/A *
0N/A * @author Laurence P. G. Cable
0N/A * @since 1.2
0N/A * @see java.beans.beancontext.BeanContext
0N/A */
0N/A
0N/Apublic abstract class BeanContextEvent extends EventObject {
1076N/A private static final long serialVersionUID = 7267998073569045052L;
0N/A
0N/A /**
0N/A * Contruct a BeanContextEvent
0N/A *
0N/A * @param bc The BeanContext source
0N/A */
0N/A protected BeanContextEvent(BeanContext bc) {
0N/A super(bc);
0N/A }
0N/A
0N/A /**
0N/A * Gets the <code>BeanContext</code> associated with this event.
0N/A * @return the <code>BeanContext</code> associated with this event.
0N/A */
0N/A public BeanContext getBeanContext() { return (BeanContext)getSource(); }
0N/A
0N/A /**
0N/A * Sets the <code>BeanContext</code> from which this event was propagated.
0N/A * @param bc the <code>BeanContext</code> from which this event
0N/A * was propagated
0N/A */
0N/A public synchronized void setPropagatedFrom(BeanContext bc) {
0N/A propagatedFrom = bc;
0N/A }
0N/A
0N/A /**
0N/A * Gets the <code>BeanContext</code> from which this event was propagated.
0N/A * @return the <code>BeanContext</code> from which this
0N/A * event was propagated
0N/A */
0N/A public synchronized BeanContext getPropagatedFrom() {
0N/A return propagatedFrom;
0N/A }
0N/A
0N/A /**
0N/A * Reports whether or not this event is
0N/A * propagated from some other <code>BeanContext</code>.
0N/A * @return <code>true</code> if propagated, <code>false</code>
0N/A * if not
0N/A */
0N/A public synchronized boolean isPropagated() {
0N/A return propagatedFrom != null;
0N/A }
0N/A
0N/A /*
0N/A * fields
0N/A */
0N/A
0N/A /**
0N/A * The <code>BeanContext</code> from which this event was propagated
0N/A */
0N/A protected BeanContext propagatedFrom;
0N/A}