Package org.apache.openejb

Examples of org.apache.openejb.InterfaceType


            }
        }
    }

    public InterfaceType getInterfaceType(Class clazz) {
        InterfaceType type = interfaces.get(clazz);
        if (type != null) return type;

        if (javax.ejb.EJBLocalHome.class.isAssignableFrom(clazz)) return InterfaceType.EJB_LOCAL_HOME;
        if (javax.ejb.EJBLocalObject.class.isAssignableFrom(clazz)) return InterfaceType.EJB_LOCAL;
        if (javax.ejb.EJBHome.class.isAssignableFrom(clazz)) return InterfaceType.EJB_HOME;
View Full Code Here


        this.interfaceType = interfaceType;
        this.primaryKey = pk;
        this.setDeploymentInfo((CoreDeploymentInfo) deploymentInfo);

        if (interfaces == null || interfaces.size() == 0) {
            InterfaceType objectInterfaceType = (interfaceType.isHome()) ? interfaceType.getCounterpart() : interfaceType;
            interfaces = new ArrayList<Class>(deploymentInfo.getInterfaces(objectInterfaceType));
        }

        this.setDoIntraVmCopy(!interfaceType.isLocal());
View Full Code Here

    }

    public Object createProxy(Object primaryKey) {
        try {

            InterfaceType objectInterfaceType = this.interfaceType.getCounterpart();

            EjbObjectProxyHandler handler = newEjbObjectHandler(getDeploymentInfo(), primaryKey, objectInterfaceType, this.getInterfaces());

            List<Class> proxyInterfaces = new ArrayList<Class>(handler.getInterfaces().size() + 1);
View Full Code Here

        if (deploymentInfo == null) {
            String message = messages.format("deploymentNotFound", info.getName(), deploymentId);
            throw new NameNotFoundException(message);
        }

        InterfaceType type = null;
        switch (info.getRefType()){
            case LOCAL: type = InterfaceType.BUSINESS_LOCAL; break;
            case REMOTE: type = InterfaceType.BUSINESS_REMOTE; break;
        }
View Full Code Here

    @Override
    public Object resolve(final EJBHomeHandler handler) {
        try {
            final EJBMetaDataImpl ejb = handler.getEjb();

            final InterfaceType interfaceType = (ejb.getRemoteInterfaceClass() == null) ? InterfaceType.BUSINESS_REMOTE_HOME : InterfaceType.EJB_HOME;

            final ArrayList<Class> interfaces = new ArrayList<Class>();
            if (interfaceType.isBusiness()) {
                interfaces.addAll(ejb.getBusinessClasses());
            } else {
                interfaces.add(ejb.getRemoteInterfaceClass());
            }
View Full Code Here

    @Override
    public Object resolve(final EJBObjectHandler handler) {
        try {
            final EJBMetaDataImpl ejb = handler.getEjb();

            final InterfaceType interfaceType = (ejb.getRemoteInterfaceClass() == null) ? InterfaceType.BUSINESS_REMOTE_HOME : InterfaceType.EJB_HOME;

            final ArrayList<Class> interfaces = new ArrayList<Class>();
            if (interfaceType.isBusiness()) {
                interfaces.addAll(ejb.getBusinessClasses());
            } else {
                interfaces.add(ejb.getRemoteInterfaceClass());
            }
View Full Code Here

        }

        final ThreadContext threadContext = ThreadContext.getThreadContext();
        final BeanContext di = threadContext.getBeanContext();

        final InterfaceType interfaceType = di.getInterfaceType(interfce);
        final BeanType type = di.getComponentType();

        if (interfaceType == null) {
            throw new IllegalStateException("Component has no such interface: " + interfce.getName());
        }

        if (!interfaceType.isBusiness()) {
            throw new IllegalStateException("Interface is not a business interface for this bean: " + interfce.getName());
        }

        try {
            final EjbObjectProxyHandler handler;
View Full Code Here

    public Class getInvokedBusinessInterface() {
        doCheck(Call.getInvokedBusinessInterface);
        final ThreadContext threadContext = ThreadContext.getThreadContext();
        final Class invokedInterface = threadContext.getInvokedInterface();
        final InterfaceType type = threadContext.getBeanContext().getInterfaceType(invokedInterface);
        if (!type.isBusiness()) {
            throw new IllegalStateException("The EJB spec requires us to cripple the use of this method for anything but business interface proxy.  But FYI, your invoked interface is: " + invokedInterface.getName());
        }

        if (invokedInterface == null) {
            throw new IllegalStateException("Business interface not set into ThreadContext.");
View Full Code Here

                final BeanContext beanContext = cdiEjbBean.getBeanContext();
                final Provider provider = webBeansContext.getNormalScopeProxyFactory().getInstanceProvider(beanContext.getClassLoader(), cdiEjbBean);

                if (!beanContext.isLocalbean()) {
                    final List<Class> interfaces = new ArrayList<Class>();
                    final InterfaceType type = beanContext.getInterfaceType(interfce);
                    if (type != null) {
                        interfaces.addAll(beanContext.getInterfaces(type));
                    } else { // can happen when looked up from impl instead of API in OWB -> default to business local
                        interfaces.addAll(beanContext.getInterfaces(InterfaceType.BUSINESS_LOCAL));
                    }
View Full Code Here

        if (beanContext == null) {
            final String message = messages.format("deploymentNotFound", info.getName(), deploymentId);
            throw new NameNotFoundException(message);
        }

        InterfaceType type = null;
        switch (info.getRefType()) {
            case LOCAL:
                type = InterfaceType.BUSINESS_LOCAL;
                break;
            case REMOTE:
View Full Code Here

TOP

Related Classes of org.apache.openejb.InterfaceType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.