Example usage for java.beans.beancontext BeanContextServicesSupport addBeanContextServicesListener

List of usage examples for java.beans.beancontext BeanContextServicesSupport addBeanContextServicesListener

Introduction

In this page you can find the example usage for java.beans.beancontext BeanContextServicesSupport addBeanContextServicesListener.

Prototype


public void addBeanContextServicesListener(BeanContextServicesListener bcsl) 

Source Link

Document

add a BeanContextServicesListener

Usage

From source file:DocumentTester.java

public static void main(String[] args) {
    BeanContextServicesSupport context = new BeanContextServicesSupport(); // a
    // bean/*from w  w w  .  java 2s.com*/
    // context
    DocumentBean doc1 = new DocumentBean("Test.txt");
    context.add(doc1);
    context.addBeanContextServicesListener(doc1); // listen for new services
    WordCountServiceProvider provider = new WordCountServiceProvider();
    context.addService(WordCount.class, provider); // add the service to the
    // context
}