This content has been marked as final.
Show 4 replies
-
1. Re: unit.getAttachment(Class type) returning null
anil.saldhana Apr 24, 2007 12:45 AM (in response to anil.saldhana)I can get them by name which does not always serve the purpose.
Or do I need to do the following:
unit.getDeploymentContext.getTransientAttachment(....) -
2. Re: unit.getAttachment(Class type) returning null
anil.saldhana Apr 24, 2007 1:31 AM (in response to anil.saldhana)I think the call to unit.getAttachment(Class) works only if the attachment has been added to the unit without any name, because of the following pattern in AS trunk:
// The ServiceConstructorMetaData is not serializable due to its args unit.addAttachment(ServiceMetaData.class, webModule); .... // Get the war URL WebMetaData metaData = di.getAttachment(WebMetaData.class);
-
3. Re: unit.getAttachment(Class type) returning null
starksm64 Apr 24, 2007 1:49 AM (in response to anil.saldhana)The getAttachment(class) call walks through the various type of attachments. What deployment is not showing the metadata that should?
-
4. Re: unit.getAttachment(Class type) returning null
starksm64 Apr 24, 2007 2:28 AM (in response to anil.saldhana)Right, the key for the getAttachment(class) call is the class name. If a different name was used, you need to use the getAttachment(String name, Class expectedType) method.