[jboss-dev-forums] [Design of JCA on JBoss] - Re: DeploymentInfo/Template MCF

scott.stark@jboss.org do-not-reply at jboss.com
Wed Oct 10 11:33:44 EDT 2007


The ManagedPropertys of the template should already be wired to the ManagedConnectionFactoryDeploymentMetaData instance. The question is how are the ManagedPropertys of the template being created. It should be from the required properties of the ManagedObject for the root ManagedConnectionFactoryDeploymentGroup with a single ManagedConnectionFactoryDeploymentMetaData in its deployments property.

If a template should include more than just required properties, then we should add a tempate=true/false field to the ManagementProperty annotation to identify these. In psuedo code, creating a ds should entail something like:


  | // Create the deployment template from a template ManagedConnectionFactoryDeploymentGroup
  | ManagedConnectionFactoryDeploymentGroup group = new ManagedConnectionFactoryDeploymentGroup();
  | // Issue of what ManagedConnectionFactoryDeploymentMetaData subclass to create...
  | // TODO: type should be input from admin client
  | ManagedConnectionFactoryDeploymentMetaData ds = ...;
  | group.getDeployments().add(ds);
  | 
  | // Get the template from the ManagedObject
  | // TODO: name and type should be input from admin client
  | ManagedObject groupMO = AbstractManagedObjectFactory.initManagedObject(group, "DefaultDS", "LocalTx");
  | // TODO:
  | DeploymentTemplateInfo templateInfo = AbstractTemplateInfoFactory.createInfo(groupMO);
  | 
  | // ... admin client updates template properties
  | // Profileservice calls to the template with the updated properties
  |    public VirtualFile applyTemplate(VirtualFile root, String deploymentBaseName,
  |          DeploymentTemplateInfo values)
  |       throws Exception
  | {
  |    // Need to apply the detached property values to ManagedPropertys bound to a ManagedObject/metadata instance
  |   // Create the ManagedObject as above, but this time the ds type, and name should be in the properties.
  |   ManagedConnectionFactoryDeploymentGroup group = ...;
  |   ManagedObject dsDeploymentMO = AbstractManagedObjectFactory.initManagedObject(group, ...);
  |   // Set the dsDeploymentMO ManagedProperty values
  |   for(ManagedProperty prop : values.getProperties().values())
  |   {
  |     ManagedProperty moProp = dsDeploymentMO.getProperty(prop.getName());
  |     moProp.setValue(prop.getValue());
  |   }
  | 
  |   // Create the template file from the ManagedConnectionFactoryDeploymentGroup
  |     Class[] classes = {ManagedConnectionFactoryDeploymentGroup.class};
  |     JAXBContext context = JAXBContext.newInstance(classes);      
  |     Marshaller marshaller = context.createMarshaller();
  |     marshaller.marshal(group, fw);
  | ...
  | }
  | 



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4093556#4093556

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4093556



More information about the jboss-dev-forums mailing list