src/share/classes/java/beans/beancontext/BeanContextServicesSupport.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 601,625 ****
super();
serviceProvider = bcsp;
}
protected BeanContextServiceProvider getServiceProvider() {
return serviceProvider;
}
! /*
! * fields
*/
protected BeanContextServiceProvider serviceProvider;
}
/**
* subclasses can override this method to create new subclasses of
* BCSSServiceProvider without having to overrride addService() in
* order to instantiate.
*/
protected BCSSServiceProvider createBCSSServiceProvider(Class sc, BeanContextServiceProvider bcsp) {
return new BCSSServiceProvider(sc, bcsp);
}
--- 601,632 ----
super();
serviceProvider = bcsp;
}
+ /**
+ * Returns the service provider.
+ * @return the service provider
+ */
protected BeanContextServiceProvider getServiceProvider() {
return serviceProvider;
}
! /**
! * The service provider.
*/
protected BeanContextServiceProvider serviceProvider;
}
/**
* subclasses can override this method to create new subclasses of
* BCSSServiceProvider without having to overrride addService() in
* order to instantiate.
+ * @return a service provider without overriding addService()
+ * @param sc the class
+ * @param bcsp the service provider
*/
protected BCSSServiceProvider createBCSSServiceProvider(Class sc, BeanContextServiceProvider bcsp) {
return new BCSSServiceProvider(sc, bcsp);
}
*** 627,637 ****
/************************************************************************/
/**
* add a BeanContextServicesListener
*
! * @throws NullPointerException
*/
public void addBeanContextServicesListener(BeanContextServicesListener bcsl) {
if (bcsl == null) throw new NullPointerException("bcsl");
--- 634,644 ----
/************************************************************************/
/**
* add a BeanContextServicesListener
*
! * @throws NullPointerException if the argument is null
*/
public void addBeanContextServicesListener(BeanContextServicesListener bcsl) {
if (bcsl == null) throw new NullPointerException("bcsl");
*** 658,675 ****
--- 665,688 ----
}
}
/**
* add a service
+ * @param serviceClass the service class
+ * @param bcsp the service provider
*/
public boolean addService(Class serviceClass, BeanContextServiceProvider bcsp) {
return addService(serviceClass, bcsp, true);
}
/**
* add a service
+ * @param serviceClass the service class
+ * @param bcsp the service provider
+ * @param fireEvent whether or not an event should be fired
+ * @return true if the service was successfully added
*/
protected boolean addService(Class serviceClass, BeanContextServiceProvider bcsp, boolean fireEvent) {
if (serviceClass == null) throw new NullPointerException("serviceClass");
*** 707,716 ****
--- 720,732 ----
}
}
/**
* remove a service
+ * @param serviceClass the service class
+ * @param bcsp the service provider
+ * @param revokeCurrentServicesNow whether or not to revoke the service
*/
public void revokeService(Class serviceClass, BeanContextServiceProvider bcsp, boolean revokeCurrentServicesNow) {
if (serviceClass == null) throw new NullPointerException("serviceClass");
*** 1065,1074 ****
--- 1081,1091 ----
}
}
/**
* Fires a <tt>BeanContextServiceEvent</tt> notifying of a new service.
+ * @param serviceClass the service class
*/
protected final void fireServiceAdded(Class serviceClass) {
BeanContextServiceAvailableEvent bcssae = new BeanContextServiceAvailableEvent(getBeanContextServicesPeer(), serviceClass);
fireServiceAdded(bcssae);
*** 1107,1116 ****
--- 1124,1135 ----
/**
* Fires a <tt>BeanContextServiceRevokedEvent</tt>
* indicating that a particular service is
* no longer available.
+ * @param serviceClass the service class
+ * @param revokeNow whether or not the event should be revoked now
*/
protected final void fireServiceRevoked(Class serviceClass, boolean revokeNow) {
Object[] copy;
BeanContextServiceRevokedEvent bcsre = new BeanContextServiceRevokedEvent(getBeanContextServicesPeer(), serviceClass, revokeNow);