Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * JBoss, Home of Professional Open Source.
   * Copyright 2006, Red Hat Middleware LLC, and individual contributors
   * as indicated by the @author tags. See the copyright.txt file in the
   * distribution for a full listing of individual contributors.
   *
   * This is free software; you can redistribute it and/or modify it
   * under the terms of the GNU Lesser General Public License as
   * published by the Free Software Foundation; either version 2.1 of
  * the License, or (at your option) any later version.
  *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this software; if not, write to the Free
  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  */
 package org.jboss.resource.deployers;
 
 import java.util.List;
 import java.util.Map;
 
A ManagedConnectionFactoryDeployer.

Author(s):
Weston Price
Scott.Stark@jboss.org
adrian@jboss.org
Version:
$Revision: 1.1 $
 
 {
   
The repository
 
    private DefaultJCAMetaDataRepository repository;
   
   
The builders
 
    private List<AbstractBuilderbuilders = new ArrayList<AbstractBuilder>();
   
The ManagedConnectionFactoryDeploymentGroup props to manage
 
    private String[] propNames = {
          "jndiName",
          "jdbcURL",
          "userName",
          "passWord",
          "driverClass",
          "minPoolSize",
          "maxPoolSize",
          "securityMetaData",
          "managedConnectionFactoryProperties",
    };
   
A mapping from the managed property name to the attachment property name.
 
    private Map<StringStringpropertyNameMappings = new HashMap<StringString>();
 
    {
       return ;
    }
 
    public void setPropertyNameMappings(Map<StringStringmangedToMBeanNames)
    {
       .clear();
       /*
       propertyNameMappings.putAll(mangedToMBeanNames);
       */
       // Need to reverse the mapping
       for(String key : mangedToMBeanNames.keySet())
       {
          String value = mangedToMBeanNames.get(key);
          .put(valuekey);
       }
    }
 
    public String[] getPropNames()
    {
       return ;
    }
   public void setPropNames(String[] propNames)
   {
      this. = propNames;
   }

   
Create a new ManagedConnectionFactoryDeployer.
   {
      setOutput(ServiceDeployment.class);
   }
   public void setBuilders(List<AbstractBuilderbuilders)
   {
      this. = builders;
   }
   
   {
      return this.;
   }

   
Get the repository.

Returns:
the repository.
   {
      return ;
   }

   
Set the repository.

Parameters:
repository The repository to set.
   public void setRepository(DefaultJCAMetaDataRepository repository)
   {
      this. = repository;
   }
   
   {
      
      ServiceDeployment serviceDeployment = new ServiceDeployment();
      List<ServiceMetaDatacomponentServices = new ArrayList<ServiceMetaData>();            
      List<ServiceMetaDataserviceDefintion = group.getServices();
      serviceDeployment.setName(unit.getName()+" services");
      //For some reason, this didn't like the addAll method
      for (ServiceMetaData data : serviceDefintion)
      {
         componentServices.add(data);
      }
      ComponentType type = null;
      for (ManagedConnectionFactoryDeploymentMetaData data : deployments)
      {
         // TODO: there should be multiple component types
         iftype == null )
         {
            ifdata instanceof LocalDataSourceDeploymentMetaData )
               type = ...getType();
            ifdata instanceof NoTxDataSourceDeploymentMetaData )
               type = ...getType();
            ifdata instanceof XADataSourceDeploymentMetaData )
               type = ...getType();
         }
         for (AbstractBuilder builder : )
         {
            ServiceMetaData candidate = builder.build(data);
            
            if(candidate != null)
            {
               componentServices.add(candidate);
            }
         }
      }
      
      serviceDeployment.setServices(componentServices);
      unit.addAttachment(ServiceDeployment.classserviceDeployment);
      iftype != null )
         unit.addAttachment(ComponentType.classtype);
   }
   public void undeploy(DeploymentUnit unitManagedConnectionFactoryDeploymentGroup deployment)
   {      
   }
New to GrepCode? Check out our FAQ X