/** * Adds the specified {@link Application} to the {@link ApplicationGroup}. * * @param application the {@link Application} to add * * @throws IllegalStateException when the {@link ApplicationGroup} {@link #isClosed} */ public void addApplication(A application) { if (isClosed()) { throw new IllegalStateException("Can't add [" + application + "] as the " + this.getClass().getName() + " is closed"); } else { applications.add(application); } }
/** * Removes the specified {@link Application} to the {@link ApplicationGroup}. * * @param application the {@link Application} to remove * * @return <code>true</code> if the specified {@link Application} was removed * <code>false</code> otherwise * * @throws IllegalStateException when the {@link ApplicationGroup} {@link #isClosed} */ public boolean removeApplication(A application) { if (isClosed()) { throw new IllegalStateException("Can't add [" + application + "] as the " + this.getClass().getName() + " is closed"); } else { return applications.remove(application); } }