Package org.jboss.ejb3.annotation

Examples of org.jboss.ejb3.annotation.JndiInject


   public StatefulBeanContext create(Class<?>[] initTypes, Object[] initValues)
   {
      StatefulBeanContext sfctx = (StatefulBeanContext) createBeanContext();
      // Tell context how to handle replication
      CacheConfig config = getAnnotation(CacheConfig.class);
      if (config != null)
      {
         sfctx.setReplicationIsPassivation(config.replicationIsPassivation());
      }

      // this is for propagated extended PC's
      sfctx = sfctx.pushContainedIn();
     
View Full Code Here


      return null;
   }
  
   protected void findPartitionName()
   {
      Clustered clustered = (Clustered) getAnnotation(Clustered.class);
      if (clustered == null)
      {
         partitionName = null;
         return;
      }
     
      String value = clustered.partition();
      try
      {
         String replacedValue = StringPropertyReplacer.replaceProperties(value);
         if (value != replacedValue)
         {           
View Full Code Here

            .getProxyFactory(binding);

      if (factory == null)
      {

         Clustered clustered = getAnnotation(Clustered.class);
         if (clustered != null)
         {
            factory = new StatefulClusterProxyFactory(this, binding, clustered);
         }
         else
View Full Code Here

      // complete
   }

   public void handleMethodAnnotations(Method method, InjectionContainer container, Map<AccessibleObject, Injector> injectors)
   {
      JndiInject ref = method.getAnnotation(JndiInject.class);
      if (ref != null)
      {
         if (!method.getName().startsWith("set"))
            throw new RuntimeException("@EJB can only be used with a set method: " + method);
         String encName = InjectionUtil.getEncName(method);
         if (!container.getEncInjectors().containsKey(encName))
         {
            container.getEncInjectors().put(encName, new LinkRefEncInjector(encName, ref.jndiName(), "@JndiInject"));
         }
         injectors.put(method, new JndiMethodInjector(method, encName, container.getEnc()));
      }
   }
View Full Code Here

      }
   }
  
   public void handleFieldAnnotations(Field field, InjectionContainer container, Map<AccessibleObject, Injector> injectors)
   {
      JndiInject ref = field.getAnnotation(JndiInject.class);
      if (ref != null)
      {
         String encName = InjectionUtil.getEncName(field);
         if (!container.getEncInjectors().containsKey(encName))
         {
            container.getEncInjectors().put(encName, new LinkRefEncInjector(encName, ref.jndiName(), "@JndiInject"));
         }
         injectors.put(field, new JndiFieldInjector(field, encName, container.getEnc()));
      }
   }
View Full Code Here

/*    */   {
/*    */   }
/*    */
/*    */   public void handleMethodAnnotations(Method method, InjectionContainer container, Map<AccessibleObject, Injector> injectors)
/*    */   {
/* 74 */     JndiInject ref = (JndiInject)method.getAnnotation(JndiInject.class);
/* 75 */     if (ref != null)
/*    */     {
/* 77 */       if (!method.getName().startsWith("set"))
/* 78 */         throw new RuntimeException("@EJB can only be used with a set method: " + method);
/* 79 */       String encName = InjectionUtil.getEncName(method);
/* 80 */       if (!container.getEncInjectors().containsKey(encName))
/*    */       {
/* 82 */         container.getEncInjectors().put(encName, new LinkRefEncInjector(encName, ref.jndiName(), "@JndiInject"));
/*    */       }
/* 84 */       injectors.put(method, new JndiMethodInjector(method, encName, container.getEnc()));
/*    */     }
/*    */   }
View Full Code Here

/*    */     }
/*    */   }
/*    */
/*    */   public void handleFieldAnnotations(Field field, InjectionContainer container, Map<AccessibleObject, Injector> injectors)
/*    */   {
/* 90 */     JndiInject ref = (JndiInject)field.getAnnotation(JndiInject.class);
/* 91 */     if (ref != null)
/*    */     {
/* 93 */       String encName = InjectionUtil.getEncName(field);
/* 94 */       if (!container.getEncInjectors().containsKey(encName))
/*    */       {
/* 96 */         container.getEncInjectors().put(encName, new LinkRefEncInjector(encName, ref.jndiName(), "@JndiInject"));
/*    */       }
/* 98 */       injectors.put(field, new JndiFieldInjector(field, encName, container.getEnc()));
/*    */     }
/*    */   }
View Full Code Here

   }

   private static String getLocalJndiName(JBossEnterpriseBeanMetaData ejb, Class<?> ejbClass)
   {
      // See if local binding is explicitly-defined
      LocalBinding localBinding = ejbClass.getAnnotation(LocalBinding.class);

      // If none specified
      if (localBinding == null || (localBinding.jndiBinding() != null && localBinding.jndiBinding().trim().length() == 0))
      {
         String name = ejb.getLocalJndiName();
         return name;
      }
      // Local Binding was explicitly-specified, use it
      else
      {
         return localBinding.jndiBinding();
      }
   }
View Full Code Here

      return proxyFactory.createProxyEjb21(id, businessInterfaceType);
   }
  
   public Object createProxyLocalEjb21(Object id, String businessInterfaceType) throws Exception
   {
      LocalBinding binding = this.getAnnotation(LocalBinding.class);
      return this.createProxyLocalEjb21(id,binding, businessInterfaceType);
   }
View Full Code Here

         {
            initParameterTypes = unadvisedMethod.getParameterTypes();
            initParameterValues = args;
         }

         LocalBinding binding = this.getAnnotation(LocalBinding.class);

         StatefulLocalProxyFactory factory = new StatefulLocalProxyFactory(this, binding);
         factory.init();

         Object proxy = factory.createProxyEjb21(initParameterTypes,
View Full Code Here

TOP

Related Classes of org.jboss.ejb3.annotation.JndiInject

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.