Package org.jboss.injection

Examples of org.jboss.injection.ValueEncInjector


     
      // Create a URL from the mappedName
      try
      {
         URL url = new URL(mappedName.trim());
         container.getEncInjectors().put(encName, new ValueEncInjector(encName, url, "@Resource"));
      }
      catch (MalformedURLException e)
      {
         throw new RuntimeException(e);
      }
View Full Code Here


         {
            if (envRef.getResUrl() != null)
            {
               try
               {
                  container.getEncInjectors().put(encName, new ValueEncInjector(encName, new URL(envRef.getResUrl().trim()), "<resource-ref>"));
               }
               catch (MalformedURLException e)
               {
                  throw new RuntimeException(e);
               }
View Full Code Here

            // Use the mappedName as the string value
            String s = ref.mappedName().trim();
            try
            {
               Object value = ValueConvertor.convertValue(type, s);
               container.getEncInjectors().put(encName, new ValueEncInjector(encName, value, "@Resource"));
               injectors.put(accObj, new JndiPropertyInjector(property, encName, container.getEnc()));
            }
            catch(Throwable t)
            {
               throw new RuntimeException("Failed to convert: "+ref.mappedName()+" to type:"+type, t);
View Full Code Here

      // Create a URL from the mappedName
      try
      {
         URL url = new URL(mappedName.trim());
         container.getEncInjectors().put(encName, new ValueEncInjector(encName, url, "@Resource"));
      }
      catch (MalformedURLException e)
      {
         throw new RuntimeException("failed to create url injector for: " + encName, e);
      }
View Full Code Here

            if (envRef.getResUrl() != null)
            {
               try
               {
                  container.getEncInjectors().put(encName,
                        new ValueEncInjector(encName, new URL(envRef.getResUrl().trim()), "<resource-ref>"));
               }
               catch (MalformedURLException e)
               {
                  throw new RuntimeException(e);
               }
            }
            else if (UserTransaction.class.getName().equals(envRef.getType()))
            {
               final InjectionContainer ic = container;
               InjectorFactory<?> factory = new InjectorFactory<UserTransactionPropertyInjector>()
               {
                  public UserTransactionPropertyInjector create(BeanProperty property)
                  {
                     return new UserTransactionPropertyInjector(property, ic);
                  }
               };
               if (envRef.getInjectionTargets() != null)
               {
                  TomcatInjectionUtils.createInjectors(container.getEncInjections(), container.getClassloader(),
                        factory, envRef.getInjectionTargets());
                  continue;
               }
               else
               {
                  encName = "java:comp/UserTransaction";
               }
            }
            else if (ORB.class.getName().equals(envRef.getType()))
            {
               encName = "java:comp/ORB";
            }
            else
            {
               throw new RuntimeException("mapped-name is required for " + envRef.getResourceRefName()
                     + " of deployment " + container.getIdentifier());
            }
         }
         else if (URL.class.getName().equals(envRef.getType()) && !mappedName.startsWith("java:"))
         {
            createURLInjector(encName, mappedName, container);
            InjectionUtil.injectionTarget(encName, envRef, container, container.getEncInjections());
            continue;
         }
         else if (envRef.getResUrl() != null)
         {
            try
            {
               container.getEncInjectors().put(encName,
                     new ValueEncInjector(encName, new URL(envRef.getResUrl().trim()), "<resource-ref>"));
            }
            catch (MalformedURLException e)
            {
               throw new RuntimeException(e);
            }
View Full Code Here

            // Use the mappedName as the string value
            String s = ref.mappedName().trim();
            try
            {
               Object value = ValueConvertor.convertValue(type, s);
               container.getEncInjectors().put(encName, new ValueEncInjector(encName, value, "@Resource"));
               injectors.put(accObj, new JndiPropertyInjector(property, encName, container.getEnc()));
            }
            catch (Throwable t)
            {
               throw new RuntimeException("Failed to convert: " + ref.mappedName() + " to type:" + type, t);
View Full Code Here

      // Create a URL from the mappedName
      try
      {
         URL url = new URL(mappedName.trim());
         container.getEncInjectors().put(encName, new ValueEncInjector(encName, url, "@Resource"));
      }
      catch (MalformedURLException e)
      {
         throw new RuntimeException("failed to create url injector for: " + encName, e);
      }
View Full Code Here

            if (envRef.getResUrl() != null)
            {
               try
               {
                  container.getEncInjectors().put(encName,
                        new ValueEncInjector(encName, new URL(envRef.getResUrl().trim()), "<resource-ref>"));
               }
               catch (MalformedURLException e)
               {
                  throw new RuntimeException(e);
               }
            }
            else if (UserTransaction.class.getName().equals(envRef.getType()))
            {
               final InjectionContainer ic = container;
               InjectorFactory<?> factory = new InjectorFactory<UserTransactionPropertyInjector>()
               {
                  public UserTransactionPropertyInjector create(BeanProperty property)
                  {
                     return new UserTransactionPropertyInjector(property, ic);
                  }
               };
               if (envRef.getInjectionTargets() != null)
               {
                  TomcatInjectionUtils.createInjectors(container.getEncInjections(), container.getClassloader(),
                        factory, envRef.getInjectionTargets());
                  continue;
               }
               else
               {
                  encName = "java:comp/UserTransaction";
               }
            }
            else if (ORB.class.getName().equals(envRef.getType()))
            {
               encName = "java:comp/ORB";
            }
            else
            {
               throw new RuntimeException("mapped-name is required for " + envRef.getResourceRefName()
                     + " of deployment " + container.getIdentifier());
            }
         }
         else if (URL.class.getName().equals(envRef.getType()) && !mappedName.startsWith("java:"))
         {
            createURLInjector(encName, mappedName, container);
            InjectionUtil.injectionTarget(encName, envRef, container, container.getEncInjections());
            continue;
         }
         else if (envRef.getResUrl() != null)
         {
            try
            {
               container.getEncInjectors().put(encName,
                     new ValueEncInjector(encName, new URL(envRef.getResUrl().trim()), "<resource-ref>"));
            }
            catch (MalformedURLException e)
            {
               throw new RuntimeException(e);
            }
View Full Code Here

            // Use the mappedName as the string value
            String s = ref.mappedName().trim();
            try
            {
               Object value = ValueConvertor.convertValue(type, s);
               container.getEncInjectors().put(encName, new ValueEncInjector(encName, value, "@Resource"));
               injectors.put(accObj, new JndiPropertyInjector(property, encName, container.getEnc()));
            }
            catch (Throwable t)
            {
               throw new RuntimeException("Failed to convert: " + ref.mappedName() + " to type:" + type, t);
View Full Code Here

     
      // Create a URL from the mappedName
      try
      {
         URL url = new URL(mappedName.trim());
         container.getEncInjectors().put(encName, new ValueEncInjector(encName, url, "@Resource"));
      }
      catch (MalformedURLException e)
      {
         throw new RuntimeException(e);
      }
View Full Code Here

TOP

Related Classes of org.jboss.injection.ValueEncInjector

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.