Search in sources :

Example 1 with BusinessInterfaceDescriptor

use of org.jboss.weld.ejb.spi.BusinessInterfaceDescriptor in project Payara by payara.

the class EjbDescriptorImpl method getLocalBusinessInterfaces.

/**
 * Gets the local business interfaces of the EJB
 *
 * @return An iterator over the local business interfaces
 */
@Override
public Collection<BusinessInterfaceDescriptor<?>> getLocalBusinessInterfaces() {
    Set<BusinessInterfaceDescriptor<?>> localBusIntfs = new HashSet<BusinessInterfaceDescriptor<?>>();
    if (ejbDesc.getType().equals(EjbSessionDescriptor.TYPE)) {
        EjbSessionDescriptor sessionDesc = (EjbSessionDescriptor) ejbDesc;
        Set<String> localNames = sessionDesc.getLocalBusinessClassNames();
        // Include the no-interface Local view
        if (sessionDesc.isLocalBean()) {
            localNames.add(sessionDesc.getEjbClassName());
        }
        for (String local : localNames) {
            try {
                Class<?> localClass = sessionDesc.getEjbBundleDescriptor().getClassLoader().loadClass(local);
                @SuppressWarnings({ "rawtypes", "unchecked" }) BusinessInterfaceDescriptor<?> busIntfDesc = new BusinessInterfaceDescriptorImpl(localClass);
                localBusIntfs.add(busIntfDesc);
            } catch (ClassNotFoundException e) {
                throw new IllegalStateException(e);
            }
        }
    }
    return localBusIntfs;
}
Also used : BusinessInterfaceDescriptor(org.jboss.weld.ejb.spi.BusinessInterfaceDescriptor) EjbSessionDescriptor(com.sun.enterprise.deployment.EjbSessionDescriptor) HashSet(java.util.HashSet)

Example 2 with BusinessInterfaceDescriptor

use of org.jboss.weld.ejb.spi.BusinessInterfaceDescriptor in project Payara by payara.

the class EjbDescriptorImpl method getRemoteBusinessInterfaces.

@Override
public Collection<BusinessInterfaceDescriptor<?>> getRemoteBusinessInterfaces() {
    Set<BusinessInterfaceDescriptor<?>> remoteBusIntfs = new HashSet<BusinessInterfaceDescriptor<?>>();
    if (ejbDesc.getType().equals(EjbSessionDescriptor.TYPE)) {
        EjbSessionDescriptor sessionDesc = (EjbSessionDescriptor) ejbDesc;
        Set<String> remoteNames = sessionDesc.getRemoteBusinessClassNames();
        for (String remote : remoteNames) {
            try {
                Class<?> remoteClass = sessionDesc.getEjbBundleDescriptor().getClassLoader().loadClass(remote);
                @SuppressWarnings({ "rawtypes", "unchecked" }) BusinessInterfaceDescriptor<?> busIntfDesc = new BusinessInterfaceDescriptorImpl(remoteClass);
                remoteBusIntfs.add(busIntfDesc);
            } catch (ClassNotFoundException e) {
                throw new IllegalStateException(e);
            }
        }
    }
    return remoteBusIntfs;
}
Also used : BusinessInterfaceDescriptor(org.jboss.weld.ejb.spi.BusinessInterfaceDescriptor) EjbSessionDescriptor(com.sun.enterprise.deployment.EjbSessionDescriptor) HashSet(java.util.HashSet)

Aggregations

EjbSessionDescriptor (com.sun.enterprise.deployment.EjbSessionDescriptor)2 HashSet (java.util.HashSet)2 BusinessInterfaceDescriptor (org.jboss.weld.ejb.spi.BusinessInterfaceDescriptor)2