Examples of ConnectionDefinitionMetaData


Examples of org.jboss.metadata.rar.spec.ConnectionDefinitionMetaData

      assertEquals(ra.getSecurityPermissions().get(0).getSecurityPermissionSpec(), "sa");
   }
  
   private void assertOutboundAdapter(OutboundRaMetaData outboundRa) {
      assertNotNull(outboundRa.getConDefs());
      ConnectionDefinitionMetaData conDef = outboundRa.getConDefs().get(0);
      assertTrue(conDef.getManagedConnectionFactoryClass().endsWith("JmsManagedConnectionFactory"));
      assertEquals(conDef.getConfigProps().size(), 7);
      assertEquals(conDef.getConfigProps().get(6).getName(), "UseTryLock");
      assertTrue(conDef.getConnectionFactoryInterfaceClass().endsWith("JmsConnectionFactory"));
      assertTrue(conDef.getConnectionFactoryImplementationClass().endsWith("JmsConnectionFactoryImpl"));
      assertTrue(conDef.getConnectionInterfaceClass().endsWith("Session"));
      assertTrue(conDef.getConnectionImplementationClass().endsWith("JmsSession"));
      assertEquals(outboundRa.getTransSupport(), TransactionSupportMetaData.XATransaction);
      assertNotNull(outboundRa.getAuthMechanisms().get(0));
      assertEquals(outboundRa.getAuthMechanisms().get(0).getAuthenticationMechanismType(), "BasicPassword");
      assertTrue(outboundRa.getAuthMechanisms().get(0).getCredentialInterfaceClass().endsWith("PasswordCredential"));
      assertEquals(outboundRa.getAuthMechanisms().get(0).getId(), "amid");
View Full Code Here

Examples of org.jboss.metadata.rar.spec.ConnectionDefinitionMetaData

      if (trace)
         log.trace("Processing: " + cd);

      createConDefs(md);

      ConnectionDefinitionMetaData cdMeta = new ConnectionDefinitionMetaData();
      cdMeta.setManagedConnectionFactoryClass(mcf);
      cdMeta.setConnectionFactoryInterfaceClass(cd.connectionFactory().getName());
      cdMeta.setConnectionFactoryImplementationClass(cd.connectionFactoryImpl().getName());
      cdMeta.setConnectionInterfaceClass(cd.connection().getName());
      cdMeta.setConnectionImplementationClass(cd.connectionImpl().getName());
      md.getRa().getOutboundRa().getConDefs().add(cdMeta);
      return md;
   }
View Full Code Here

Examples of org.jboss.metadata.rar.spec.ConnectionDefinitionMetaData

   {
      if (omd == null)
         return false;
      if (omd.getConDefs() == null || omd.getConDefs().size() == 0)
         return false;
      ConnectionDefinitionMetaData cdm = omd.getConDefs().get(0);
      if (cdm.getManagedConnectionFactoryClass() == null || cdm.getConnectionFactoryInterfaceClass() == null
            || cdm.getConnectionFactoryImplementationClass() == null || cdm.getConnectionInterfaceClass() == null
            || cdm.getConnectionImplementationClass() == null)
         return false;

      return true;
   }
View Full Code Here

Examples of org.jboss.resource.metadata.ConnectionDefinitionMetaData

  private static Collection<ConfigPropertyMetaData> getRarProperties(String rarName){
    try {
      MBeanServer server = MBeanServerFactory.findMBeanServer(null).get(0);
      ObjectName on = new ObjectName("jboss.jca:service=RARDeployment,name='"+rarName+"'");//$NON-NLS-1$  //$NON-NLS-2$ 
      ConnectorMetaData obj = (ConnectorMetaData)server.getAttribute(on, "MetaData");//$NON-NLS-1$ 
      ConnectionDefinitionMetaData metadata = obj.getConnectionDefinition(ConnectionFactory.class.getName());
      if (metadata != null) {
        return metadata.getProperties();
      }
    } catch (MalformedObjectNameException e) {
      //ignore
    } catch (AttributeNotFoundException e) {
      //ignore
View Full Code Here

Examples of org.jboss.resource.metadata.ConnectionDefinitionMetaData

   {
      if (mcf != null)
         throw new DeploymentException("Stop the RARDeployment before restarting it");

      ResourceAdapter resourceAdapter = null;
      ConnectionDefinitionMetaData cdmd = cmd.getConnectionDefinition(dmd.getConnectionDefinition());
      rarName = dmd.getRarName();
      try
      {
         resourceAdapter = (ResourceAdapter) getServer().getAttribute(oldRarDeployment, "ResourceAdapter");

         if (cdmd == null)
            throw new DeploymentException("ConnectionDefinition '" + connectionDefinition + "' not found in rar '"
                  + rarName + "'");

         setManagedConnectionFactoryClass(cdmd.getManagedConnectionFactoryClass());
         setReauthenticationSupport(cmd.getReauthenticationSupport());
      }
      catch (Exception e)
      {
         throw new DeploymentException("couldn't get oldRarDeployment! " + oldRarDeployment, e);
      }
     
      try
      {
         mcfClass = Thread.currentThread().getContextClassLoader().loadClass(cdmd.getManagedConnectionFactoryClass());
      }
      catch (ClassNotFoundException cnfe)
      {
         log.error("Could not find ManagedConnectionFactory class: " + managedConnectionFactoryClass, cnfe);
         throw new DeploymentException("Could not find ManagedConnectionFactory class: "
               + managedConnectionFactoryClass);
      }
      try
      {
         mcf = (ManagedConnectionFactory) mcfClass.newInstance();
      }
      catch (Exception e)
      {
         log.error("Could not instantiate ManagedConnectionFactory: " + managedConnectionFactoryClass, e);
         throw new DeploymentException("Could not instantiate ManagedConnectionFactory: "
               + managedConnectionFactoryClass);
      }
     
      if (cmd != null)
      {
         // Set the resource adapter properties
         setMcfProperties(cmd.getProperties(), false);
         // Set the connection definition properties
         setMcfProperties(cdmd.getProperties(), true);
      }
     
      setManagedConnectionFactoryProperties(dmd.getManagedConnectionFactoryProperties());

      if (resourceAdapter != null && mcf instanceof ResourceAdapterAssociation)
View Full Code Here

Examples of org.jboss.resource.metadata.ConnectionDefinitionMetaData

   }

   @Override
   protected Object getInternalAttribute(String attribute) throws AttributeNotFoundException, MBeanException, ReflectionException
   {
      ConnectionDefinitionMetaData cdmd = cmd.getConnectionDefinition(dmd.getConnectionDefinition());
     
      Object result = null;
     
      if("RARName".equals(attribute))
      {
         result = rarName;        
     
      }else if("OldRarDeployment".equals(attribute))
      {
         result = oldRarDeployment;
      }
      else if("ConnectionDefinition".equals(attribute))
      {
         result = dmd.getConnectionDefinition();        
     
      }else if("VendorName".equals(attribute))
      {
         result = cmd.getVendorName();        
     
      }else if("SpecVersion".equals(attribute))
      {
         result = cmd.getVersion();        
     
      }else if("EisType".equals(attribute))
      {
         result = cmd.getEISType();              
     
      }else if("Version".equals(attribute))
      {
         result = cmd.getRAVersion();
     
      }else if("ManagedConnectionFactoryClass".equals(attribute))
      {
         result = cdmd.getManagedConnectionFactoryClass();        

      }else if("ConnectionInterface".equals(attribute))
      {
         result = cdmd.getConnectionInterfaceClass();        
      }
      else if("ConnectionFactoryImpl".equals(attribute))
      {
         result = cdmd.getConnectionFactoryImplementationClass();
        
      }else if("ConnectionImplClass".equals(attribute))
      {
         result = cdmd.getConnectionImplementationClass();
     
      }
      else if("TransactionSupport".equals(attribute))
      {
         result = dmd.getTransactionSupportMetaData();        
View Full Code Here

Examples of org.jboss.resource.metadata.ConnectionDefinitionMetaData

   {
      if (mcf != null)
         throw new DeploymentException("Stop the RARDeployment before restarting it");

      ConnectorMetaData cmd = null;
      ConnectionDefinitionMetaData cdmd = null;
      ResourceAdapter resourceAdapter = null;
      if (oldRarDeployment != null)
      {
         try
         {
            resourceAdapter = (ResourceAdapter) getServer().getAttribute(oldRarDeployment, "ResourceAdapter");
            cmd = (ConnectorMetaData) getServer().getAttribute(oldRarDeployment, "MetaData");
            cdmd = cmd.getConnectionDefinition(connectionDefinition);
            if (cdmd == null)
               throw new DeploymentException("ConnectionDefinition '" + connectionDefinition + "' not found in rar '" + rarName + "'");
            setManagedConnectionFactoryClass(cdmd.getManagedConnectionFactoryClass());
            setReauthenticationSupport(cmd.getReauthenticationSupport());
         }
         catch (Exception e)
         {
            throw new DeploymentException("couldn't get oldRarDeployment! " + oldRarDeployment, e);
         }
      }
      try
      {
         mcfClass = Thread.currentThread().getContextClassLoader().loadClass(managedConnectionFactoryClass);
      }
      catch (ClassNotFoundException cnfe)
      {
         log.error("Could not find ManagedConnectionFactory class: " + managedConnectionFactoryClass, cnfe);
         throw new DeploymentException("Could not find ManagedConnectionFactory class: "
               + managedConnectionFactoryClass);
      }
      try
      {
         mcf = (ManagedConnectionFactory) mcfClass.newInstance();
      }
      catch (Exception e)
      {
         log.error("Could not instantiate ManagedConnectionFactory: " + managedConnectionFactoryClass, e);
         throw new DeploymentException("Could not instantiate ManagedConnectionFactory: "
               + managedConnectionFactoryClass);
      }
      if (cmd != null)
      {
         // Set the resource adapter properties
         setMcfProperties(cmd.getProperties(), false);
         // Set the connection definition properties
         setMcfProperties(cdmd.getProperties(), true);
      }
      //set overridden properties;
      setMcfProperties(managedConnectionFactoryProperties);

      if (resourceAdapter != null && mcf instanceof ResourceAdapterAssociation)
View Full Code Here

Examples of org.jboss.resource.metadata.ConnectionDefinitionMetaData

   {
      if (mcf != null)
         throw new DeploymentException("Stop the RARDeployment before restarting it");

      ResourceAdapter resourceAdapter = null;
      ConnectionDefinitionMetaData cdmd = cmd.getConnectionDefinition(dmd.getConnectionDefinition());
     
      try
      {
         resourceAdapter = (ResourceAdapter) getServer().getAttribute(oldRarDeployment, "ResourceAdapter");

         if (cdmd == null)
            throw new DeploymentException("ConnectionDefinition '" + connectionDefinition + "' not found in rar '"
                  + rarName + "'");

         setManagedConnectionFactoryClass(cdmd.getManagedConnectionFactoryClass());
         setReauthenticationSupport(cmd.getReauthenticationSupport());
      }
      catch (Exception e)
      {
         throw new DeploymentException("couldn't get oldRarDeployment! " + oldRarDeployment, e);
      }
     
      try
      {
         mcfClass = Thread.currentThread().getContextClassLoader().loadClass(cdmd.getManagedConnectionFactoryClass());
      }
      catch (ClassNotFoundException cnfe)
      {
         log.error("Could not find ManagedConnectionFactory class: " + managedConnectionFactoryClass, cnfe);
         throw new DeploymentException("Could not find ManagedConnectionFactory class: "
               + managedConnectionFactoryClass);
      }
      try
      {
         mcf = (ManagedConnectionFactory) mcfClass.newInstance();
      }
      catch (Exception e)
      {
         log.error("Could not instantiate ManagedConnectionFactory: " + managedConnectionFactoryClass, e);
         throw new DeploymentException("Could not instantiate ManagedConnectionFactory: "
               + managedConnectionFactoryClass);
      }
     
      if (cmd != null)
      {
         // Set the resource adapter properties
         setMcfProperties(cmd.getProperties(), false);
         // Set the connection definition properties
         setMcfProperties(cdmd.getProperties(), true);
      }
     
      setManagedConnectionFactoryProperties(dmd.getManagedConnectionFactoryProperties());

      if (resourceAdapter != null && mcf instanceof ResourceAdapterAssociation)
View Full Code Here

Examples of org.jboss.resource.metadata.ConnectionDefinitionMetaData

   }

   @Override
   protected Object getInternalAttribute(String attribute) throws AttributeNotFoundException, MBeanException, ReflectionException
   {
      ConnectionDefinitionMetaData cdmd = cmd.getConnectionDefinition(dmd.getConnectionDefinition());
     
      Object result = null;
     
      if("RARName".equals(attribute))
      {
         result = rarName;        
     
      }else if("OldRarDeployment".equals(attribute))
      {
         result = oldRarDeployment;
      }
      else if("ConnectionDefinition".equals(attribute))
      {
         result = dmd.getConnectionDefinition();        
     
      }else if("VendorName".equals(attribute))
      {
         result = cmd.getVendorName();        
     
      }else if("SpecVersion".equals(attribute))
      {
         result = cmd.getVersion();        
     
      }else if("EisType".equals(attribute))
      {
         result = cmd.getEISType();              
     
      }else if("Version".equals(attribute))
      {
         result = cmd.getRAVersion();
     
      }else if("ManagedConnectionFactoryClass".equals(attribute))
      {
         result = cdmd.getManagedConnectionFactoryClass();        

      }else if("ConnectionInterface".equals(attribute))
      {
         result = cdmd.getConnectionInterfaceClass();        
      }
      else if("ConnectionFactoryImpl".equals(attribute))
      {
         result = cdmd.getConnectionFactoryImplementationClass();
        
      }else if("ConnectionImplClass".equals(attribute))
      {
         result = cdmd.getConnectionImplementationClass();
     
      }
      else if("TransactionSupport".equals(attribute))
      {
         result = dmd.getTransactionSupportMetaData();        
View Full Code Here

Examples of org.jboss.resource.metadata.ConnectionDefinitionMetaData

   {
      if (mcf != null)
         throw new DeploymentException("Stop the RARDeployment before restarting it");

      ConnectorMetaData cmd = null;
      ConnectionDefinitionMetaData cdmd = null;
      ResourceAdapter resourceAdapter = null;
      if (oldRarDeployment != null)
      {
         try
         {
            resourceAdapter = (ResourceAdapter) getServer().getAttribute(oldRarDeployment, "ResourceAdapter");
            cmd = (ConnectorMetaData) getServer().getAttribute(oldRarDeployment, "MetaData");
            cdmd = cmd.getConnectionDefinition(connectionDefinition);
            if (cdmd == null)
               throw new DeploymentException("ConnectionDefinition '" + connectionDefinition + "' not found in rar '" + rarName + "'");
            setManagedConnectionFactoryClass(cdmd.getManagedConnectionFactoryClass());
            setReauthenticationSupport(cmd.getReauthenticationSupport());
         }
         catch (Exception e)
         {
            throw new DeploymentException("couldn't get oldRarDeployment! " + oldRarDeployment, e);
         }
      }
      try
      {
         mcfClass = Thread.currentThread().getContextClassLoader().loadClass(managedConnectionFactoryClass);
      }
      catch (ClassNotFoundException cnfe)
      {
         log.error("Could not find ManagedConnectionFactory class: " + managedConnectionFactoryClass, cnfe);
         throw new DeploymentException("Could not find ManagedConnectionFactory class: "
               + managedConnectionFactoryClass);
      }
      try
      {
         mcf = (ManagedConnectionFactory) mcfClass.newInstance();
      }
      catch (Exception e)
      {
         log.error("Could not instantiate ManagedConnectionFactory: " + managedConnectionFactoryClass, e);
         throw new DeploymentException("Could not instantiate ManagedConnectionFactory: "
               + managedConnectionFactoryClass);
      }
      if (cmd != null)
      {
         // Set the resource adapter properties
         setMcfProperties(cmd.getProperties(), false);
         // Set the connection definition properties
         setMcfProperties(cdmd.getProperties(), true);
      }
      //set overridden properties;
      setMcfProperties(managedConnectionFactoryProperties);
     
      if (resourceAdapter != null && mcf instanceof ResourceAdapterAssociation)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.