Examples of ConfigPropertyMetaData


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

      // Ignore config-property which has ignore=true
      if (configProperty.ignore())
         return md;

      ConfigPropertyMetaData cfgMeta = new ConfigPropertyMetaData();
      cfgMeta.setName(getConfigPropertyName(annotation));

      if (configProperty.defaultValue() != null && !configProperty.defaultValue().equals(""))
         cfgMeta.setValue(configProperty.defaultValue());

      if (!Object.class.equals(configProperty.type()))
      {
         cfgMeta.setType(configProperty.type().getName());
      }
      else
      {
         cfgMeta.setType(getConfigPropertyType(annotation));
      }
      cfgMeta.setIgnore(configProperty.ignore());

      String[] description = configProperty.description();
      if (description != null)
      {
         if (cfgMeta.getDescriptions() == null)
         {
            DescriptionsImpl descsImpl = new DescriptionsImpl();
            cfgMeta.setDescriptions(descsImpl);
         }
         for (String desc : description)
         {
            DescriptionImpl descImpl = new DescriptionImpl();
            descImpl.setDescription(desc);
            ((DescriptionsImpl)cfgMeta.getDescriptions()).add(descImpl);
         }
      }
     
      String attachedClassName = annotation.getClassName();
      ClassLoader cl = SecurityActions.getThreadContextClassLoader();
      Class attachedClass = Class.forName(attachedClassName, true, cl);

      if (hasInterface(attachedClass, "javax.resource.spi.ResourceAdapter"))
      {
         if (md.getRa() == null)
         {
            md.setRa(new ResourceAdapterMetaData());
         }
         if (md.getRa().getConfigProperty() == null)
         {
            md.getRa().setConfigProperty(new ArrayList<ConfigPropertyMetaData>());
         }
         for (ConfigPropertyMetaData cpMeta : md.getRa().getConfigProperty())
         {
            if (cpMeta.getName().equals(cfgMeta.getName()))
            {
               return md;
            }
         }
         md.getRa().getConfigProperty().add(cfgMeta);
      }
      else if (hasInterface(attachedClass, "javax.resource.spi.ManagedConnectionFactory"))
      {
         createConDefs(md);
         for (ConnectionDefinitionMetaData cdMeta : md.getRa().getOutboundRa().getConDefs())
         {
            if (attachedClassName.equals(cdMeta.getManagedConnectionFactoryClass()))
            {
               if (cdMeta.getConfigProps() == null)
               {
                  cdMeta.setConfigProps(new ArrayList<ConfigPropertyMetaData>());
               }
               for (ConfigPropertyMetaData cpMeta : cdMeta.getConfigProps())
               {
                  if (cpMeta.getName().equals(cfgMeta.getName()))
                  {
                     return md;
                  }
               }
               cdMeta.getConfigProps().add(cfgMeta);
            }
         }
      }
      else if (hasInterface(attachedClass, "javax.resource.spi.ActivationSpec"))
      {
         createMessageListeners(md);
         for (MessageListenerMetaData mlMeta : md.getRa().getInboundRa().getMessageAdapter().getMessageListeners())
         {
            if (attachedClassName.equals(mlMeta.getActivationSpecType().getAsClass()))
            {
               if (mlMeta.getActivationSpecType().getConfigProps() == null)
               {
                  mlMeta.getActivationSpecType().setConfigProps(new ArrayList<ConfigPropertyMetaData>());
               }
               for (ConfigPropertyMetaData cpMeta : mlMeta.getActivationSpecType().getConfigProps())
               {
                  if (cpMeta.getName().equals(cfgMeta.getName()))
                  {
                     return md;
                  }
               }
               mlMeta.getActivationSpecType().getConfigProps().add(cfgMeta);
View Full Code Here

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

               {
                  Iterator<ConfigPropertyMetaData> it = listConfigProp.iterator();

                  while (!found && it.hasNext())
                  {
                     ConfigPropertyMetaData cpmd = it.next();
                     if (cpmd.getName().equals(rcmd.getName()) && cpmd.getType().equals(rcmd.getType()))
                     {
                        cpmd.setValue(rcmd.getValue());
                        found = true;
                     }
                  }
               }

               if (!found)
               {
                  if (append == null)
                     append = new ArrayList<ConfigPropertyMetaData>();

                  ConfigPropertyMetaData cpmd = new ConfigPropertyMetaData();
                  cpmd.setName(rcmd.getName());
                  cpmd.setType(rcmd.getType());
                  cpmd.setValue(rcmd.getValue());

                  append.add(cpmd);
               }
            }
View Full Code Here

Examples of org.jboss.resource.metadata.ConfigPropertyMetaData

      }
   }

   private Object getAttribute(ObjectName raName, String attrName) throws Exception
   {
      ConfigPropertyMetaData cpmd = (ConfigPropertyMetaData)getServer().getAttribute(raName, attrName);
      if ("java.lang.Integer".equals(cpmd.getType()))
      {
         return Integer.valueOf(cpmd.getValue());
      }
      else if ("java.lang.Boolean".equals(cpmd.getType()))
      {
         return Boolean.valueOf(cpmd.getValue());
      }
      return cpmd.getValue();
   }
View Full Code Here

Examples of org.jboss.resource.metadata.ConfigPropertyMetaData

   protected void setMcfProperties(Collection properties, boolean mustExist) throws DeploymentException
   {
      for (Iterator i = properties.iterator(); i.hasNext();)
      {
         ConfigPropertyMetaData cpmd = (ConfigPropertyMetaData) i.next();
         String name = cpmd.getName();
         String type = cpmd.getType();
         String value = cpmd.getValue();
         if (name == null || name.length() == 0 || value == null || value.length() == 0)
         {
            log.debug("Not setting config property '" + name + "'");
            continue;
         }
View Full Code Here

Examples of org.jboss.resource.metadata.ConfigPropertyMetaData

   protected void setMcfProperties(Collection properties, boolean mustExist) throws DeploymentException
   {
      for (Iterator i = properties.iterator(); i.hasNext();)
      {
         ConfigPropertyMetaData cpmd = (ConfigPropertyMetaData) i.next();
         String name = cpmd.getName();
         String value = cpmd.getValue();
         try
         {
            getConfigPropertyHandler().handle(cpmd, mustExist);
         }
         catch (Exception e)
View Full Code Here

Examples of org.jboss.resource.metadata.ConfigPropertyMetaData

      if (raProperties != null && raProperties.size() != 0)
      {
        
         for (Iterator i = raProperties.iterator(); i.hasNext();)
         {
            ConfigPropertyMetaData cpmd = (ConfigPropertyMetaData) i.next();
            String name = cpmd.getName();
            String value = cpmd.getValue();
            if (value != null && value.length() > 0)
            {
               if (properties.containsKey(name))
               {
                  if (trace)
                     log.trace("AdminObject '" + jndiName + "' property=" + name + " IGNORING value=" + value
                           + " specified in MBean properties.");
               }
               else
               {
                  // Load the property class as defined in the meta data
                  String typeName = cpmd.getType();
                  if (trace)
                     log.trace("AdminObject '" + jndiName + "' property=" + name + " loading class=" + typeName);

                  try
                  {
                     configPropertyHandler.handle(cpmd);
                  }
                  catch (InvocationTargetException e)
                  {
                     DeploymentException.rethrowAsDeploymentException("Error for property '" + name + "' class="
                           + implClass + "' for admin object '" + interfaceClass + "' ra=" + rarName, e
                           .getTargetException());
                  }
                  catch (Throwable t)
                  {
                     DeploymentException.rethrowAsDeploymentException("Error for property '" + name + "' class="
                           + implClass + "' for admin object '" + interfaceClass + "' ra=" + rarName, t);
                  }
               }
            }
         }
      }

      // Apply the properties
      if (properties != null)
      {
         for (Iterator i = properties.entrySet().iterator(); i.hasNext();)
         {
            Map.Entry property = (Map.Entry) i.next();
            String name = (String) property.getKey();
            String value = (String) property.getValue();
           
            if (trace)
               log.trace("AdminObject '" + jndiName + "' property=" + name + " value=" + value);

            // Pick up the property metadata
            ConfigPropertyMetaData cpmd = aomd.getProperty(name);
            if (cpmd == null)
               throw new DeploymentException("No property '" + name + "' for admin object '" + interfaceClass + "' ra="
                     + rarName);
           
            // Make copy of the ConfigPropertyMetaData with new value
            ConfigPropertyMetaData cpmdCopy = new ConfigPropertyMetaData();
            cpmdCopy.setName(name);
            cpmdCopy.setType(cpmd.getType());
            cpmdCopy.setValue(value);
           
            try
            {
               configPropertyHandler.handle(cpmdCopy);
            }
View Full Code Here

Examples of org.jboss.resource.metadata.ConfigPropertyMetaData

      ResourceAdapter adapter = createResourceAdapter(ramd.getConnectorMetaData());
     
      ConfigPropertyHandler configPropertyHandler = new ConfigPropertyHandler(adapter, adapter.getClass(), "ResourceAdapter: ");
      for(Iterator iter = ramd.getRaXmlMetaData().getProperties().iterator(); iter.hasNext();)
      {
         ConfigPropertyMetaData cpmd = (ConfigPropertyMetaData)iter.next();
         applyProperty(configPropertyHandler, cpmd, adapter.getClass());
      }
           
      return adapter;
   }
View Full Code Here

Examples of org.jboss.resource.metadata.ConfigPropertyMetaData

     
      // Apply the properties
      ConfigPropertyHandler configPropertyHandler = new ConfigPropertyHandler(result, raClass, "ResourceAdapter: ");
      for (Iterator i = cmd.getProperties().iterator(); i.hasNext();)
      {
         ConfigPropertyMetaData cpmd = (ConfigPropertyMetaData) i.next();
         applyProperty(configPropertyHandler, cpmd, raClass);        
      }
     
      return result;
   }
View Full Code Here

Examples of org.jboss.resource.metadata.ConfigPropertyMetaData

      attrs[9] = new MBeanAttributeInfo("ReauthenticationSupport", Boolean.TYPE.getName(), "Whether reauthentication support is supported", true, false, false);
      attrs[10] = new MBeanAttributeInfo("ResourceAdapter", ResourceAdapter.class.getName(), "The resource adapter instance", true, false, false);
      int n = 11;
      for (Iterator i = properties.iterator(); i.hasNext();)
      {
         ConfigPropertyMetaData cpmd = (ConfigPropertyMetaData) i.next();
         attrs[n++] = new MBeanAttributeInfo(cpmd.getName(), cpmd.getType(), cpmd.getDescription().getDescription(), true, false, false);
      }
      return attrs;
   }
View Full Code Here

Examples of org.jboss.resource.metadata.ConfigPropertyMetaData

   protected void setMcfProperties(Collection properties, boolean mustExist) throws DeploymentException
   {
      for (Iterator i = properties.iterator(); i.hasNext();)
      {
         ConfigPropertyMetaData cpmd = (ConfigPropertyMetaData) i.next();
         String name = cpmd.getName();
         String type = cpmd.getType();
         String value = cpmd.getValue();
         if (name == null || name.length() == 0 || value == null || value.length() == 0)
         {
            log.debug("Not setting config property '" + name + "'");
            continue;
         }
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.