String modulename = "";
//TODO com.sun.enterprise.util.io.FileUtils.makeFriendlyFilename(archiveuri);
String ejbname = ejbDescriptor.getName();
IASEjbExtraDescriptors iased = null;
try {
// instantiate container class
if (ejbDescriptor instanceof EjbSessionDescriptor) {
EjbSessionDescriptor sd = (EjbSessionDescriptor)ejbDescriptor;
if ( sd.isStateless() ) {
if ((ejbDescriptor.getLocalClassName() != null) &&
(ejbDescriptor.getLocalBusinessClassNames()
.contains("com.sun.ejb.containers.TimerLocal"))) {
container = new TimerBeanContainer(ejbDescriptor, loader);
} else {
container = new StatelessSessionContainer(ejbDescriptor, loader);
}
} else if( sd.isStateful() ) {
StatefulContainerBuilder sfsbBuilder = habitat.getComponent(
StatefulContainerBuilder.class);
sfsbBuilder.buildContainer(dynamicConfigContext, ejbDescriptor, loader);
container = sfsbBuilder.getContainer();
} else {
if (sd.hasContainerManagedConcurrency() ) {
container = new CMCSingletonContainer(ejbDescriptor, loader);
} else {
container = new BMCSingletonContainer(ejbDescriptor, loader);
}
}
} else if ( ejbDescriptor instanceof EjbMessageBeanDescriptor) {
container = new MessageBeanContainer(ejbDescriptor, loader);
} else {
if (((EjbEntityDescriptor)ejbDescriptor).getIASEjbExtraDescriptors()
.isIsReadOnlyBean()) {
EjbEntityDescriptor robDesc = (EjbEntityDescriptor) ejbDescriptor;
container = new ReadOnlyBeanContainer (ejbDescriptor, loader);
} else {
if ((ejbDescriptor.getLocalHomeClassName() != null) &&
(ejbDescriptor.getLocalHomeClassName()
.equals("com.sun.ejb.containers.TimerLocalHome"))) {
container = new TimerBeanContainer(ejbDescriptor, loader);
} else {
String commitOption = null;
iased = ((EjbEntityDescriptor)ejbDescriptor).
getIASEjbExtraDescriptors();
if (iased != null) {
commitOption = iased.getCommitOption();
}
if (commitOption == null) {
commitOption = ejbContainerDesc.getCommitOption();
}
if (commitOption.equals("A")) {