changeset 910:9b65e8064f90

simplify AggregateLifeCycle
author Franklin Schmidt <fschmidt@gmail.com>
date Sat, 08 Oct 2016 21:30:32 -0600
parents c60c1adfac3e
children cab5830e1ab0
files src/org/eclipse/jetty/util/component/AggregateLifeCycle.java
diffstat 1 files changed, 3 insertions(+), 40 deletions(-) [+]
line wrap: on
line diff
--- a/src/org/eclipse/jetty/util/component/AggregateLifeCycle.java	Sat Oct 08 21:15:28 2016 -0600
+++ b/src/org/eclipse/jetty/util/component/AggregateLifeCycle.java	Sat Oct 08 21:30:32 2016 -0600
@@ -136,7 +136,7 @@
 	 * @param bean
 	 * @return True if the aggregate contains the bean
 	 */
-	public boolean contains(Object bean)
+	private boolean contains(Object bean)
 	{
 		for (Bean b:_beans)
 			if (b._bean==bean)
@@ -145,19 +145,6 @@
 	}
 	
 	/* ------------------------------------------------------------ */
-	/** Is the bean joined to the aggregate.
-	 * @param bean
-	 * @return True if the aggregate contains the bean and it is joined
-	 */
-	public boolean isManaged(Object bean)
-	{
-		for (Bean b:_beans)
-			if (b._bean==bean)
-				return b._managed;
-		return false;
-	}
-	
-	/* ------------------------------------------------------------ */
 	/**
 	 * Add an associated bean.
 	 * If the bean is a {@link LifeCycle}, then it will be managed if it is not 
@@ -214,23 +201,8 @@
 	 */
 	public Collection<Object> getBeans()
 	{
-		return getBeans(Object.class);
-	}
-	
-	/* ------------------------------------------------------------ */
-	/** Get dependent beans of a specific class
-	 * @see #addBean(Object)
-	 * @param clazz
-	 * @return List of beans.
-	 */
-	public <T> List<T> getBeans(Class<T> clazz)
-	{
-		ArrayList<T> beans = new ArrayList<T>();
-		for (Bean b:_beans)
-		{
-			if (clazz.isInstance(b._bean))
-				beans.add((T)(b._bean));
-		}
+		List<Object> beans = new ArrayList<Object>();
+		beans.addAll(_beans);
 		return beans;
 	}
 
@@ -255,15 +227,6 @@
 	
 	/* ------------------------------------------------------------ */
 	/**
-	 * Remove all associated bean.
-	 */
-	public void removeBeans ()
-	{
-		_beans.clear();
-	}
-
-	/* ------------------------------------------------------------ */
-	/**
 	 * Remove an associated bean.
 	 */
 	public boolean removeBean (Object o)