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.core;
17:
18: import org.apache.openejb.RpcContainer;
19: import org.apache.openejb.OpenEJBException;
20: import org.apache.openejb.ContainerType;
21: import org.apache.openejb.core.transaction.TransactionContainer;
22:
23: import java.lang.reflect.Method;
24:
25: public class RpcContainerWrapper implements RpcContainer,
26: TransactionContainer {
27:
28: private final RpcContainer container;
29:
30: public RpcContainerWrapper(RpcContainer container) {
31: this .container = container;
32: }
33:
34: public Object invoke(Object deployID, Method callMethod,
35: Object[] args, Object primKey, Object securityIdentity)
36: throws OpenEJBException {
37: return container.invoke(deployID, callMethod
38: .getDeclaringClass(), callMethod, args, primKey);
39: }
40:
41: public Object invoke(Object deployID, Class callInterface,
42: Method callMethod, Object[] args, Object primKey)
43: throws OpenEJBException {
44: return container.invoke(deployID, callInterface, callMethod,
45: args, primKey);
46: }
47:
48: public ContainerType getContainerType() {
49: return container.getContainerType();
50: }
51:
52: public Object getContainerID() {
53: return container.getContainerID();
54: }
55:
56: public org.apache.openejb.DeploymentInfo getDeploymentInfo(
57: Object deploymentID) {
58: return container.getDeploymentInfo(deploymentID);
59: }
60:
61: public org.apache.openejb.DeploymentInfo[] deployments() {
62: return container.deployments();
63: }
64:
65: public void deploy(org.apache.openejb.DeploymentInfo info)
66: throws OpenEJBException {
67: container.deploy(info);
68: }
69:
70: public void undeploy(org.apache.openejb.DeploymentInfo info)
71: throws OpenEJBException {
72: container.undeploy(info);
73: }
74:
75: public void discardInstance(Object instance, ThreadContext context) {
76: ((TransactionContainer) container).discardInstance(instance,
77: context);
78: }
79:
80: public RpcContainer getContainer() {
81: return container;
82: }
83:
84: }
|