
org.apache.webbeans.ejb.common.proxy.EjbBeanProxyHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of openwebbeans-ejb-common Show documentation
Show all versions of openwebbeans-ejb-common Show documentation
OpenWebBeans Java EE EJB Utility
The newest version!
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.webbeans.ejb.common.proxy;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.lang.reflect.Method;
import java.util.List;
import javax.enterprise.context.Dependent;
import javax.enterprise.context.spi.Context;
import javax.enterprise.context.spi.Contextual;
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.SessionBeanType;
import org.apache.webbeans.component.OwbBean;
import org.apache.webbeans.config.OWBLogConst;
import org.apache.webbeans.container.BeanManagerImpl;
import org.apache.webbeans.context.AbstractContext;
import org.apache.webbeans.context.creational.CreationalContextFactory;
import org.apache.webbeans.ejb.common.component.BaseEjbBean;
import org.apache.webbeans.ejb.common.interceptor.OpenWebBeansEjbInterceptor;
import org.apache.webbeans.logger.WebBeansLogger;
import org.apache.webbeans.util.ClassUtil;
import org.apache.webbeans.util.SecurityUtil;
import org.apache.webbeans.util.WebBeansUtil;
import javassist.util.proxy.MethodHandler;
/**
* EJB beans proxy handler.
* @version $Rev: 889852 $ $Date: 2009-12-12 01:11:53 +0200 (Sat, 12 Dec 2009) $
*
*/
@SuppressWarnings("unchecked")
public class EjbBeanProxyHandler implements MethodHandler
{
//Logger instance
private final WebBeansLogger logger = WebBeansLogger.getLogger(EjbBeanProxyHandler.class);
/**Proxy ejb bean instance*/
private BaseEjbBean> ejbBean;
/**Dependent ejb instance*/
private Object dependentEJB;
/**Scope is dependent*/
private boolean isDependent = false;
/**Creational Context*/
private CreationalContext> creationalContext;
/**
* Creates a new instance.
* @param ejbBean ejb bean instance
*/
public EjbBeanProxyHandler(BaseEjbBean> ejbBean, CreationalContext> creationalContext)
{
this.ejbBean = ejbBean;
if(WebBeansUtil.isScopeTypeNormal(ejbBean.getScope()))
{
initiateBeanBag((OwbBean
© 2015 - 2025 Weber Informatics LLC | Privacy Policy