Package org.jboss.metadata

Examples of org.jboss.metadata.ActivationConfigPropertyMetaData


   void checkActivationConfig(String name, String value)
   {
      if (value != null && properties.containsKey(name) == false)
      {
         org.jboss.metadata.ejb.spec.ActivationConfigPropertyMetaData md = new org.jboss.metadata.ejb.spec.ActivationConfigPropertyMetaData();
         ActivationConfigPropertyMetaData metaData = new ActivationConfigPropertyMetaData(md);
         md.setName(name);
         md.setValue(value);
         properties.put(name, metaData);
      }
   }
View Full Code Here


            Constructor<?> constructor = returnClass.getConstructor(c);
            return (ActivationConfigPropertyMetaData) constructor.newInstance(instance);
        }
        catch (final ClassNotFoundException e)
        {
            return new ActivationConfigPropertyMetaData(key, value);
        }
        catch (final InstantiationException e)
        {
            throw new RuntimeException("Could not instantiate an instance of org.jboss.metadata.ejb.spec.ActivationConfigPropertyMetaData", e);
        }
View Full Code Here

         Iterator<Element> iterator = MetaData.getChildrenByTagName(activationConfig, "activation-config-property");
         while (iterator.hasNext())
         {
            Element xml = iterator.next();
            org.jboss.metadata.ejb.spec.ActivationConfigPropertyMetaData md = new org.jboss.metadata.ejb.spec.ActivationConfigPropertyMetaData();
            ActivationConfigPropertyMetaData metaData = new ActivationConfigPropertyMetaData(md);
            String name = MetaData.getElementContent(MetaData.getUniqueChild(xml, "activation-config-property-name"));
            String value = MetaData.getElementContent(MetaData.getUniqueChild(xml, "activation-config-property-value"));
            if (name == null || name.trim().length() == 0)
               throw new DeploymentException("activation-config-property doesn't have a name");
            if (Strings.isValidJavaIdentifier(name) == false)
               throw new DeploymentException("activation-config-property '" + name + "' is not a valid java identifier");
            md.setName(name);
            md.setValue(value);
            if (properties.containsKey(metaData.getName()) == false)
               properties.put(metaData.getName(), metaData);
         }
      }
     
      // Message Destination Link
      String link = metaData.getDestinationLink();
      if (link != null)
      {
         link = link.trim();
         if (link.length() > 0)
         {
            if (properties.containsKey("destination"))
               log.warn("Ignoring message-destination-link '" + link + "' when the destination " +
                  "is already in the activation-config.");
            else
            {
               MessageDestinationMetaData destinationMetaData = container.getMessageDestination(link);
               if (destinationMetaData == null)
                  throw new DeploymentException("Unresolved message-destination-link '" + link + "' no message-destination in ejb-jar.xml");
               String jndiName = destinationMetaData.getJndiName();
               if (jndiName == null)
                  throw new DeploymentException("The message-destination '" + link + "' has no jndi-name in jboss.xml");
               org.jboss.metadata.ejb.spec.ActivationConfigPropertyMetaData acpmd = new
               org.jboss.metadata.ejb.spec.ActivationConfigPropertyMetaData();
               acpmd.setActivationConfigPropertyName("destination");
               acpmd.setValue(jndiName);
               ActivationConfigPropertyMetaData wrapper = new ActivationConfigPropertyMetaData(acpmd);
               properties.put("destination", wrapper);
            }
         }
      }
   }  
View Full Code Here

   void checkActivationConfig(String name, String value)
   {
      if (value != null && properties.containsKey(name) == false)
      {
         org.jboss.metadata.ejb.spec.ActivationConfigPropertyMetaData md = new org.jboss.metadata.ejb.spec.ActivationConfigPropertyMetaData();
         ActivationConfigPropertyMetaData metaData = new ActivationConfigPropertyMetaData(md);
         md.setName(name);
         md.setValue(value);
         properties.put(name, metaData);
      }
   }
View Full Code Here

/*  71 */         log.trace("Checking required config " + rcpName);
/*     */       }
/*  73 */       boolean found = false;
/*  74 */       for (Iterator j = activationConfig.iterator(); j.hasNext(); )
/*     */       {
/*  76 */         ActivationConfigPropertyMetaData acpmd = (ActivationConfigPropertyMetaData)j.next();
/*     */
/*  78 */         String acp = acpmd.getName();
/*  79 */         String acpName = acp.substring(0, 1).toUpperCase();
/*  80 */         if (acp.length() > 1) {
/*  81 */           acpName = acpName.concat(acp.substring(1));
/*     */         }
/*  83 */         if (trace) {
/*  84 */           log.trace("Checking required config " + rcpName + " against " + acpName + " result=" + rcpName.equals(acpName));
/*     */         }
/*  86 */         if (rcpName.equals(acpName))
/*     */         {
/*  88 */           if (trace)
/*  89 */             log.trace("Found required config " + rcp + " " + acpmd);
/*  90 */           found = true;
/*  91 */           break;
/*     */         }
/*     */       }
/*  94 */       if (!found) {
/*  95 */         throw new DeploymentException("Required config property " + rcpmd + " for messagingType '" + messagingType + "' not found in activation config " + activationConfig + " ra=" + rarName);
/*     */       }
/*     */
/*     */     }
/*     */
/* 100 */     String className = mlmd.getActivationSpecType();
/* 101 */     if (className == null) {
/* 102 */       throw new DeploymentException("No activation spec type for messagingType '" + messagingType + "' ra=" + rarName);
/*     */     }
/*     */
/* 105 */     if (trace)
/* 106 */       log.trace("Loading ActivationSpec class=" + className);
/* 107 */     Class asClass = Thread.currentThread().getContextClassLoader().loadClass(className);
/* 108 */     if (!ActivationSpec.class.isAssignableFrom(asClass))
/* 109 */       throw new DeploymentException(asClass.getName() + " is not an activation spec class '" + messagingType + "' ra=" + rarName);
/* 110 */     ActivationSpec result = (ActivationSpec)asClass.newInstance();
/* 111 */     if (trace) {
/* 112 */       log.trace("Instantiated ActivationSpec class=" + result);
/*     */     }
/*     */
/* 117 */     Properties beanProps = new Properties();
/* 118 */     for (Iterator i = activationConfig.iterator(); i.hasNext(); )
/*     */     {
/* 120 */       ActivationConfigPropertyMetaData acpmd = (ActivationConfigPropertyMetaData)i.next();
/* 121 */       String name = acpmd.getName();
/* 122 */       String value = acpmd.getValue();
/* 123 */       beanProps.setProperty(name, value);
/*     */     }
/* 125 */     if (trace)
/* 126 */       log.trace("Configuring ActivationSpec properties=" + beanProps);
/*     */     try
View Full Code Here

TOP

Related Classes of org.jboss.metadata.ActivationConfigPropertyMetaData

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.