FileDocCategorySizeDatePackage
BaseContainerBuilder.javaAPI DocGlassfish v2 API5154Fri May 04 22:33:00 BST 2007com.sun.ejb.containers.builder

BaseContainerBuilder

public abstract class BaseContainerBuilder extends Object
(Abstract)Base class for all ContainerBuilders
author
Mahesh Kannan

Fields Summary
protected static final Logger
_logger
protected com.sun.enterprise.deployment.EjbDescriptor
ejbDescriptor
protected ClassLoader
loader
protected com.sun.ejb.containers.BaseContainer
baseContainer
private byte[]
ipAddress
private int
port
Constructors Summary
public BaseContainerBuilder()


      
    
Methods Summary
protected abstract voidbuildComponents(com.sun.enterprise.config.ConfigContext dynamicConfigContext)

public final voidbuildContainer(com.sun.enterprise.deployment.EjbDescriptor ejbDescriptor, java.lang.ClassLoader loader, com.sun.enterprise.config.ConfigContext dynamicConfigContext)

	this.ejbDescriptor = ejbDescriptor;
	this.loader = loader;

	readDescriptor();

	baseContainer = createContainer(ejbDescriptor, loader); //abstract method
	buildComponents(dynamicConfigContext);  //abstract method
    
protected abstract com.sun.ejb.containers.BaseContainercreateContainer(com.sun.enterprise.deployment.EjbDescriptor ejbDescriptor, java.lang.ClassLoader loader)

public final com.sun.ejb.containers.BaseContainergetContainer()

	return baseContainer;
    
protected byte[]getIPAddress()

	return this.ipAddress;
    
protected intgetPort()

	return this.port;
    
public final voidpostInitialize(com.sun.enterprise.SecurityManager sm)

	//baseContainer.setSecurityManager(sm);

	boolean hasHome = !(ejbDescriptor instanceof EjbMessageBeanDescriptor);
	if (hasHome) {
	    //Currently BaseContainer.initializeHome is protected.
	    //baseContainer.initializeHome();
	}
    
private voidreadDescriptor()

	//FIXME: Read from domain.xml iiop-service ip-addr
	this.ipAddress = new byte[4];
	try {
	    this.ipAddress = InetAddress.getLocalHost().getAddress();
	} catch (Exception ex) {
	    long val = System.identityHashCode(ipAddress)
		+ System.currentTimeMillis();
	    Utility.longToBytes(val, this.ipAddress, 0);
	}

	//FIXME: Read from domain.xml
	this.port = 8080;