|
|||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| DirectConnector.java | 100% | 83.3% | 100% | 90% |
|
||||||||||||||
| 1 |
/*
|
|
| 2 |
* DirectConnector.java
|
|
| 3 |
* Copyright 2002-2004 Bill2, Inc.
|
|
| 4 |
*
|
|
| 5 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
| 6 |
* you may not use this file except in compliance with the License.
|
|
| 7 |
* You may obtain a copy of the License at
|
|
| 8 |
*
|
|
| 9 |
* 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 |
package org.dentaku.foundation.connector;
|
|
| 18 |
|
|
| 19 |
import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
|
|
| 20 |
import org.dentaku.services.container.ContainerManager;
|
|
| 21 |
import org.dentaku.services.exception.DentakuException;
|
|
| 22 |
|
|
| 23 |
public class DirectConnector extends ConnectorBase { |
|
| 24 |
private static DirectConnector ourInstance; |
|
| 25 |
private static ContainerManager containerManager; |
|
| 26 |
|
|
| 27 | 2 |
public static DirectConnector getInstance() throws DentakuException { |
| 28 | 2 |
if (ourInstance == null) { |
| 29 | 1 |
try {
|
| 30 | 1 |
containerManager = ContainerManager.getContainerManager(ConnectorBase.class.getResourceAsStream("ConnectorConfig.xml")); |
| 31 | 1 |
ourInstance = (DirectConnector)containerManager.lookup(Connector.ROLE); |
| 32 |
} catch (ComponentLookupException e) {
|
|
| 33 |
// how to test this?
|
|
| 34 | 0 |
throw new DentakuException(e); |
| 35 |
} |
|
| 36 |
} |
|
| 37 | 2 |
return ourInstance;
|
| 38 |
} |
|
| 39 |
|
|
| 40 | 3 |
public DirectConnector() {
|
| 41 |
} |
|
| 42 |
} |
|
| 43 |
|
|
||||||||||