Example usage for java.beans.beancontext BeanContextSupport addBeanContextMembershipListener

List of usage examples for java.beans.beancontext BeanContextSupport addBeanContextMembershipListener

Introduction

In this page you can find the example usage for java.beans.beancontext BeanContextSupport addBeanContextMembershipListener.

Prototype


public void addBeanContextMembershipListener(BeanContextMembershipListener bcml) 

Source Link

Document

Adds a BeanContextMembershipListener

Usage

From source file:MembershipTest.java

public static void main(String[] args) {
    BeanContextSupport context = new BeanContextSupport(); // the context
    MyMembershipListener listener = new MyMembershipListener();
    BeanContextChildSupport bean = new BeanContextChildSupport(); // a JavaBean
    context.addBeanContextMembershipListener(listener); // now listening!
    context.add(bean);//from   w  ww .  ja va  2 s  .co  m
    context.remove(bean);
}

From source file:MembershipTest.java

public static void main(String[] args) {
    BeanContextSupport context = new BeanContextSupport(); // the context
    MyMembershipListener listener = new MyMembershipListener();
    BeanContextChildSupport bean = new BeanContextChildSupport(); // a
    // JavaBean/*from  www .j  a  v  a  2 s. c o  m*/
    context.addBeanContextMembershipListener(listener); // now listening!
    context.add(bean);
    context.remove(bean);
}