java.beans.beancontext

Class BeanContextServicesSupport

Implemented Interfaces:
BeanContext, BeanContextChild, BeanContextServiceRevokedListener, BeanContextServices, BeanContextServicesListener, Collection, DesignMode, EventListener, PropertyChangeListener, Serializable, VetoableChangeListener, Visibility

public class BeanContextServicesSupport
extends BeanContextSupport
implements BeanContextServices

Since:
1.2
See Also:
Serialized Form

Nested Class Summary

protected class
BeanContextServicesSupport.BCSSChild
protected class
BeanContextServicesSupport.BCSSProxyServiceProvider
protected static class
BeanContextServicesSupport.BCSSServiceProvider

Nested classes/interfaces inherited from class java.beans.beancontext.BeanContextSupport

BeanContextSupport.BCSChild, BeanContextSupport.BCSIterator

Field Summary

protected ArrayList
bcsListeners
protected BeanContextServicesSupport.BCSSProxyServiceProvider
proxy
protected int
serializable
protected HashMap
services

Fields inherited from class java.beans.beancontext.BeanContextSupport

bcmListeners, children, designTime, locale, okToUseGui

Fields inherited from class java.beans.beancontext.BeanContextChildSupport

beanContext, beanContextChildPeer, pcSupport, rejectedSetBCOnce, vcSupport

Fields inherited from interface java.beans.beancontext.BeanContext

globalHierarchyLock

Fields inherited from interface java.beans.DesignMode

PROPERTYNAME

Constructor Summary

BeanContextServicesSupport()
BeanContextServicesSupport(BeanContextServices peer)
BeanContextServicesSupport(BeanContextServices peer, Locale locale)
BeanContextServicesSupport(BeanContextServices peer, Locale locale, boolean dtime)
BeanContextServicesSupport(BeanContextServices peer, Locale locale, boolean dtime, boolean visible)

Method Summary

void
addBeanContextServicesListener(BeanContextServicesListener listener)
boolean
addService(Class serviceClass, BeanContextServiceProvider bcsp)
protected boolean
addService(Class serviceClass, BeanContextServiceProvider bcsp, boolean fireEvent)
protected void
bcsPreDeserializationHook(ObjectInputStream ois)
protected void
bcsPreSerializationHook(ObjectOutputStream oos)
protected void
childJustRemovedHook(Object child, BeanContextSupport.BCSChild bcsc)
protected BeanContextSupport.BCSChild
createBCSChild(Object targetChild, Object peer)
protected BeanContextServicesSupport.BCSSServiceProvider
createBCSSServiceProvider(Class sc, BeanContextServiceProvider bcsp)
protected void
fireServiceAdded(BeanContextServiceAvailableEvent bcssae)
protected void
fireServiceAdded(Class serviceClass)
protected void
fireServiceRevoked(BeanContextServiceRevokedEvent event)
protected void
fireServiceRevoked(Class serviceClass, boolean revokeNow)
BeanContextServices
getBeanContextServicesPeer()
protected static BeanContextServicesListener
getChildBeanContextServicesListener(Object child)
Iterator
getCurrentServiceClasses()
Iterator
getCurrentServiceSelectors(Class serviceClass)
Object
getService(BeanContextChild child, Object requestor, Class serviceClass, Object serviceSelector, BeanContextServiceRevokedListener bcsrl)
boolean
hasService(Class serviceClass)
void
initialize()
protected void
initializeBeanContextResources()
protected void
releaseBeanContextResources()
void
releaseService(BeanContextChild child, Object requestor, Object service)
void
removeBeanContextServicesListener(BeanContextServicesListener listener)
void
revokeService(Class serviceClass, BeanContextServiceProvider bcsp, boolean revokeCurrentServicesNow)
void
serviceAvailable(BeanContextServiceAvailableEvent bcssae)
void
serviceRevoked(BeanContextServiceRevokedEvent bcssre)
Called by BeanContextServices.revokeService() to indicate that a service has been revoked.

Methods inherited from class java.beans.beancontext.BeanContextSupport

add, addAll, addBeanContextMembershipListener, avoidingGui, bcsChildren, bcsPreDeserializationHook, bcsPreSerializationHook, childDeserializedHook, childJustAddedHook, childJustRemovedHook, classEquals, clear, contains, containsAll, containsKey, copyChildren, createBCSChild, deserialize, dontUseGui, fireChildrenAdded, fireChildrenRemoved, getBeanContextPeer, getChildBeanContextChild, getChildBeanContextMembershipListener, getChildPropertyChangeListener, getChildSerializable, getChildVetoableChangeListener, getChildVisibility, getLocale, getResource, getResourceAsStream, initialize, instantiateChild, isDesignTime, isEmpty, isSerializing, iterator, needsGui, okToUseGui, propertyChange, readChildren, remove, remove, removeAll, removeBeanContextMembershipListener, retainAll, serialize, setDesignTime, setLocale, size, toArray, toArray, validatePendingAdd, validatePendingRemove, vetoableChange, writeChildren

Methods inherited from class java.beans.beancontext.BeanContextChildSupport

addPropertyChangeListener, addVetoableChangeListener, firePropertyChange, fireVetoableChange, getBeanContext, getBeanContextChildPeer, initializeBeanContextResources, isDelegated, releaseBeanContextResources, removePropertyChangeListener, removeVetoableChangeListener, serviceAvailable, serviceRevoked, setBeanContext, validatePendingSetBeanContext

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

bcsListeners

protected ArrayList bcsListeners

proxy

protected BeanContextServicesSupport.BCSSProxyServiceProvider proxy

serializable

protected int serializable

services

protected HashMap services

Constructor Details

BeanContextServicesSupport

public BeanContextServicesSupport()

BeanContextServicesSupport

public BeanContextServicesSupport(BeanContextServices peer)

BeanContextServicesSupport

public BeanContextServicesSupport(BeanContextServices peer,
                                  Locale locale)

BeanContextServicesSupport

public BeanContextServicesSupport(BeanContextServices peer,
                                  Locale locale,
                                  boolean dtime)

BeanContextServicesSupport

public BeanContextServicesSupport(BeanContextServices peer,
                                  Locale locale,
                                  boolean dtime,
                                  boolean visible)

Method Details

addBeanContextServicesListener

public void addBeanContextServicesListener(BeanContextServicesListener listener)
Specified by:
addBeanContextServicesListener in interface BeanContextServices

addService

public boolean addService(Class serviceClass,
                          BeanContextServiceProvider bcsp)
Specified by:
addService in interface BeanContextServices

addService

protected boolean addService(Class serviceClass,
                             BeanContextServiceProvider bcsp,
                             boolean fireEvent)

bcsPreDeserializationHook

protected void bcsPreDeserializationHook(ObjectInputStream ois)
            throws ClassNotFoundException,
                   IOException
Overrides:
bcsPreDeserializationHook in interface BeanContextSupport

bcsPreSerializationHook

protected void bcsPreSerializationHook(ObjectOutputStream oos)
            throws IOException
Overrides:
bcsPreSerializationHook in interface BeanContextSupport

childJustRemovedHook

protected void childJustRemovedHook(Object child,
                                    BeanContextSupport.BCSChild bcsc)
Overrides:
childJustRemovedHook in interface BeanContextSupport

createBCSChild

protected BeanContextSupport.BCSChild createBCSChild(Object targetChild,
                                                     Object peer)
Overrides:
createBCSChild in interface BeanContextSupport

createBCSSServiceProvider

protected BeanContextServicesSupport.BCSSServiceProvider createBCSSServiceProvider(Class sc,
                                                                                   BeanContextServiceProvider bcsp)

fireServiceAdded

protected final void fireServiceAdded(BeanContextServiceAvailableEvent bcssae)

fireServiceAdded

protected final void fireServiceAdded(Class serviceClass)

fireServiceRevoked

protected final void fireServiceRevoked(BeanContextServiceRevokedEvent event)

fireServiceRevoked

protected final void fireServiceRevoked(Class serviceClass,
                                        boolean revokeNow)

getBeanContextServicesPeer

public BeanContextServices getBeanContextServicesPeer()

getChildBeanContextServicesListener

protected static final BeanContextServicesListener getChildBeanContextServicesListener(Object child)

getCurrentServiceClasses

public Iterator getCurrentServiceClasses()
Specified by:
getCurrentServiceClasses in interface BeanContextServices

getCurrentServiceSelectors

public Iterator getCurrentServiceSelectors(Class serviceClass)
Specified by:
getCurrentServiceSelectors in interface BeanContextServices

getService

public Object getService(BeanContextChild child,
                         Object requestor,
                         Class serviceClass,
                         Object serviceSelector,
                         BeanContextServiceRevokedListener bcsrl)
            throws TooManyListenersException
Specified by:
getService in interface BeanContextServices

hasService

public boolean hasService(Class serviceClass)
Specified by:
hasService in interface BeanContextServices

initialize

public void initialize()
Overrides:
initialize in interface BeanContextSupport

initializeBeanContextResources

protected void initializeBeanContextResources()
Overrides:
initializeBeanContextResources in interface BeanContextChildSupport

releaseBeanContextResources

protected void releaseBeanContextResources()
Overrides:
releaseBeanContextResources in interface BeanContextChildSupport

releaseService

public void releaseService(BeanContextChild child,
                           Object requestor,
                           Object service)
Specified by:
releaseService in interface BeanContextServices

removeBeanContextServicesListener

public void removeBeanContextServicesListener(BeanContextServicesListener listener)
Specified by:
removeBeanContextServicesListener in interface BeanContextServices

revokeService

public void revokeService(Class serviceClass,
                          BeanContextServiceProvider bcsp,
                          boolean revokeCurrentServicesNow)
Specified by:
revokeService in interface BeanContextServices

serviceAvailable

public void serviceAvailable(BeanContextServiceAvailableEvent bcssae)
Specified by:
serviceAvailable in interface BeanContextServicesListener
Overrides:
serviceAvailable in interface BeanContextChildSupport

serviceRevoked

public void serviceRevoked(BeanContextServiceRevokedEvent bcssre)
Called by BeanContextServices.revokeService() to indicate that a service has been revoked. If you have a reference to such a service, it should be discarded and may no longer function properly. getService() will no longer work on the specified service class after this event has been fired.
Specified by:
serviceRevoked in interface BeanContextServiceRevokedListener
Overrides:
serviceRevoked in interface BeanContextChildSupport
Parameters:

BeanContextServicesSupport.java -- Copyright (C) 2003, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.