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: */package org.apache.openejb.assembler.classic;
17:
18: import org.apache.openejb.OpenEJBException;
19: import org.apache.openejb.util.Messages;
20: import org.apache.openejb.util.SafeToolkit;
21: import org.apache.openejb.util.proxy.ProxyFactory;
22:
23: import javax.transaction.TransactionManager;
24: import java.lang.reflect.Method;
25: import java.util.HashMap;
26: import java.util.Properties;
27: import java.util.List;
28: import java.util.Map;
29:
30: public class AssemblerTool {
31:
32: public static final Map<String, Class> serviceInterfaces = new HashMap<String, Class>();
33: static {
34: serviceInterfaces.put("ProxyFactory", ProxyFactory.class);
35: serviceInterfaces.put("SecurityService",
36: org.apache.openejb.spi.SecurityService.class);
37: serviceInterfaces.put("TransactionManager",
38: TransactionManager.class);
39: serviceInterfaces.put("ConnectionManager",
40: javax.resource.spi.ConnectionManager.class);
41: serviceInterfaces.put("Connector",
42: javax.resource.spi.ManagedConnectionFactory.class);
43: serviceInterfaces.put("Resource",
44: javax.resource.spi.ResourceAdapter.class);
45: serviceInterfaces.put("Container",
46: org.apache.openejb.Container.class);
47: }
48:
49: protected static final Messages messages = new Messages(
50: "org.apache.openejb.util.resources");
51: protected static final SafeToolkit toolkit = SafeToolkit
52: .getToolkit("AssemblerTool");
53:
54: protected Properties props = new Properties();
55:
56: static {
57: System.setProperty("noBanner", "true");
58: }
59:
60: protected static void checkImplementation(Class intrfce,
61: Class factory, String serviceType, String serviceName)
62: throws OpenEJBException {
63: if (!intrfce.isAssignableFrom(factory)) {
64: throw new OpenEJBException(messages.format("init.0100",
65: serviceType, serviceName, factory.getName(),
66: intrfce.getName()));
67: }
68: }
69:
70: }
|