[Design of EJB 3.0] - JndiInject and confused use of generics for polymorphism
by adrian@jboss.org
A number of tests were failing because the @JndiInject handler was commented out.
There are 43 references in the ejb3 testsuite.
This looks like a confused use of the generic parameter to try to do some type
of polymorphism, which obviously isn't supported since the type isn't even
available at runtime (well unless you use reflection and do it yourself :-).
I don't see why these classes should be generic?
Shouldn't all these take some jboss extension interface
to the spec defined Environment that both the
jboss ejb and interceptors metadata implement?
Relatedly, I don't understand why you cannot annotate interceptors
with @JndiInject?
Also, shouldn't all the annotations have equivalent xml,
e.g. DependsHandler doesn't look at the xml model at all,
there are only annotations???
I've reinstated the handler, but "fixed" the fact that it wants
JBossEnterpriseMetaData only with a hack that checks the type in loadXml()
| Index: src/main/org/jboss/injection/JndiInjectHandler.java
| ===================================================================
| --- src/main/org/jboss/injection/JndiInjectHandler.java (revision 66950)
| +++ src/main/org/jboss/injection/JndiInjectHandler.java (working copy)
| @@ -29,7 +29,10 @@
| import org.jboss.annotation.JndiInject;
| import org.jboss.logging.Logger;
| import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
| +import org.jboss.metadata.ejb.spec.EnterpriseBeanMetaData;
| import org.jboss.metadata.javaee.jboss.JndiRefMetaData;
| +import org.jboss.metadata.javaee.jboss.JndiRefsMetaData;
| +import org.jboss.metadata.javaee.spec.Environment;
|
| /**
| * Searches bean class for all @Inject and create Injectors
| @@ -37,7 +40,7 @@
| * @author <a href="mailto:bill@jboss.org">Bill Burke</a>
| * @version $Revision$
| */
| -public class JndiInjectHandler<X extends JBossEnterpriseBeanMetaData> implements InjectionHandler<X>
| +public class JndiInjectHandler<X extends Environment> implements InjectionHandler<X>
| {
| @SuppressWarnings("unused")
| private static final Logger log = Logger.getLogger(JndiInjectHandler.class);
| @@ -45,8 +48,10 @@
| public void loadXml(X xml, InjectionContainer container)
| {
| if (xml == null) return;
| - if (xml.getJndiRefs() == null) return;
| - for (JndiRefMetaData ref : xml.getJndiRefs())
| + if (xml instanceof JBossEnterpriseBeanMetaData == false) return;
| + JndiRefsMetaData jndiRefs = ((JBossEnterpriseBeanMetaData) xml).getJndiRefs();
| + if (jndiRefs == null) return;
| + for (JndiRefMetaData ref : jndiRefs)
| {
| if (ref.getMappedName() == null || ref.getMappedName().equals(""))
| throw new RuntimeException("mapped-name is required for " + ref.getJndiRefName() + " of container " + container.getIdentifier());
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4103847#4103847
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4103847
18 years, 4 months
[Design of JBossCache] - Re: Optimising contents of a prepare call - JBCACHE-611
by manik.surtani@jboss.com
Bringing this back up, since this is scheduled for inclusion in 2.2.0.
As a basic design, I think we should look at a consistent "replay" approach for both pessimistic and optimistic locking (rather than shipping the workspace deltas across for optimistic locking), so we can stick with a single TxInterceptor. Shipping the workspace across will require different TxInterceptor behaviour when receiving a prepare.
The actual approach could be quite simple - the TransactionEntry currently maintains a List of MethodCalls. This list is populated by TransactionEntry.addModification(MethodCall m).
This method could be modified to perform any compacting on the modification list at this time (if compacting is enabled).
Also, as a default, I think compacting *should* be enabled since most transactional calls would involve > 1 method invocation, and even if they didn't the compacting algorithm can only start compacting if there are, say, > 3 modifications at the time.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4103806#4103806
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4103806
18 years, 4 months
[Design of Clustering on JBoss (Clusters/JBoss)] - Re: Strange clustering behaviour when running testsuite offl
by adrian@jboss.org
"bstansberry(a)jboss.com" wrote : anonymous wrote : What's the difference? :-)
|
| Perhaps the setting for node0 in ejb3/local.properties? (Or testsuite/local.properties if running the main testsuite.)
|
| node0 is localhost, see jboss-head/ejb3/local.properties
|
|
| | #IMPORTANT:- Please do not check this file into CVS with your local changes
| | #This file is used to pass config info to targets like clustered-tests
| | #Please uncomment or add your properties to this file.
| |
| | #
| | # Both node0 and node1 properties are needed to run clustering tests.
| | # e.g., clustered-tests. Note that you will need to have two separate ips
| | # (even at the same machine). Actually what we needed are just node0 and node1
| | # ips and the rest are optional.
| | #
| | node0=127.0.0.1
| | #node0=${env.MYTESTIP_1}
| | #node0.http.url=http://192.168.1.103:8080
| | #node0.jndi.url=jnp://127.0.0.1:1099
| |
| | node1=${env.MYTESTIP_2}
| | #node1.http.url=http://192.168.1.113:8080
| | #node1.jndiurl=jnp://192.168.1.113:1099
| |
| | #Timeout for jboss to start
| | jboss.startup.timeout=120
| |
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4103755#4103755
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4103755
18 years, 4 months