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;
17:
18: import java.util.List;
19: import java.util.ArrayList;
20:
21: public class ProxyInfo {
22:
23: protected DeploymentInfo deploymentInfo;
24: protected Object primaryKey;
25: protected List<Class> proxyInterfaces;
26: protected RpcContainer beanContainer;
27: protected InterfaceType interfaceType;
28:
29: protected ProxyInfo() {
30: }
31:
32: public ProxyInfo(DeploymentInfo deploymentInfo, Object primaryKey,
33: List<Class> interfaces, InterfaceType proxyType) {
34: this .deploymentInfo = deploymentInfo;
35: this .primaryKey = primaryKey;
36: this .proxyInterfaces = interfaces;
37: this .interfaceType = proxyType;
38: this .beanContainer = (RpcContainer) deploymentInfo
39: .getContainer();
40: }
41:
42: /**
43: * This is the constructor that containers should call.
44: * Containers do not know the list of interfaces that should
45: * be applied nor do they need to tell the proxy handling
46: * code what kind of proxy it should create.
47: *
48: * @param depInfo
49: * @param pk
50: */
51: public ProxyInfo(DeploymentInfo depInfo, Object pk) {
52: this (depInfo, pk, new ArrayList<Class>(), InterfaceType.UNKNOWN);
53: }
54:
55: public InterfaceType getInterfaceType() {
56: return interfaceType;
57: }
58:
59: public DeploymentInfo getDeploymentInfo() {
60: return deploymentInfo;
61: }
62:
63: public Object getPrimaryKey() {
64: return primaryKey;
65: }
66:
67: public Class getInterface() {
68: return proxyInterfaces.get(0);
69: }
70:
71: public List<Class> getInterfaces() {
72: return proxyInterfaces;
73: }
74:
75: public RpcContainer getBeanContainer() {
76: return beanContainer;
77: }
78:
79: }
|