Package org.jboss.resource.metadata.mcf

Examples of org.jboss.resource.metadata.mcf.ManagedConnectionFactoryDeploymentGroup


      Unmarshaller um = ctx.createUnmarshaller();
      StringReader r = new StringReader(content);
      InputSource is = new InputSource(r);
      Source s = new SAXSource(is);
      JAXBElement<ManagedConnectionFactoryDeploymentGroup> elem = um.unmarshal(s, ManagedConnectionFactoryDeploymentGroup.class);
      ManagedConnectionFactoryDeploymentGroup group = elem.getValue();
      return group;
   }
View Full Code Here


   {
      JAXBContext ctx = JAXBContext.newInstance(CTX_CLASS);
      Unmarshaller um = ctx.createUnmarshaller();
      Document d = getDocumentForResource(resourceName);
      JAXBElement<ManagedConnectionFactoryDeploymentGroup> elem = um.unmarshal(d, ManagedConnectionFactoryDeploymentGroup.class);
      ManagedConnectionFactoryDeploymentGroup group = elem.getValue();
      //      ManagedConnectionFactoryDeploymentGroup group = elem.getValue();
      return group;     
   }
View Full Code Here

   }
  
   @Override
   protected ManagedObject getComponent(Object attachment, PersistedComponent component, boolean create)
   {
      ManagedConnectionFactoryDeploymentGroup deployment = (ManagedConnectionFactoryDeploymentGroup) attachment;
      ManagedConnectionFactoryDeploymentMetaData metaData = null;
      if(deployment.getDeployments() != null && deployment.getDeployments().isEmpty() == false)
      {
         for(ManagedConnectionFactoryDeploymentMetaData md : deployment.getDeployments())
         {
            if(md.getJndiName().equals(component.getOriginalName()))
            {
               metaData = md;
               break;
View Full Code Here

   }

   @Override
   protected void removeComponent(Object attachment, PersistedComponent component)
   {
      ManagedConnectionFactoryDeploymentGroup deployment = (ManagedConnectionFactoryDeploymentGroup) attachment;
      if(deployment.getDeployments() != null && deployment.getDeployments().isEmpty() == false)
      {
         List<ManagedConnectionFactoryDeploymentMetaData> deployments = new ArrayList<ManagedConnectionFactoryDeploymentMetaData>();
         for(ManagedConnectionFactoryDeploymentMetaData md : deployment.getDeployments())
         {
            if(md.getJndiName().equals(component.getOriginalName()) == false)
               deployments.add(md);
         }
         deployment.setDeployments(deployments);
      }
   }
View Full Code Here

            KnownComponentTypes.DataSourceTypes.NoTx.getType().getSubtype());
      }
      else
         throw new IllegalStateException("Unexpected value connection factory type: " + cfType);

      ManagedConnectionFactoryDeploymentGroup group = new ManagedConnectionFactoryDeploymentGroup();
      group.addManagedConnectionFactoryDeployment(mcf);
      boolean logTrace = log.isTraceEnabled();
      for(ManagedProperty tempProp : values.getProperties().values())
      {
         ManagedProperty dsProp = cfMO.getProperty(tempProp.getName());
         if(dsProp != null)
View Full Code Here

  }
 
  private void attachManagedConnectionFactories(DeploymentUnit unit, Collection<DataSourceDeploymentMetaData> datasourceDeployments)
  {
     DeploymentUnit nonComponentDU =  unit.isComponent() ? unit.getParent() : unit;
     ManagedConnectionFactoryDeploymentGroup managedConnectionFactories = nonComponentDU.getAttachment(ManagedConnectionFactoryDeploymentGroup.class);
       if (managedConnectionFactories == null)
       {
          managedConnectionFactories = new ManagedConnectionFactoryDeploymentGroup();
       }
      
       for (DataSourceDeploymentMetaData dataSourceDeployment : datasourceDeployments)
       {
          managedConnectionFactories.addManagedConnectionFactoryDeployment(dataSourceDeployment);
       }
       nonComponentDU.addAttachment(ManagedConnectionFactoryDeploymentGroup.class, managedConnectionFactories);
  }
View Full Code Here

         input.setSystemId(file.toURI().toString());
         XMLReader reader = XMLReaderFactory.createXMLReader();
         reader.setEntityResolver(new JBossEntityResolver());
         SAXSource source = new SAXSource(reader, input);
         JAXBElement<ManagedConnectionFactoryDeploymentGroup> elem = um.unmarshal(source, ManagedConnectionFactoryDeploymentGroup.class);
         ManagedConnectionFactoryDeploymentGroup deployment = elem.getValue();
         repository.addManagedConnectionFactoryDeploymentGroup(deployment);
         return deployment;
      }     
      finally
      {
View Full Code Here

      super(name);
   }

   public void testDefaultValuesUnmarshal() throws Exception
   {
      ManagedConnectionFactoryDeploymentGroup group = ManagedDeploymentSupportHelper.unmarshalResource("jca/deployment/default-content-ds.xml");
      List<ManagedConnectionFactoryDeploymentMetaData> deployments = group.getDeployments();

      for (ManagedConnectionFactoryDeploymentMetaData md : deployments)
      {
         assertTrue(md.isUseJavaContext());
View Full Code Here

   }


   public void testConnectionPoolUnmarshal() throws Exception
   {
      ManagedConnectionFactoryDeploymentGroup group = ManagedDeploymentSupportHelper.unmarshalResource("jca/deployment/pool-content-ds.xml");
      ManagedConnectionFactoryDeploymentMetaData md = group.getDeployments().get(0);
      assertTrue(md.getPrefill());
   }
View Full Code Here

      assertTrue(md.getPrefill());
   }

   public void testBasicMarshal() throws Exception
   {
      ManagedConnectionFactoryDeploymentGroup group = ManagedDeploymentSupportHelper.unmarshalResource("jca/remote-jdbc/remote-ds.xml");
      String result = ManagedDeploymentSupportHelper.marshalResourceAsString(group);
      group = ManagedDeploymentSupportHelper.unmarshalSource(result);

   }
View Full Code Here

TOP

Related Classes of org.jboss.resource.metadata.mcf.ManagedConnectionFactoryDeploymentGroup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.