public void addDescriptor(Object newDescriptor) {
if(newDescriptor instanceof Servlet) {
descriptor.getSipApplication().
getSunSipDescriptor().addServlet((Servlet)newDescriptor);
} else if (newDescriptor instanceof EjbRef) {
EjbRef ejbRef = (EjbRef) newDescriptor;
descriptor.getSipApplication().
getSunSipDescriptor().addEjbRef(ejbRef);
try {
EjbReference ref = descriptor.getSipApplication().
getEjbReference(ejbRef.getEjbRefName());
// if ref is null i.e. @Ejb was used.
if(ref == null) {
ref = descriptor.getEjbReference(ejbRef.getEjbRefName());
}
ref.setJndiName(ejbRef.getJndiName());
} catch (IllegalArgumentException iae) {
DOLUtils.getDefaultLogger().warning(iae.getMessage());
}
} else if (newDescriptor instanceof ResourceRef) {
ResourceRef resourceRef = (ResourceRef) newDescriptor;