[Design of Embedded JBoss] - AS Branch_5_x now booting in Embedded
by ALRubinger
With a bunch of the requisite bootstrap refactoring done, I've moved into making an Embedded booter for AS. At the same time, I'm prototyping some APIs for virtual (declarative, VFS-backed) deployments much like Bill did in "DeploymentGroup" of the old Embedded.
The issue of the day is: https://jira.jboss.org/jira/browse/EMB-32
So AS now is running in what I call "Mode 1", which is backed by a true filesystem installation. The API looks like:
final JBossASEmbeddedServer server = new JBossASEmbeddedServerImpl();
| server.start();
There's also a single-arg constructor which will accept a JBOSS_HOME. In the no-arg form we look for environment variable "JBOSS_HOME" or system property "jboss.home".
Then we can make a deployment:
final String name = "testDeployment.jar";
| final VirtualVfsArchive deployment = new VirtualVfsArchiveImpl(name).addClasses(OutputBean.class,
| OutputLocalBusiness.class);
| log.info(deployment.toString(true));
The "toString(true)" is a verbose form which aids in debugging the virtual deployment, printing out something similar to:
23:35:47,852 INFO [ServerTestCase] MemoryContextHandler@324589909[path= context=vfsmemory://testDeployment.jar real=vfsmemory://testDeployment.jar]
| - 0 bytes
| org - 0 bytes
| org/jboss - 0 bytes
| org/jboss/embedded - 0 bytes
| org/jboss/embedded/testsuite - 0 bytes
| org/jboss/embedded/testsuite/fulldep - 0 bytes
| org/jboss/embedded/testsuite/fulldep/ejb3 - 0 bytes
| org/jboss/embedded/testsuite/fulldep/ejb3/slsb - 0 bytes
| org/jboss/embedded/testsuite/fulldep/ejb3/slsb/OutputBean.class - 844 bytes
| org/jboss/embedded/testsuite/fulldep/ejb3/slsb/OutputLocalBusiness.class - 312 bytes
Then we deploy and test:
server.deploy(deployment);
| final OutputLocalBusiness bean = (OutputLocalBusiness) new InitialContext().lookup(OutputBean.class
| .getSimpleName()
| + "/local");;
| final String output = bean.getOutput();
| log.info("Got output: " + output);
| Assert.assertEquals(OutputLocalBusiness.OUTPUT, output);
This test is now turning green. So we can say that Embedded is showing some signs of life, and the bootstrap refactoring is starting to pay off.
The phase of development I'm in now is building out the virtual archive APIs. I want tests that show Servlets, JMS, SLSB, SFSB, JCA, etc all working in this mode. And even further we need finer-grained unit tests which are currently absent in the Embedded source tree (it's all integration thus far).
Wiki documentation to be forthcoming, but in the interim anyone who wants to be involved should ping me directly.
http://anonsvn.jboss.org/repos/jbossas/projects/embedded/trunk/testsuite-...
S,
ALR
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4242750#4242750
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4242750
16 years, 9 months
[Design of JBossXB] - Re: Referencing the bean-deployer namespace from a custom me
by david.lloyd@jboss.com
"alex.loubyansky(a)jboss.com" wrote : anonymous wrote : So maybe it's treating the outer choice as maxOccurs=1 or something?
|
| Yes, of course. And IMO that's how it should be. Otherwise, the structures of the bound components/types in Java and XSD are inconsistent. Why don't you use a sequence? What problem does it cause in this case?
The problem is that it prevents the user from putting the element in any order. In the schema, all the elements listed in this class are in one "choice"; the only reason they're grouped as they are here is because that's how they're mapped in terms of Java types. So the effect I'm really going for is to have XB take all the XmlElement instances in the class and make one big "choice" out of it with maxOccurs=unbounded.
anonymous wrote : I have my root element set up to be propOrder={} and modelgroup=CHOICE.
If you bind to a choice then propOrder should be removed. propOrder={} is supposed to bind to all.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4242733#4242733
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4242733
16 years, 9 months