|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
BeanFactoryBuilder.java | - | 100% | 100% | 100% |
|
1 |
// Copyright 2004 The Apache Software Foundation
|
|
2 |
//
|
|
3 |
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4 |
// you may not use this file except in compliance with the License.
|
|
5 |
// You may obtain a copy of the License at
|
|
6 |
//
|
|
7 |
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8 |
//
|
|
9 |
// Unless required by applicable law or agreed to in writing, software
|
|
10 |
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11 |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12 |
// See the License for the specific language governing permissions and
|
|
13 |
// limitations under the License.
|
|
14 |
|
|
15 |
package org.apache.hivemind.lib.factory;
|
|
16 |
|
|
17 |
import java.util.List;
|
|
18 |
|
|
19 |
import org.apache.commons.logging.Log;
|
|
20 |
import org.apache.hivemind.ErrorHandler;
|
|
21 |
import org.apache.hivemind.ServiceImplementationFactory;
|
|
22 |
import org.apache.hivemind.impl.BaseLocatable;
|
|
23 |
import org.apache.hivemind.internal.Module;
|
|
24 |
|
|
25 |
/**
|
|
26 |
* Service implementation factory that builds {@link org.apache.hivemind.lib.BeanFactory}
|
|
27 |
* instances.
|
|
28 |
*
|
|
29 |
* @author Howard Lewis Ship
|
|
30 |
*/
|
|
31 |
public class BeanFactoryBuilder extends BaseLocatable implements ServiceImplementationFactory |
|
32 |
{ |
|
33 |
private ErrorHandler _errorHandler;
|
|
34 |
|
|
35 | 2 |
public Object createCoreServiceImplementation(
|
36 |
String serviceId, |
|
37 |
Class serviceInterface, |
|
38 |
Log serviceLog, |
|
39 |
Module invokingModule, |
|
40 |
List parameters) |
|
41 |
{ |
|
42 | 2 |
BeanFactoryParameter p = (BeanFactoryParameter) parameters.get(0); |
43 |
|
|
44 | 2 |
return new BeanFactoryImpl( |
45 |
serviceLog, |
|
46 |
_errorHandler, |
|
47 |
p.getVendClass(), |
|
48 |
p.getContributions(), |
|
49 |
p.getDefaultCacheable()); |
|
50 |
} |
|
51 |
|
|
52 | 1 |
public void setErrorHandler(ErrorHandler handler) |
53 |
{ |
|
54 | 1 |
_errorHandler = handler; |
55 |
} |
|
56 |
} |
|
57 |
|
|