[Deployers on JBoss (Deployers/JBoss)] - Re: jee module's alt-dd
by alex.loubyansky@jboss.com
A bit more generalized, how does this look? The change that is in this example in the EjbParsingDeployer could probably be in the SchemaResolverDeployer?
Index: org/jboss/deployment/AppParsingDeployer.java
| + protected EarMetaData parse(VFSDeploymentUnit unit, VirtualFile file, EarMetaData root) throws Exception
| + {
| + EarMetaData ear = super.parse(unit,file, root);
| + List<DeploymentUnit> children = unit.getChildren();
| + if(children != null)
| + {
| + for(DeploymentUnit child : children)
| + {
| + String moduleName = child.getSimpleName();
| + ModuleMetaData module = ear.getModules().get(moduleName);
| + if(module != null && module.getAlternativeDD() != null)
| + {
| + VirtualFile altDDFile = unit.getRoot().getChild(module.getAlternativeDD());
| + if(altDDFile == null)
| + throw new IllegalStateException("Failed to locate alternative DD '" + module.getAlternativeDD() + "' in " + unit.getRoot().getPathName());
| + child.addAttachment(child.getSimpleName() + ".altDD", altDDFile);
| + log.info("attached alt-dd " + altDDFile + " for " + child.getSimpleName());
| + }
| + }
| + }
| +
| + return ear;
| + }
| }
| Index: org/jboss/deployment/EjbParsingDeployer.java
| @Override
| - protected void init(VFSDeploymentUnit unit, EjbJarMetaData metaData, VirtualFile file) throws Exception
| + protected EjbJarMetaData parse(VFSDeploymentUnit unit, VirtualFile file, EjbJarMetaData root) throws Exception
| {
| - super.init(unit, metaData, file);
| + VirtualFile altDDFile = (VirtualFile) unit.getAttachment(unit.getSimpleName() + ".altDD");
| + if(altDDFile != null)
| + {
| + log.info("using alt-dd: " + altDDFile);
| + file = altDDFile;
| + }
| + return super.parse(unit, file, root);
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4143431#4143431
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4143431
17 years, 12 months
[Design of EJB 3.0] - Re: JBAS-2408 - EJB3 / JCA integration
by adrian@jboss.org
"adrian(a)jboss.org" wrote :
| No. EJB3 is not the place for integration code. All EJB3 cares about is
| I want to activate an endpoint with
| * this callback
| * these activation config properties
| * some selection parameters to determine the rar, e.g. listener interface, rar name, etc.
|
i.e. there should be a jca spi in the jboss-integration that has something like:
| public interface EndpointActivationBus
| {
| EndpointActivation activate(Endpoint endpoint, Set<ActivationConfigProperties> properties, RarSelection selection);
| }
| public interface EndpointActivation
| {
| deactivate();
| }
|
| public interface Endpoint
| {
| boolean isDeliveryTransacted(Method);
| int getTransactionTimeout(Method);
| // etc.
| }
|
| public interface AOPEndpoint extends org.jboss.aop.Interceptor {}
| public interface JMXEndpoint extends org.jboss.invocation.Interceptor {}
|
| public interface RarSelection
| {
| String getRarName();
| Class<?> getListenerType();
| Map<String, String> getProperties(); // for some kind of fuzzy match based on rar config
| }
|
which we then implementation in JBossAS over the JCA metadata repository.
You can imagine alternate methods where the caller does more work upfront
if it knows a lot a about the rar, e.g.
| EndpointActivation activate(Endpoint endpoint, ActivationSpec spec);
|
the activation spec obviously determines the rar.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4143407#4143407
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4143407
17 years, 12 months
[Design of EJB 3.0] - Re: JBAS-2408 - EJB3 / JCA integration
by adrian@jboss.org
The correct fix for this is for JCA to provide an AbstractMessageEndpointFactory
and "MessageEndpointInterceptor" (you actually need two for the two different models
AOP or JMX, but they can share a lot of code).
All the EJB2/3/POJO containers should do is provide callbacks for
things like isDeliveryTransacted(Method), getTransactionTimeout(Method)
and the dispatch interceptor (i.e. invoke the ejb container or pojo).
This work is also tied up with the JCA metadata repository.
"jesper.pedersen" wrote :
| I can see two areas that would benefit the implementation:
|
| 1) The TODO in JBossMessageEndpointFactory::resolveResourceAdapter about the creation of the ObjectName for the RA - is this still valid ?
|
This should be replaced with the container passing the above mentioned callback
to the JCA metadata repository.
| 2) The use of JMSProviderAdapter in MessagingContainer which add a JAR dependency - we can just move this class to the ejb3 namespace
|
No. EJB3 is not the place for integration code. All EJB3 cares about is
I want to activate an endpoint with
* this callback
* these activation config properties
* some selection parameters to determine the rar, e.g. listener interface, rar name, etc.
There a lot of other threads about this with more details in either the JCA forum
and possibly the EJB3 or JMS forums?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4143406#4143406
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4143406
17 years, 12 months