01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: *
17: * $Header:$
18: */
19: package org.apache.beehive.controls.spi.bean;
20:
21: import org.apache.beehive.controls.api.bean.ControlBean;
22: import org.apache.beehive.controls.api.context.ControlBeanContext;
23: import org.apache.beehive.controls.api.properties.PropertyMap;
24:
25: /**
26: * The ControlFactory interface defines a service provider interface for integrating
27: * an external JavaBean instantation/configuration framework with the Controls runtime.
28: */
29: public interface ControlFactory {
30: /**
31: * Instantiates a new ControlBean of the requested class, using mechanisms provided
32: * by a provider-specific JavaBeans framework.
33: *
34: * @param beanClass the ControlBean class to instantiate
35: * @param props an initial set of client-specified properties to associate with the
36: * bean instance. May be null.
37: * @param context the containing ControlBeanContext for the bean, if nested inside of
38: * a container or other control. May be null to use the current active
39: * execution context.
40: * @param id the bean control ID. Must be unique within the containing context. If
41: * null, a unique identifier will be auto-generated.
42: * @return a new ControlBean instance of the requested class.
43: */
44: public <T extends ControlBean> T instantiate(Class<T> beanClass,
45: PropertyMap props, ControlBeanContext context, String id);
46: }
|