Home » openejb-3.1.2-src » org.apache » openejb » [javadoc | source]

    1   /**
    2    * Licensed to the Apache Software Foundation (ASF) under one or more
    3    * contributor license agreements.  See the NOTICE file distributed with
    4    * this work for additional information regarding copyright ownership.
    5    * The ASF licenses this file to You under the Apache License, Version 2.0
    6    * (the "License"); you may not use this file except in compliance with
    7    * the License.  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.apache.openejb;
   18   
   19   import java.util.List;
   20   import java.util.ArrayList;
   21   
   22   public class ProxyInfo {
   23   
   24       protected DeploymentInfo deploymentInfo;
   25       protected Object primaryKey;
   26       protected List<Class> proxyInterfaces;
   27       protected RpcContainer beanContainer;
   28       protected InterfaceType interfaceType;
   29   
   30       protected ProxyInfo() {
   31       }
   32   
   33       public ProxyInfo(DeploymentInfo deploymentInfo, Object primaryKey, 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.getContainer();
   39       }
   40   
   41       /**
   42        * This is the constructor that containers should call.
   43        * Containers do not know the list of interfaces that should
   44        * be applied nor do they need to tell the proxy handling
   45        * code what kind of proxy it should create.
   46        * 
   47        * @param depInfo
   48        * @param pk
   49        */
   50       public ProxyInfo(DeploymentInfo depInfo, Object pk) {
   51           this(depInfo, pk, new ArrayList<Class>(), InterfaceType.UNKNOWN);
   52       }
   53   
   54       public InterfaceType getInterfaceType() {
   55           return interfaceType;
   56       }
   57   
   58       public DeploymentInfo getDeploymentInfo() {
   59           return deploymentInfo;
   60       }
   61   
   62       public Object getPrimaryKey() {
   63           return primaryKey;
   64       }
   65   
   66       public Class getInterface() {
   67           return proxyInterfaces.get(0);
   68       }
   69   
   70       public List<Class> getInterfaces() {
   71           return proxyInterfaces;
   72       }
   73   
   74       public RpcContainer getBeanContainer() {
   75           return beanContainer;
   76       }
   77   
   78   }

Home » openejb-3.1.2-src » org.apache » openejb » [javadoc | source]