This content has been marked as final.
Show 3 replies
-
1. Re: Deployment.types not propagated
adrian.brock Nov 8, 2007 8:01 AM (in response to thomas.diesler)You're doing it wrong. :-)
The types shouldn't even be on the deployment (I agreed this with Scott before)
but it obviously hasn't been removed from the api yet. :-)
The types should be part of the ManagedObject stuff for the profile service
such that the console can sort the deployments into categories.
Instead, you should add a marker into the attachments of the deployment. -
2. Re: Deployment.types not propagated
thomas.diesler Nov 9, 2007 5:03 AM (in response to thomas.diesler)With the current API it seems the attachments that I get from
org.jboss.deployers.client.spi.Deployment.getPredeterminedManagedObjects()
are read only.
Please show me the correct usage of a client using attachments -
3. Re: Deployment.types not propagated
adrian.brock Nov 9, 2007 9:07 AM (in response to thomas.diesler)"thomas.diesler@jboss.com" wrote:
With the current API it seems the attachments that I get from
org.jboss.deployers.client.spi.Deployment.getPredeterminedManagedObjects()
are read only.
Please show me the correct usage of a client using attachments
They're not read-only in the implementations.
It's just that the Deployment interface assumes that they might be read only,
i.e. you could implement Deployment yourself in a way that the attachments
are immutable.
You can in fact downcast the Attachments to a MutableAttachments
in the provided implementations.MutableAttachments attachments = (MutableAttachments) deployment.getPredeterminedManagedObjects();
Or if you don't like the cast, you can create an
MutableAttachments yourself and set it on the deploymentVFSDeploymentFactory factory = new VFSDeploymentFactory(); VFSDeployment deployment = factory.createDeployment(virtualFile); MutableAttachments attachments = new AttachmentsImpl(); attachments.addAttachment("blah", serializable); deployment.setPredeterminedMangedObjects(myAttachments).
The latter is also method where you could replace AttachmentsImpl
with some form of immutable attachments implementation that loads
them using some other method.
e.g. the profile service might load them a database.