Package org.jboss.ejb3.annotation

Examples of org.jboss.ejb3.annotation.Depends


   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

   {
   }

   public void handleMethodAnnotations(Method method, InjectionContainer container, Map<AccessibleObject, Injector> injectors)
   {
      Depends dep = container.getAnnotation(Depends.class, method.getDeclaringClass(), method);
      if (dep != null)
      {
         if (!method.getName().startsWith("set"))
            throw new RuntimeException("@EJB can only be used with a set method: " + method);
         String[] names = dep.value();
         if (names.length != 1)
            throw new RuntimeException("@Depends on a field can only take one object name: " + method);
         ObjectName on = null;
         try
         {
View Full Code Here

      }
   }

   public void handleFieldAnnotations(Field field, InjectionContainer container, Map<AccessibleObject, Injector> injectors)
   {
      Depends dep = container.getAnnotation(Depends.class, field.getDeclaringClass(), field);
      if (dep != null)
      {
         String[] names = dep.value();
         if (names.length != 1)
            throw new RuntimeException("@Depends on a field can only take one object name: " + field);
         ObjectName on = null;
         try
         {
View Full Code Here

      }
   }

   public void handleClassAnnotations(Class<?> clazz, InjectionContainer container)
   {
      Depends dep = container.getAnnotation(Depends.class, clazz);
      if (dep == null) return;
      for (String dependency : dep.value())
      {
         container.getDependencyPolicy().addDependency(dependency);
      }
   }
View Full Code Here

/*     */   {
/*     */   }
/*     */
/*     */   public void handleMethodAnnotations(Method method, InjectionContainer container, Map<AccessibleObject, Injector> injectors)
/*     */   {
/*  51 */     Depends dep = (Depends)container.getAnnotation(Depends.class, method.getDeclaringClass(), method);
/*  52 */     if (dep != null)
/*     */     {
/*  54 */       if (!method.getName().startsWith("set"))
/*  55 */         throw new RuntimeException("@EJB can only be used with a set method: " + method);
/*  56 */       String[] names = dep.value();
/*  57 */       if (names.length != 1)
/*  58 */         throw new RuntimeException("@Depends on a field can only take one object name: " + method);
/*  59 */       ObjectName on = null;
/*     */       try
/*     */       {
View Full Code Here

/*     */     }
/*     */   }
/*     */
/*     */   public void handleFieldAnnotations(Field field, InjectionContainer container, Map<AccessibleObject, Injector> injectors)
/*     */   {
/*  79 */     Depends dep = (Depends)container.getAnnotation(Depends.class, field.getDeclaringClass(), field);
/*  80 */     if (dep != null)
/*     */     {
/*  82 */       String[] names = dep.value();
/*  83 */       if (names.length != 1)
/*  84 */         throw new RuntimeException("@Depends on a field can only take one object name: " + field);
/*  85 */       ObjectName on = null;
/*     */       try
/*     */       {
View Full Code Here

/*     */     }
/*     */   }
/*     */
/*     */   public void handleClassAnnotations(Class<?> clazz, InjectionContainer container)
/*     */   {
/* 105 */     Depends dep = (Depends)container.getAnnotation(Depends.class, clazz);
/* 106 */     if (dep == null) return;
/* 107 */     for (String dependency : dep.value())
/*     */     {
/* 109 */       container.getDependencyPolicy().addDependency(dependency);
/*     */     }
/*     */   }
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

TOP

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

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.