use of com.sun.enterprise.deployment.EjbDescriptor in project Payara by payara.
the class MessageNode method setMiscDescriptors.
private void setMiscDescriptors() {
XMLNode<?> parentNode = getParentNode().getParentNode().getParentNode();
// Get the endpoint or portinfo descriptor
Object parentDesc = parentNode.getDescriptor();
if (parentDesc instanceof ServiceRefPortInfo) {
descriptor.setServiceRefPortInfo((ServiceRefPortInfo) parentDesc);
} else if (parentDesc instanceof WebServiceEndpoint) {
descriptor.setWebServiceEndpoint((WebServiceEndpoint) parentDesc);
}
// Get the bundle descriptor of which this belongs
BundleDescriptor bundleDescriptor = null;
parentNode = parentNode.getParentNode().getParentNode();
if (parentNode.getDescriptor() instanceof WebBundleDescriptor) {
// In the cases of used in
// 1. webservice-endpoint for web component
// 2. port-info for web component
bundleDescriptor = (WebBundleDescriptor) parentNode.getDescriptor();
} else if (parentNode.getDescriptor() instanceof BundleDescriptor) {
// In the cases of used in port-info for app client
bundleDescriptor = (BundleDescriptor) parentNode.getDescriptor();
} else {
// In the case of used in webservice-endpoint for ejb component
if (parentNode.getDescriptor() instanceof EjbDescriptor) {
EjbDescriptor ejbDesc = (EjbDescriptor) parentNode.getDescriptor();
bundleDescriptor = ejbDesc.getEjbBundleDescriptor();
} else {
// In the case of used in port-info for ejb component
parentNode = parentNode.getParentNode();
if (parentNode.getDescriptor() instanceof EjbDescriptor) {
EjbDescriptor ejbDesc = (EjbDescriptor) parentNode.getDescriptor();
bundleDescriptor = ejbDesc.getEjbBundleDescriptor();
}
}
}
descriptor.setBundleDescriptor(bundleDescriptor);
}
use of com.sun.enterprise.deployment.EjbDescriptor in project Payara by payara.
the class RuntimeTimerState method getTimedObjectApplicationName.
String getTimedObjectApplicationName() {
EjbDescriptor ejbDesc = container_.getEjbDescriptor();
Application app = ejbDesc.getApplication();
return (app != null) ? app.getRegistrationName() : "";
}
use of com.sun.enterprise.deployment.EjbDescriptor in project Payara by payara.
the class AbstractSessionContextImpl method getBusinessObject.
@Override
public <T> T getBusinessObject(Class<T> businessInterface) throws IllegalStateException {
// until after dependency injection
if (getInstanceKey() == null) {
throw new IllegalStateException("Operation not allowed");
}
T businessObject = null;
EjbDescriptor ejbDesc = container.getEjbDescriptor();
if (businessInterface != null) {
String intfName = businessInterface.getName();
if (//
ejbLocalBusinessObjectImpl != null && ejbDesc.getLocalBusinessClassNames().contains(intfName)) {
// Get proxy corresponding to this business interface.
businessObject = (T) ejbLocalBusinessObjectImpl.getClientObject(intfName);
} else if (ejbRemoteBusinessObjectImpl != null && ejbDesc.getRemoteBusinessClassNames().contains(intfName)) {
// Create a new client object from the stub for this
// business interface.
String generatedIntf = EJBUtils.getGeneratedRemoteIntfName(intfName);
java.rmi.Remote stub = ejbRemoteBusinessObjectImpl.getStub(generatedIntf);
try {
businessObject = (T) //
EJBUtils.createRemoteBusinessObject(container.getClassLoader(), intfName, stub);
} catch (Exception e) {
throw new IllegalStateException("Error creating remote business object for " + intfName, e);
}
} else if (ejbDesc.isLocalBean() && intfName.equals(ejbDesc.getEjbClassName())) {
businessObject = (T) optionalEjbLocalBusinessObjectImpl.getClientObject(ejbDesc.getEjbClassName());
}
}
if (businessObject == null) {
throw new IllegalStateException("Invalid business interface : " + businessInterface + " for ejb " + ejbDesc.getName());
}
return businessObject;
}
use of com.sun.enterprise.deployment.EjbDescriptor in project Payara by payara.
the class StaticRmiStubGenerator method getStubClasses.
private Set<String> getStubClasses(ClassLoader jcl, EjbBundleDescriptor ejbBundle) throws IOException, ClassNotFoundException {
Set<String> stubClasses = new HashSet<String>();
for (Iterator iter = ejbBundle.getEjbs().iterator(); iter.hasNext(); ) {
EjbDescriptor desc = (EjbDescriptor) iter.next();
if (desc.isRemoteInterfacesSupported()) {
String home = desc.getHomeClassName();
String remote = desc.getRemoteClassName();
stubClasses.add(home);
Set homeSuperIntfs = getRemoteSuperInterfaces(jcl, home);
stubClasses.addAll(homeSuperIntfs);
stubClasses.add(remote);
Set remoteSuperIntfs = getRemoteSuperInterfaces(jcl, remote);
stubClasses.addAll(remoteSuperIntfs);
}
}
return stubClasses;
}
use of com.sun.enterprise.deployment.EjbDescriptor in project Payara by payara.
the class LifecycleCallbackNode method getDescriptor.
@Override
public LifecycleCallbackDescriptor getDescriptor() {
if (descriptor == null) {
descriptor = new LifecycleCallbackDescriptor();
Descriptor parentDesc = (Descriptor) getParentNode().getDescriptor();
if (parentDesc instanceof EjbDescriptor) {
EjbDescriptor ejbDesc = (EjbDescriptor) parentDesc;
descriptor.setDefaultLifecycleCallbackClass(ejbDesc.getEjbClassName());
} else if (parentDesc instanceof EjbInterceptor) {
EjbInterceptor ejbInterceptor = (EjbInterceptor) parentDesc;
descriptor.setDefaultLifecycleCallbackClass(ejbInterceptor.getInterceptorClassName());
}
// we set the default lifecycle callback class for appclient
// later in validate since the appclient Main class is not
// available at this point
}
return descriptor;
}
Aggregations