Can I write my own J2EE Container in J2EE AppServer

I am not sure this is the right forum but I think it is closest.

I have some questions regarding the containers of the J2EE AppServer.

1. Is it possible to host multiple containers in AppServer in one JVM?

2. Is it possible to develope my own container but follows the J2EE rules.

3. What is implication to system resources if there are multiple containers in one JVM?

4. Are there any articles explains these questions.

thanks

[480 byte] By [Sturgeon] at [2007-9-26 9:06:59]
# 1

> I am not sure this is the right forum but I think it

> is closest.

>

> I have some questions regarding the containers of the

> J2EE AppServer.

>

> 1. Is it possible to host multiple containers in

> AppServer in one JVM?

Lets say that this is possible just to help our thinking. If there are more than one container in AppServer in one JVM, then how is one going to differentiate between containers. All the containers will be abiding to the same interface. How can one get reference to classes of specific container. This is not possible. Hence I conclude that hosting multiple containers in AppServer in one JVM is not possible.

> 2. Is it possible to develope my own container but

> follows the J2EE rules.

Yes this is very much possible. You wiil have to go ahead and implement all the interfaces in javax.ejb.* package and also javax.ejb.spi.* package for EJB 2.0

> 3. What is implication to system resources if there

> are multiple containers in one JVM?

Well since the answer to question 1 is NO, this question does not hold true.

> 4. Are there any articles explains these questions.

Not that I know

AshwinP at 2007-7-1 20:13:26 > top of Java-index,Other Topics,Patterns & OO Design...
# 2

I think you should be able to run a second container in one JVM. Because logically it could be another thread. But to seperate it from the main container, JNDI should behave intelligently.

We can also make this container to listen on a different port and JNDI should be responsible for treating it differently.

But if you are treating it differently I dont see any advantage in having a different container. Instead you can have another server-container on a different JVM/machine. This might be useful incase of clusters.

As far as the user is concerned it doesnt care where the container is.

kotakishore at 2007-7-1 20:13:26 > top of Java-index,Other Topics,Patterns & OO Design...