2 * This is a utility project for wide range of applications
4 * Copyright (C) 8 Imran M Yousuf (imyousuf@smartitengineering.com)
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 3 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 10-1 USA
18 package com
.smartitengineering
.util
.bean
;
21 * A Generic read-only bean factory, for registration and injection purpose.
25 public interface BeanFactory
{
28 * Checks whether the bean is available in the factory of not.
29 * @param beanName Name of the bean to search with
30 * @return True iff there is a bean in this name
31 * @throws java.lang.IllegalArgumentException If beanName is blank
33 public boolean containsBean(String beanName
)
34 throws IllegalArgumentException
;
37 * Retrieves the bean iff it exists.
38 * @param beanName Name of the bean to retrieve
39 * @return The bean with the specified name
40 * @throws java.lang.IllegalArgumentException if beanName is blank or if
41 * there exists no such bean,
42 * i.e., containsBean is false
44 public Object
getBean(String beanName
)
45 throws IllegalArgumentException
;