Package org.jboss.metadata.ejb.jboss

Examples of org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData


      String ejbName = MyStatefulBean.class.getSimpleName();
      Domain domain = getDomain("Stateful Bean");
      Hashtable<?,?> ctxProperties = null;
      Ejb3Deployment deployment = new MockEjb3Deployment(new MockDeploymentUnit());
      deployment.setPersistenceManagerFactoryRegistry(getBootstrap().lookup("EJB3PersistenceManagerFactoryRegistry", PersistenceManagerFactoryRegistry.class));
      JBossSessionBeanMetaData beanMetaData = MetaDataHelper.getMetadataFromBeanImplClass(MyStatefulBean.class);
      StatefulContainer container = new StatefulContainer(cl, beanClassname, ejbName, domain, ctxProperties, deployment, beanMetaData);
     
      // TODO: wickedness
      container.instantiated();
     
View Full Code Here


   }

   // TODO: integrate with StatelessContainer.initializeTimeout
   private void initializeTimeoutMethod()
   {
      JBossSessionBeanMetaData metaData = getMetaData();
      NamedMethodMetaData timeoutMethodMetaData = null;
      if (metaData != null)
         timeoutMethodMetaData = metaData.getTimeoutMethod();
      this.timeoutMethod = getTimeoutCallback(timeoutMethodMetaData, getBeanClass());
   }
View Full Code Here

   }

   @Override
   protected Set<Class<?>> getAllViews(ClassLoader cl)
   {
      JBossSessionBeanMetaData sessionBeanMetaData = (JBossSessionBeanMetaData) this.getBeanMetaData();
      Set<Class<?>> views = new HashSet<Class<?>>();
      try
      {
         // home
         String home = sessionBeanMetaData.getHome();
         if (home != null)
         {
            views.add(cl.loadClass(home));
         }
         // remote
         String remote = sessionBeanMetaData.getRemote();
         if (remote != null)
         {
            views.add(cl.loadClass(remote));
         }

         // local home
         String localHome = sessionBeanMetaData.getLocalHome();
         if (localHome != null)
         {
            views.add(cl.loadClass(localHome));
         }

         // local
         String local = sessionBeanMetaData.getLocal();
         if (local != null)
         {
            views.add(cl.loadClass(local));
         }

         // business locals
         BusinessLocalsMetaData businessLocals = sessionBeanMetaData.getBusinessLocals();
         if (businessLocals != null)
         {
            for (String businessLocal : businessLocals)
            {
               views.add(cl.loadClass(businessLocal));
            }
         }

         // business remotes
         BusinessRemotesMetaData businessRemotes = sessionBeanMetaData.getBusinessRemotes();
         if (businessRemotes != null)
         {
            for (String businessRemote : businessRemotes)
            {
               views.add(cl.loadClass(businessRemote));
            }
         }

         // service endpoint
         String serviceEndpoint = sessionBeanMetaData.getServiceEndpoint();
         if (serviceEndpoint != null)
         {
            views.add(cl.loadClass(serviceEndpoint));
         }
      }
View Full Code Here

   }

   @Override
   protected Class<?> getMethodInterface(ClassLoader cl, MethodInterfaceType methodIntf) throws ClassNotFoundException
   {
      JBossSessionBeanMetaData sessionBean = (JBossSessionBeanMetaData) this.getBeanMetaData();
      String className = null;
      if (methodIntf == null)
      {
         return this.getEjbClass();
      }
      switch (methodIntf)
      {
         case Home:
            String home = sessionBean.getHome();
            if (home == null || home.trim().isEmpty())
            {
               return null;
            }
            className = home;
            break;

         case Local:
            String local = sessionBean.getLocal();
            if (local == null || local.trim().isEmpty())
            {
               return null;
            }
            className = local;
            break;

         case LocalHome:
            String localHome = sessionBean.getLocalHome();
            if (localHome == null || localHome.isEmpty())
            {
               return null;
            }
            className = localHome;
            break;

         case Remote:
            String remote = sessionBean.getRemote();
            if (remote == null || remote.isEmpty())
            {
               return null;
            }
            className = remote;
            break;

         case ServiceEndpoint:
            String serviceEndPoint = sessionBean.getServiceEndpoint();
            if (serviceEndPoint == null || serviceEndPoint.isEmpty())
            {
               return null;
            }
            className = serviceEndPoint;
View Full Code Here

      DeploymentUnit unit = mock(DeploymentUnit.class);
      JBossMetaData metaData = new JBossMetaData();
      metaData.setEjbVersion("3.0");
      JBossEnterpriseBeansMetaData enterpriseBeans = new JBossEnterpriseBeansMetaData();
      JBossSessionBeanMetaData sessionBean = new JBossSessionBeanMetaData();
      sessionBean.setEjbName("Test");
      enterpriseBeans.add(sessionBean);
      metaData.setEnterpriseBeans(enterpriseBeans);
      when(unit.getAttachment(AttachmentNames.PROCESSED_METADATA, JBossMetaData.class)).thenReturn(metaData);
      DeploymentUnit component = mock(DeploymentUnit.class);
      when(unit.addComponent(JBossEnterpriseBeanMetaData.class.getName() + ".Test")).thenReturn(component);
View Full Code Here

//         addInterceptorBindingAnnotations(container, enterpriseBean, ejbName);
      }

      if (enterpriseBean instanceof JBossSessionBeanMetaData)
      {
         JBossSessionBeanMetaData sessionBean = (JBossSessionBeanMetaData) enterpriseBean;
         addInitAnnotations(container, sessionBean.getInitMethods(), ejbName);
         addRemoveAnnotations(container, sessionBean.getRemoveMethods(), ejbName);
      }
   }
View Full Code Here

   private void addInterceptorMethodAnnotations(EJBContainer container,
         JBossEnterpriseBeanMetaData enterpriseBean)
   {
      if (enterpriseBean instanceof JBossSessionBeanMetaData)
      {
         JBossSessionBeanMetaData sessionBean = (JBossSessionBeanMetaData) enterpriseBean;
         addInterceptorMethodAnnotation(container, enterpriseBean,
               sessionBean.getAroundInvokes(),
               AroundInvoke.class, "around-invoke-method");
         addInterceptorMethodAnnotation(container, enterpriseBean,
               sessionBean.getPostConstructs(),
               PostConstruct.class, "post-construct-method");
         addInterceptorMethodAnnotation(container, enterpriseBean,
               sessionBean.getPostActivates(),
               PostActivate.class, "post-activate-method");
         addInterceptorMethodAnnotation(container, enterpriseBean,
               sessionBean.getPrePassivates(),
               PrePassivate.class, "pre-passivate-method");
         addInterceptorMethodAnnotation(container, enterpriseBean,
               sessionBean.getPreDestroys(),
               PreDestroy.class, "pre-destroy-method");
      }
      else if (enterpriseBean instanceof JBossMessageDrivenBeanMetaData)
      {
         JBossMessageDrivenBeanMetaData messageDriven = (JBossMessageDrivenBeanMetaData) enterpriseBean;
View Full Code Here

      // Name of the EJB2.x Interface Class expected
      String ejb2xInterface = method.getReturnType().getName();

      // Get Metadata
      JBossSessionBeanMetaData smd = this.getMetaData();

      /*
       * Determine if the expected type is found in metadata as a EJB2.x Interface
       */

      // Is this a Remote Interface ?
      boolean isLocal = false;
      String ejb2xRemoteInterface = smd.getRemote();
      if (ejb2xInterface.equals(ejb2xRemoteInterface))
      {
         // We've found it, it's false
         foundInterface = true;
         jndiName = smd.getJndiName();
      }

      // Is this a local interface?
      if (!foundInterface)
      {
         String ejb2xLocalInterface = smd.getLocal();
         if (ejb2xInterface.equals(ejb2xLocalInterface))
         {
            // Mark as found
            foundInterface = true;
            isLocal = true;
            jndiName = smd.getLocalJndiName();
         }
      }

      // If we haven't yet found the interface
      if (!foundInterface)
View Full Code Here

         // Determine if local/remote
         boolean isLocal = EJBLocalObject.class.isAssignableFrom(unadvisedMethod.getDeclaringClass());

         // Get the metadata
         JBossSessionBeanMetaData smd = this.getMetaData();

         // Get the appropriate JNDI Name
         String jndiName = isLocal ? smd.getLocalJndiName() : smd.getJndiName();

         // Find the Proxy Factory Key for this SFSB
         String proxyFactoryKey = sfsbJndiRegistrar.getProxyFactoryRegistryKey(jndiName, smd, isLocal);

         // Lookup the Proxy Factory in the Object Store
View Full Code Here

  
            // Determine if local/remote
            boolean isLocal = EJBLocalObject.class.isAssignableFrom(unadvisedMethod.getDeclaringClass());
  
            // Get the metadata
            JBossSessionBeanMetaData smd = this.getMetaData();
  
            // Get the appropriate JNDI Name
            String jndiName = isLocal ? smd.getLocalJndiName() : smd.getJndiName();
  
            // Find the Proxy Factory Key for this SFSB
            String proxyFactoryKey = sfsbJndiRegistrar.getProxyFactoryRegistryKey(jndiName, smd, isLocal);
  
            // Lookup the Proxy Factory in the Object Store
View Full Code Here

TOP

Related Classes of org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData

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.