Package org.jboss.ejb3

Examples of org.jboss.ejb3.EJBContainer


      container.getEncInjectors().put(encName, injector);
   }

   public static EJBContainer getEjbContainer(EJB ref, InjectionContainer container, Class<?> memberType)
   {
      EJBContainer rtn = null;

      if (ref.mappedName() != null && !"".equals(ref.mappedName()))
      {
         return null;
      }
View Full Code Here


   }

   public static ApplicationException getApplicationException(Class<?> exceptionClass, Invocation invocation)
   {
      MethodInvocation ejb = (MethodInvocation) invocation;
      EJBContainer container = (EJBContainer) ejb.getAdvisor();

      // TODO: Wolf: refactor onto a unified metadata view
     
      if (exceptionClass.isAnnotationPresent(ApplicationException.class))
         return (ApplicationException)exceptionClass.getAnnotation(ApplicationException.class);

      JBossAssemblyDescriptorMetaData assembly = container.getAssemblyDescriptor();

      if (assembly != null)
      {
         ApplicationExceptionsMetaData exceptions = assembly.getApplicationExceptions();
         if (exceptions != null)
View Full Code Here

//         container.getDependencyPolicy().addDependency(refcon.getObjectName().getCanonicalName());
//   }
  
   protected void addDependency(InjectionContainer container, Class businessIntf)
   {
      EJBContainer refCon = null;
      try
      {
         refCon = (EJBContainer) container.resolveEjbContainer(businessIntf);
      }
      catch(NameNotFoundException e)
View Full Code Here

      ((JBoss5DependencyPolicy) container.getDependencyPolicy()).addDependency(businessIntf);
   }
  
   protected void addDependency(InjectionContainer container, String link, Class<?> businessIntf)
   {
      EJBContainer refCon = (EJBContainer) container.resolveEjbContainer(link, businessIntf);
     
      // Do not depend on myself
      if(container.equals(refCon))
         return;
     
View Full Code Here

   }

   public void start() throws Exception
   {
      super.start();
      EJBContainer statelessContainer = (EJBContainer) getContainer();
      RemoteHome remoteHome = (RemoteHome) statelessContainer.resolveAnnotation(RemoteHome.class);
      if (remoteHome != null && !bindHomeAndBusinessTogether(statelessContainer))
      {
         Object homeProxy = createHomeProxy(remoteHome.value());
         String jndiName = ProxyFactoryHelper.getHomeJndiName(getContainer());
         try
View Full Code Here

   }

   public void stop() throws Exception
   {
      super.stop();
      EJBContainer statelessContainer = (EJBContainer) getContainer();
      RemoteHome remoteHome = (RemoteHome) statelessContainer.resolveAnnotation(RemoteHome.class);
      if (remoteHome != null && !bindHomeAndBusinessTogether(statelessContainer))
      {
         Util.unbind(getContainer().getInitialContext(), ProxyFactoryHelper.getHomeJndiName(getContainer()));
      }
   }
View Full Code Here

   public Object createPerJoinpoint(Advisor advisor, Joinpoint jp)
   {
      if (jp instanceof MethodJoinpoint)
      {
         EJBContainer container = (EJBContainer) advisor;
         Class beanClass = container.getBeanClass();

         try
         {
            Method method = ((MethodJoinpoint) jp).getMethod();
            if (container.isBusinessMethod(method))
            {
               InterceptorInfo[] infos = container.getInterceptorRepository().getBusinessInterceptors(container, method);
               Method[] beanAroundInvoke = container.getInterceptorRepository().getBeanClassAroundInvokes(container);
               Object infoString = "[]";
               if (infoString != null)
                  infoString = Arrays.asList(infos);
               log.debug("Bound interceptors for joinpoint: " + method + " - " + infoString);
               return new EJB3InterceptorsInterceptor(infos, beanAroundInvoke);
View Full Code Here

  
   abstract protected Handle getHandle();
  
   protected HomeHandle getHomeHandle()
   {
      EJBContainer ejbContainer = (EJBContainer)container;
     
      HomeHandleImpl homeHandle = null;
     
      RemoteBinding remoteBindingAnnotation = (RemoteBinding)ejbContainer.resolveAnnotation(RemoteBinding.class);
      if (remoteBindingAnnotation != null)
         homeHandle = new HomeHandleImpl(ProxyFactoryHelper.getHomeJndiName(container));
     
      return homeHandle;
   }
View Full Code Here

      Class remote = null;
      Class home = null;
      Class pkClass = Object.class;
      HomeHandleImpl homeHandle = null;
     
      EJBContainer ejbContainer = (EJBContainer)container;
     
      Remote remoteAnnotation = (Remote)ejbContainer.resolveAnnotation(Remote.class);
      if (remoteAnnotation != null)
         remote = remoteAnnotation.value()[0];
      RemoteHome homeAnnotation = (RemoteHome)ejbContainer.resolveAnnotation(RemoteHome.class);
      if (homeAnnotation != null)
         home = homeAnnotation.value();
      RemoteBinding remoteBindingAnnotation = (RemoteBinding)ejbContainer.resolveAnnotation(RemoteBinding.class);
      if (remoteBindingAnnotation != null)
         homeHandle = new HomeHandleImpl(remoteBindingAnnotation.jndiBinding());
     
      EJBMetaDataImpl metadata = new EJBMetaDataImpl(remote, home, pkClass, true, false, homeHandle);
     
View Full Code Here

      super(container, binding.jndiBinding());
   }

   protected Class<?>[] getInterfaces()
   {
      EJBContainer statelessContainer = (EJBContainer)getContainer();
      LocalHome localHome = (LocalHome)statelessContainer.resolveAnnotation(LocalHome.class);

      boolean bindTogether = false;

      if (localHome != null && bindHomeAndBusinessTogether(statelessContainer))
         bindTogether = true;
View Full Code Here

TOP

Related Classes of org.jboss.ejb3.EJBContainer

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.