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;
}
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;
}
Aggregations