I'm experimenting with applying edits via the ManagementView to ServiceBindingManager
(see
http://www.jboss.org/index.html?module=bb&op=viewtopic&t=154673 for changes
I've made locally to set this up.) I'm finding that my edits are persisted, but
when I restart the AS they are not being applied.
Problem seems to be the type of attachment is not being looked for. Here's how
ProfileServicePersistenceDeployer looks for relevant attachments:
| protected void internalDeploy(DeploymentUnit unit) throws DeploymentException
| {
| // Check all attachments, if they have a managed attachment
| // TODO there might be a better way to do that ? :)
| Set<String> attachments =
unit.getTransientManagedObjects().getAttachments().keySet();
| for(String attachment : attachments)
| {
| PersistedManagedObject persistedManagedObject = (PersistedManagedObject)
unit.getAttachment(PERSISTED_ATTACHMENT_PREFIX + attachment);
|
| if(persistedManagedObject != null)
| ... do stuff to apply persisted edits
|
The "attachments" set includes:
org.jboss.kernel.spi.deployment.KernelDeployment,
org.jboss.deployers.spi.structure.StructureMetaData
Problem is the LazyPredeterminedManagedObjects.attachments set only includes
org.jboss.beans.metadata.plugins.AbstractBeanMetaData
So, no match and thus no edits applied.
Any ideas on what could be going wrong? The persisted attachment metadata is as follows:
bindings-jboss-beans-XXX/metadata-attachment.xml:
| <?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
| <attachments-metadata
xmlns="urn:org:jboss:profileservice:attachments:1.0">
| <attachment>
|
<attachment-class-name>org.jboss.beans.metadata.plugins.AbstractBeanMetaData</attachment-class-name>
|
<attachment-name>org.jboss.services.binding.ServiceBindingManager</attachment-name>
| </attachment>
| <deployment-name>bindings-jboss-beans.xml</deployment-name>
| <deployment-structure>
| <relative-order>0</relative-order>
| </deployment-structure>
| <last-modified>1241122388193</last-modified>
| </attachments-metadata>
bindings-jboss-beans-XXX/org.jboss.services.binding.ServiceBindingManager.attachment.xml:
| <?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
| <managed-object
xmlns="urn:org:jboss:profileservice:persistence:managed-object:1.0"
template-name="org.jboss.services.binding.ServiceBindingManager"
name="ServiceBindingManager"
class-name="org.jboss.beans.metadata.plugins.AbstractBeanMetaData">
| <orignal-name>ServiceBindingManager</orignal-name>
| <properties>
| <property name="serverName">
| <simple>ports-01</simple>
| </property>
| </properties>
| </managed-object>
(BTW, there's a typo in that last snippet: "orignal-name")
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4227924#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...