Search in sources :

Example 1 with SecurityManager

use of com.sun.enterprise.security.SecurityManager in project Payara by payara.

the class SingletonContainerFactory method createContainer.

@Override
public Container createContainer(EjbDescriptor ejbDescriptor, ClassLoader loader, DeploymentContext deployContext) throws Exception {
    // hence we can always cast
    assert ejbDescriptor instanceof EjbSessionDescriptor;
    EjbSessionDescriptor sd = (EjbSessionDescriptor) ejbDescriptor;
    AbstractSingletonContainer container;
    SecurityManager sm = getSecurityManager(ejbDescriptor);
    if (sd.hasContainerManagedConcurrency()) {
        container = new CMCSingletonContainer(ejbDescriptor, loader, sm);
    } else {
        container = new BMCSingletonContainer(ejbDescriptor, loader, sm);
    }
    container.initializeHome();
    return container;
}
Also used : SecurityManager(com.sun.enterprise.security.SecurityManager) EjbSessionDescriptor(org.glassfish.ejb.deployment.descriptor.EjbSessionDescriptor)

Example 2 with SecurityManager

use of com.sun.enterprise.security.SecurityManager in project Payara by payara.

the class StatelessContainerFactory method createContainer.

@Override
public Container createContainer(EjbDescriptor ejbDescriptor, ClassLoader loader, DeploymentContext deployContext) throws Exception {
    SecurityManager sm = getSecurityManager(ejbDescriptor);
    StatelessSessionContainer slsbContainer = new StatelessSessionContainer(ejbDescriptor, loader, sm);
    slsbContainer.initializeHome();
    return slsbContainer;
}
Also used : SecurityManager(com.sun.enterprise.security.SecurityManager)

Example 3 with SecurityManager

use of com.sun.enterprise.security.SecurityManager in project Payara by payara.

the class EntityContainerFactory method createContainer.

public Container createContainer(EjbDescriptor ejbDescriptor, ClassLoader loader, DeploymentContext deployContext) throws Exception {
    EntityContainer container = null;
    SecurityManager sm = getSecurityManager(ejbDescriptor);
    // hence we can always cast
    assert ejbDescriptor instanceof EjbEntityDescriptor;
    if (((EjbEntityDescriptor) ejbDescriptor).getIASEjbExtraDescriptors().isIsReadOnlyBean()) {
        container = new ReadOnlyBeanContainer(ejbDescriptor, loader, sm);
    } else {
        String commitOption = null;
        IASEjbExtraDescriptors iased = ((EjbEntityDescriptor) ejbDescriptor).getIASEjbExtraDescriptors();
        if (iased != null) {
            commitOption = iased.getCommitOption();
        }
        if (commitOption == null) {
            commitOption = ejbContainerDesc.getCommitOption();
        }
        if (commitOption.equals("A")) {
            _logger.log(Level.WARNING, "entitybean.container.commit_option_A_not_supported", new Object[] { ejbDescriptor.getName() });
            container = new EntityContainer(ejbDescriptor, loader, sm);
        } else if (commitOption.equals("C")) {
            _logger.log(Level.FINE, "Using commit option C for: " + ejbDescriptor.getName());
            container = new CommitCEntityContainer(ejbDescriptor, loader, sm);
        } else {
            _logger.log(Level.FINE, "Using commit option B for: " + ejbDescriptor.getName());
            container = new EntityContainer(ejbDescriptor, loader, sm);
        }
    }
    container.initializeHome();
    return container;
}
Also used : EjbEntityDescriptor(org.glassfish.ejb.deployment.descriptor.EjbEntityDescriptor) SecurityManager(com.sun.enterprise.security.SecurityManager) IASEjbExtraDescriptors(org.glassfish.ejb.deployment.descriptor.runtime.IASEjbExtraDescriptors)

Example 4 with SecurityManager

use of com.sun.enterprise.security.SecurityManager in project Payara by payara.

the class MessageBeanContainerFactory method createContainer.

@Override
public Container createContainer(EjbDescriptor ejbDescriptor, ClassLoader loader, DeploymentContext deployContext) throws Exception {
    SecurityManager sm = getSecurityManager(ejbDescriptor);
    MessageBeanContainer mdbContainer = new MessageBeanContainer(ejbDescriptor, loader, sm);
    return mdbContainer;
}
Also used : SecurityManager(com.sun.enterprise.security.SecurityManager)

Example 5 with SecurityManager

use of com.sun.enterprise.security.SecurityManager in project Payara by payara.

the class ExpiredSessionsRemovalTask method createContainer.

@Override
public Container createContainer(EjbDescriptor ejbDescriptor, ClassLoader loader, DeploymentContext deployContext) throws Exception {
    this.ejbDescriptor = ejbDescriptor;
    // FIXME: Read from domain.xml iiop-service ip-addr
    byte[] ipAddress = new byte[4];
    try {
        ipAddress = InetAddress.getLocalHost().getAddress();
    } catch (Exception ex) {
        long val = System.identityHashCode(ipAddress) + System.currentTimeMillis();
        Utility.longToBytes(val, ipAddress, 0);
    }
    // FIXME: Read from domain.xml
    int port = 8080;
    cacheProps.init(ejbDescriptor);
    SecurityManager sm = getSecurityManager(ejbDescriptor);
    sfsbContainer = new StatefulSessionContainer(ejbDescriptor, loader, sm);
    buildComponents(ipAddress, port, deployContext);
    sfsbContainer.initializeHome();
    return sfsbContainer;
}
Also used : SecurityManager(com.sun.enterprise.security.SecurityManager) BackingStoreException(org.glassfish.ha.store.api.BackingStoreException)

Aggregations

SecurityManager (com.sun.enterprise.security.SecurityManager)5 EjbEntityDescriptor (org.glassfish.ejb.deployment.descriptor.EjbEntityDescriptor)1 EjbSessionDescriptor (org.glassfish.ejb.deployment.descriptor.EjbSessionDescriptor)1 IASEjbExtraDescriptors (org.glassfish.ejb.deployment.descriptor.runtime.IASEjbExtraDescriptors)1 BackingStoreException (org.glassfish.ha.store.api.BackingStoreException)1