[jboss-dev] Deployment chains
Adrian Brock
abrock at redhat.com
Mon Oct 6 16:44:04 EDT 2008
On Mon, 2008-10-06 at 22:23 +0200, Ales Justin wrote:
> What about that discussion you had with Carlo,
> about porting the component visitor?
>
It's not exactly a high priority.
Fixing the PersistenceDeployer to specifiy that it outputs
PersistenceUnitMetaData is. :-)
> Although I must say I didn't fully understand that discussion :-)
> as to what is currently missing in AbstractComponentDeployer.
>
I don't understand it either.
Why setComponentVisitor() didn't work for him
is a mystery that remains unresolved, it clearly works
for the MC beans and JMX services?
So there's something different or it is too easy
to it wrong. :-)
The class in question is this one:
http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/projects/jpa/trunk/deployers/src/main/java/org/jboss/jpa/deployers/AbstractDeploymentVisitor.java?revision=75431&view=markup
It obviously has nothing to do with JPA.
It's a useful abstraction so it belongs as a
deployers helper class.
It is similar to BeanMetaDataFactoryVisitor
except it only deals with the boiler plate by
adding a getName() callback.
There's a FIXME
// TODO: determine proper component meta data class
component.addAttachment(componentMD.getClass().getName(), componentMD);
Which needs to be resolved by having the subclass pass the actual component
class in the constructor, for correct use of generics.
public AbstractComponentVisitor(Class<C> componentType)
{
this.componentType = componentType;
}
component.addAttachment(componentType, componentMD);
Although if you are going to allow subclasses of C, then
the collections need fixing to be for example
List<? extends C>
> An abstract component visitor?
> To relieve you of this code?
>
> protected static void addXComponent(DeploymentUnit unit, X x)
> {
> DeploymentUnit component = unit.addComponent(getComponentName(x));
> component.addAttachment(getAttachmentName(), x);
> }
>
> protected static void removeAliasComponent(DeploymentUnit unit, X x)
> {
> unit.removeComponent(getComponentName(x));
> }
>
> Adrian Brock wrote:
> > You can release it as is.
> > More management stuff can be added required.
> >
> > The stuff I've done so far, was just so I could
> > easily see what the deployers were actually doing
> > for this task:
> > https://jira.jboss.org/jira/browse/JBAS-5044
> >
> > I dare say Scott may have other requirements
> > when he gets chance to review it.
--
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Adrian Brock
Chief Scientist
JBoss, a division of Red Hat
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
More information about the jboss-development
mailing list