Package org.jboss.metadata.ejb.spec

Examples of org.jboss.metadata.ejb.spec.InitMethodsMetaData


     
      if(bean.getSessionType() != SessionType.Stateful)
         throw new IllegalArgumentException("Init annotation is only valid on a stateful bean");
     
      if(bean.getInitMethods() == null)
         bean.setInitMethods(new InitMethodsMetaData());
     
      bean.getInitMethods().add(initMethod);
   }
View Full Code Here



        SessionBeanMetaData data = description.getDescriptorData();
        if (data instanceof SessionBean31MetaData) {
            SessionBean31MetaData metaData = (SessionBean31MetaData) data;
            final InitMethodsMetaData inits = metaData.getInitMethods();
            if (inits != null) {
                for (InitMethodMetaData method : inits) {
                    Method beanMethod = MethodResolutionUtils.resolveMethod(method.getBeanMethod(), componentClass, deploymentReflectionIndex);
                    if (method.getCreateMethod() != null) {
                        MethodParametersMetaData p = method.getCreateMethod().getMethodParams();
View Full Code Here

     
      if(bean.getSessionType() != SessionType.Stateful)
         throw new IllegalArgumentException("Init annotation is only valid on a stateful bean");
     
      if(bean.getInitMethods() == null)
         bean.setInitMethods(new InitMethodsMetaData());
     
      bean.getInitMethods().add(initMethod);
   }
View Full Code Here

     
      if(bean.getSessionType() != SessionType.Stateful)
         throw new IllegalArgumentException("Init annotation is only valid on a stateful bean");
     
      if(bean.getInitMethods() == null)
         bean.setInitMethods(new InitMethodsMetaData());
     
      bean.getInitMethods().add(initMethod);
   }
View Full Code Here


        SessionBeanMetaData data = description.getDescriptorData();
        if (data instanceof SessionBean31MetaData) {
            SessionBean31MetaData metaData = (SessionBean31MetaData) data;
            final InitMethodsMetaData inits = metaData.getInitMethods();
            if (inits != null) {
                for (InitMethodMetaData method : inits) {
                    Method beanMethod = MethodResolutionUtils.resolveMethod(method.getBeanMethod(), componentClass, deploymentReflectionIndex);
                    if (method.getCreateMethod() != null) {
                        MethodParametersMetaData p = method.getCreateMethod().getMethodParams();
View Full Code Here

      JBossSessionBeanMetaData bean = (JBossSessionBeanMetaData) metaData.getEnterpriseBean("MultiviewBean");
      assertNotNull(bean);
      assertEquals(MultiviewHome.class.getName(), bean.getHome());
      assertEquals(Multiview21Remote.class.getName(), bean.getRemote());
      assertEquals(SetHelper.createSet(Multiview3Remote.class.getName()), bean.getBusinessRemotes());
      InitMethodsMetaData initMethods = bean.getInitMethods();
      assertNotNull(initMethods);
      assertEquals(1, initMethods.size());
      InitMethodMetaData initMethod = initMethods.get(0);
      assertEquals("create", initMethod.getBeanMethod().getMethodName());
   }
View Full Code Here

      assertEquals(1, preDestroys.size());
      LifecycleCallbackMetaData preDestroy = preDestroys.get(0);
      assertEquals("tearDown", preDestroy.getMethodName());
      assertEquals(MyStatefulBean.class.getName(), preDestroy.getClassName());
      // @Init
      InitMethodsMetaData initMethods = bean.getInitMethods();
      assertNotNull(initMethods);
      assertEquals(1, initMethods.size());
      InitMethodMetaData initMethod = initMethods.get(0);
      assertEquals("init", initMethod.getBeanMethod().getMethodName());
      // @PostActivate
      LifecycleCallbacksMetaData postActivates = bean.getPostActivates();
      assertNotNull(postActivates);
      assertEquals(1, postActivates.size());
View Full Code Here

   }
  
   public void testInitMethods()
   {
      // Override
      InitMethodsMetaData overrideInitMethods = new InitMethodsMetaData();
      InitMethodMetaData overrideInitMethod = new InitMethodMetaData();
      NamedMethodMetaData overrideNamedMethod = new NamedMethodMetaData();
      overrideNamedMethod.setMethodName("overrideMethodName");
      overrideInitMethod.setId("overrideId");
      overrideInitMethods.add(overrideInitMethod);
     
      JBossSessionBeanMetaData override = new JBossSessionBeanMetaData();
      override.setInitMethods(overrideInitMethods);
      override.setName("name");
     
      // Original
      InitMethodsMetaData originalInitMethods = new InitMethodsMetaData();
      InitMethodMetaData originalInitMethod = new InitMethodMetaData();
      NamedMethodMetaData originalNamedMethod = new NamedMethodMetaData();
      originalNamedMethod.setMethodName("originalMethodName");
      originalInitMethod.setId("originalId");
      originalInitMethods.add(originalInitMethod);
     
      JBossSessionBeanMetaData original = new JBossSessionBeanMetaData();
      original.setInitMethods(originalInitMethods);
     
      // Merged
      JBossSessionBeanMetaData merged = new JBossSessionBeanMetaData();
      merged.merge(override, original);
      InitMethodsMetaData initMethods = merged.getInitMethods();
      assertNotNull(initMethods);
      InitMethodMetaData initMethod = initMethods.get(0);
      assertNotNull(initMethod);
      assertEquals("overrideId", initMethod.getId());
   }
View Full Code Here

      assertEquals(1, preDestroys.size());
      LifecycleCallbackMetaData preDestroy = preDestroys.get(0);
      assertEquals("tearDown", preDestroy.getMethodName());
      assertEquals(MyStatefulBean.class.getName(), preDestroy.getClassName());
      // @Init
      InitMethodsMetaData initMethods = bean.getInitMethods();
      assertNotNull(initMethods);
      assertEquals(1, initMethods.size());
      InitMethodMetaData initMethod = initMethods.get(0);
      assertEquals("init", initMethod.getBeanMethod().getMethodName());
      // @PostActivate
      LifecycleCallbacksMetaData postActivates = bean.getPostActivates();
      assertNotNull(postActivates);
      assertEquals(1, postActivates.size());
View Full Code Here

      assertEquals(1, preDestroys.size());
      LifecycleCallbackMetaData preDestroy = preDestroys.get(0);
      assertEquals("tearDown", preDestroy.getMethodName());
      assertEquals(MyStatefulBean.class.getName(), preDestroy.getClassName());
      // @Init
      InitMethodsMetaData initMethods = bean.getInitMethods();
      assertNotNull(initMethods);
      assertEquals(1, initMethods.size());
      InitMethodMetaData initMethod = initMethods.get(0);
      assertEquals("init", initMethod.getBeanMethod().getMethodName());
      // @PostActivate
      LifecycleCallbacksMetaData postActivates = bean.getPostActivates();
      assertNotNull(postActivates);
      assertEquals(1, postActivates.size());
View Full Code Here

TOP

Related Classes of org.jboss.metadata.ejb.spec.InitMethodsMetaData

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.