<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java_by_API%2Fjava.beans.beancontext%2FBeanContextSupport</id>
		<title>Java by API/java.beans.beancontext/BeanContextSupport - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java_by_API%2Fjava.beans.beancontext%2FBeanContextSupport"/>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java_by_API/java.beans.beancontext/BeanContextSupport&amp;action=history"/>
		<updated>2026-04-21T20:14:05Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.jexp.ru/index.php?title=Java_by_API/java.beans.beancontext/BeanContextSupport&amp;diff=1859&amp;oldid=prev</id>
		<title> в 17:43, 31 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java_by_API/java.beans.beancontext/BeanContextSupport&amp;diff=1859&amp;oldid=prev"/>
				<updated>2010-05-31T17:43:48Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 17:43, 31 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://www.jexp.ru/index.php?title=Java_by_API/java.beans.beancontext/BeanContextSupport&amp;diff=1860&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java_by_API/java.beans.beancontext/BeanContextSupport&amp;diff=1860&amp;oldid=prev"/>
				<updated>2010-05-31T14:38:12Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== BeanContextSupport: addBeanContextMembershipListener(BeanContextMembershipListener bcml) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright (c) 1995 - 2008 Sun Microsystems, Inc.  All rights reserved.&lt;br /&gt;
 *&lt;br /&gt;
 * Redistribution and use in source and binary forms, with or without&lt;br /&gt;
 * modification, are permitted provided that the following conditions&lt;br /&gt;
 * are met:&lt;br /&gt;
 *&lt;br /&gt;
 *   - Redistributions of source code must retain the above copyright&lt;br /&gt;
 *     notice, this list of conditions and the following disclaimer.&lt;br /&gt;
 *&lt;br /&gt;
 *   - Redistributions in binary form must reproduce the above copyright&lt;br /&gt;
 *     notice, this list of conditions and the following disclaimer in the&lt;br /&gt;
 *     documentation and/or other materials provided with the distribution.&lt;br /&gt;
 *&lt;br /&gt;
 *   - Neither the name of Sun Microsystems nor the names of its&lt;br /&gt;
 *     contributors may be used to endorse or promote products derived&lt;br /&gt;
 *     from this software without specific prior written permission.&lt;br /&gt;
 *&lt;br /&gt;
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &amp;quot;AS&lt;br /&gt;
 * IS&amp;quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,&lt;br /&gt;
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR&lt;br /&gt;
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR&lt;br /&gt;
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,&lt;br /&gt;
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,&lt;br /&gt;
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR&lt;br /&gt;
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF&lt;br /&gt;
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING&lt;br /&gt;
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS&lt;br /&gt;
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.&lt;br /&gt;
 */&lt;br /&gt;
import java.beans.beancontext.BeanContextChildSupport;&lt;br /&gt;
import java.beans.beancontext.BeanContextMembershipEvent;&lt;br /&gt;
import java.beans.beancontext.BeanContextMembershipListener;&lt;br /&gt;
import java.beans.beancontext.BeanContextSupport;&lt;br /&gt;
/**&lt;br /&gt;
 * A simple test program to illustrate delivery of the&lt;br /&gt;
 * BeanContextMembershipEvent.&lt;br /&gt;
 */&lt;br /&gt;
public class MembershipTest {&lt;br /&gt;
  public static void main(String[] args) {&lt;br /&gt;
    BeanContextSupport context = new BeanContextSupport(); // the context&lt;br /&gt;
    MyMembershipListener listener = new MyMembershipListener();&lt;br /&gt;
    BeanContextChildSupport bean = new BeanContextChildSupport(); // a JavaBean&lt;br /&gt;
    context.addBeanContextMembershipListener(listener); // now listening!&lt;br /&gt;
    context.add(bean);&lt;br /&gt;
    context.remove(bean);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
/**&lt;br /&gt;
 * A custom implementation of the BeanContextMembershipListener interface.&lt;br /&gt;
 */&lt;br /&gt;
class MyMembershipListener implements BeanContextMembershipListener {&lt;br /&gt;
  public void childrenAdded(BeanContextMembershipEvent bcme) {&lt;br /&gt;
    System.out.println(&amp;quot;Another bean has been added to the context.&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  public void childrenRemoved(BeanContextMembershipEvent bcme) {&lt;br /&gt;
    System.out.println(&amp;quot;A bean has been removed from the context.&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== BeanContextSupport: contains(Object o) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
/*&lt;br /&gt;
 * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.&lt;br /&gt;
 *&lt;br /&gt;
 * Redistribution and use in source and binary forms, with or without&lt;br /&gt;
 * modification, are permitted provided that the following conditions are met:&lt;br /&gt;
 *&lt;br /&gt;
 * -Redistribution of source code must retain the above copyright notice, this&lt;br /&gt;
 *  list of conditions and the following disclaimer.&lt;br /&gt;
 *&lt;br /&gt;
 * -Redistribution in binary form must reproduce the above copyright notice,&lt;br /&gt;
 *  this list of conditions and the following disclaimer in the documentation&lt;br /&gt;
 *  and/or other materials provided with the distribution.&lt;br /&gt;
 *&lt;br /&gt;
 * Neither the name of Sun Microsystems, Inc. or the names of contributors may&lt;br /&gt;
 * be used to endorse or promote products derived from this software without&lt;br /&gt;
 * specific prior written permission.&lt;br /&gt;
 *&lt;br /&gt;
 * This software is provided &amp;quot;AS IS,&amp;quot; without a warranty of any kind. ALL&lt;br /&gt;
 * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING&lt;br /&gt;
 * ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE&lt;br /&gt;
 * OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MIDROSYSTEMS, INC. (&amp;quot;SUN&amp;quot;)&lt;br /&gt;
 * AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE&lt;br /&gt;
 * AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS&lt;br /&gt;
 * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST&lt;br /&gt;
 * REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL,&lt;br /&gt;
 * INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY&lt;br /&gt;
 * OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,&lt;br /&gt;
 * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.&lt;br /&gt;
 *&lt;br /&gt;
 * You acknowledge that this software is not designed, licensed or intended&lt;br /&gt;
 * for use in the design, construction, operation or maintenance of any&lt;br /&gt;
 * nuclear facility.&lt;br /&gt;
 */&lt;br /&gt;
import java.beans.beancontext.BeanContextChildSupport;&lt;br /&gt;
import java.beans.beancontext.BeanContextSupport;&lt;br /&gt;
/**&lt;br /&gt;
 * A test program that adds a bean to a beancontext, and reports on various&lt;br /&gt;
 * aspects of the context&amp;quot;s membership state. This program also shows that a&lt;br /&gt;
 * bean&amp;quot;s getBeanContext() method can be called to get a reference to its&lt;br /&gt;
 * enclosing context.&lt;br /&gt;
 */&lt;br /&gt;
public class Example1 {&lt;br /&gt;
  private static BeanContextSupport context = new BeanContextSupport(); // The&lt;br /&gt;
                                      // BeanContext&lt;br /&gt;
  private static BeanContextChildSupport bean = new BeanContextChildSupport(); // The&lt;br /&gt;
                                         // JavaBean&lt;br /&gt;
  public static void main(String[] args) {&lt;br /&gt;
    report();&lt;br /&gt;
    // Add the bean to the context&lt;br /&gt;
    System.out.println(&amp;quot;Adding bean to context...&amp;quot;);&lt;br /&gt;
    context.add(bean);&lt;br /&gt;
    report();&lt;br /&gt;
  }&lt;br /&gt;
  private static void report() {&lt;br /&gt;
    // Print out a report of the context&amp;quot;s membership state.&lt;br /&gt;
    // Is the context empty?&lt;br /&gt;
    System.out.println(&amp;quot;Is the context empty? &amp;quot; + context.isEmpty());&lt;br /&gt;
    // Has the context been set for the child bean?&lt;br /&gt;
    boolean result = (bean.getBeanContext() != null);&lt;br /&gt;
    System.out.println(&amp;quot;Does the bean have a context yet? &amp;quot; + result);&lt;br /&gt;
    // Number of children in the context&lt;br /&gt;
    System.out.println(&amp;quot;Number of children in the context: &amp;quot;&lt;br /&gt;
        + context.size());&lt;br /&gt;
    // Is the specific bean a member of the context?&lt;br /&gt;
    System.out.println(&amp;quot;Is the bean a member of the context? &amp;quot;&lt;br /&gt;
        + context.contains(bean));&lt;br /&gt;
    // Equality test&lt;br /&gt;
    if (bean.getBeanContext() != null) {&lt;br /&gt;
      boolean isEqual = (bean.getBeanContext() == context); // true means&lt;br /&gt;
                                  // both&lt;br /&gt;
                                  // references&lt;br /&gt;
                                  // point to&lt;br /&gt;
                                  // the same&lt;br /&gt;
                                  // object&lt;br /&gt;
      System.out.println(&amp;quot;Contexts are the same? &amp;quot; + isEqual);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>