Re: [jboss-user] [Beginner's Corner] - JBoss Supported Java Standards
by Peter Johnson
Peter Johnson [http://community.jboss.org/people/peterj] replied to the discussion
"JBoss Supported Java Standards"
To view the discussion, visit: http://community.jboss.org/message/554195#554195
--------------------------------------------------------------
1) Yes, and no. It means that the App Server must provide that functionality, whther it does so as part of the JVM or not is up to the App Server vendor. Example: Java EE 5 requires Java Util Logging; this logging is part of the JVM, whether the App Server provides funcionality around this or not is up to the vendor; JBoss AS 5.x recognizes Java Util Logging and redirects it to Log4J which performs the actual logging.
2) Yes the App Server must obey the JNDI SPI specifications. Typically, for this type of functionality, the JVM provides a rudimentary implementation that works just fine for a stand-alone app. The App Server will implement more robust funtionlaity to support multiple deployed apps and remote apps. So JBoss AS does not reply just on the JVM's JNDI implementation but rather provides its own (at least, that is my understanding- I haven't researched the JNDI code specifically, but I know, for instance, that my statements apply to RMI).
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/554195#554195]
Start a new discussion in Beginner's Corner at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 11 months
Re: [jboss-user] [JBoss Microcontainer Development POJO Server] - Implementing a non-flat deployment for Weld Integration
by Flavia Rainone
Flavia Rainone [http://community.jboss.org/people/flavia.rainone%40jboss.com] replied to the discussion
"Implementing a non-flat deployment for Weld Integration"
To view the discussion, visit: http://community.jboss.org/message/554183#554183
--------------------------------------------------------------
Making myself clearer.
> Flavia Rainone wrote:
>
> *public* BeanDeploymentArchive loadBeanDeploymentArchive(Class<?> beanClass)
> {
> // collection to mark the archives we have already searched
> Collection<Archive> searchedArchives = *new* HashSet<Archive>();
> // collection to mark the classpaths we have already searched
> Collection<Classpath> searchedClasspaths = *new* HashSet<Classpath>();
> // TODO -- why the search? beanClass' ClassLoader should be mapped to Archive?
> // need to throw an IllegalArgumentException if the Archive is not reachable from
> // the archives contained in the archives of this deployment
> Archive archive = findArchive(beanClass, archives, searchedArchives, searchedClasspaths);
> *if* (archive == *null*)
>
>
>
Currently, findArchive method, invoked by loadBeanDeploymentArchive as shown above, walks through the Archive graph in order to find an Archive associated with the requested beanClass (i.e., an Archive that is associated with the same ClassLoader that loaded beanClass).
If the Archive is not reachable in the graph, it means that we need to throw IllegalArgumentException.
Ales suggested to replace the findArchive call by a lookup in a ClassLoader -> Archive map. That way, all I would need to do is looking up for the archive that corresponds to the beanClass CL. This is faster than walking through the Archive graph, but I wouldn't be able to know whether the Archive is reachable from the current Deployment or not, so I wouldn't be able to throw the IllegalArgumentException to point that beanClass is not visible to the current Deployment.
Which way should I go? Should I forego the "is beanClass visible to this Deployment" check and follow Ales's suggestion, or should I keep things the way they are?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/554183#554183]
Start a new discussion in JBoss Microcontainer Development POJO Server at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 11 months