Package org.jboss.ejb3

Examples of org.jboss.ejb3.EJBContainer


   }


   public Object createPerClass(Advisor advisor)
   {
      EJBContainer container = EJBContainer.getEJBContainer(advisor);

      Object domain = null;
      try
      {
         InitialContext ctx = container.getInitialContext();
         SecurityDomain securityDomain = (SecurityDomain) advisor.resolveAnnotation(SecurityDomain.class);
         if (securityDomain != null)
         {
            String domainName = securityDomain.value();
            domain = SecurityDomainManager.getSecurityManager(domainName, ctx);
View Full Code Here


/*     */     {
/* 113 */       log.warn("TIMER SERVICE IS NOT INSTALLED");
/* 114 */       return;
/*     */     }
/* 116 */     TimerServiceFacade timerService = (TimerServiceFacade)aTimerService;
/* 117 */     EJBContainer container = timerService.getContainer();
/*     */
/* 119 */     ClassLoader loader = container.getClassloader();
/*     */
/* 121 */     getEJBTimerService().restoreTimers(timerService.getContainerId(), loader);
/*     */   }
View Full Code Here

/* 164 */     container.getEncInjectors().put(encName, injector);
/*     */   }
/*     */
/*     */   public static EJBContainer getEjbContainer(EJB ref, InjectionContainer container, Class<?> memberType)
/*     */   {
/* 169 */     EJBContainer rtn = null;
/*     */
/* 171 */     if ((ref.mappedName() != null) && (!"".equals(ref.mappedName())))
/*     */     {
/* 173 */       return null;
/*     */     }
View Full Code Here

/*    */ public abstract class AbstractHandler<X extends RemoteEnvironment>
/*    */   implements InjectionHandler<X>
/*    */ {
/*    */   protected void addDependency(InjectionContainer container, Class businessIntf)
/*    */   {
/* 47 */     EJBContainer refCon = null;
/*    */     try
/*    */     {
/* 50 */       refCon = (EJBContainer)container.resolveEjbContainer(businessIntf);
/*    */     }
/*    */     catch (NameNotFoundException e)
View Full Code Here

/* 60 */     ((JBoss5DependencyPolicy)container.getDependencyPolicy()).addDependency(businessIntf);
/*    */   }
/*    */
/*    */   protected void addDependency(InjectionContainer container, String link, Class<?> businessIntf)
/*    */   {
/* 65 */     EJBContainer refCon = (EJBContainer)container.resolveEjbContainer(link, businessIntf);
/*    */
/* 68 */     if (container.equals(refCon)) {
/* 69 */       return;
/*    */     }
/* 71 */     ((JBoss5DependencyPolicy)container.getDependencyPolicy()).addDependency(link, businessIntf);
View Full Code Here

/*    */   }
/*    */
/*    */   public static ApplicationException getApplicationException(Class<?> exceptionClass, Invocation invocation)
/*    */   {
/* 74 */     MethodInvocation ejb = (MethodInvocation)invocation;
/* 75 */     EJBContainer container = (EJBContainer)ejb.getAdvisor();
/*    */
/* 79 */     if (exceptionClass.isAnnotationPresent(ApplicationException.class)) {
/* 80 */       return (ApplicationException)exceptionClass.getAnnotation(ApplicationException.class);
/*    */     }
/* 82 */     JBossAssemblyDescriptorMetaData assembly = container.getAssemblyDescriptor();
/*    */
/* 84 */     if (assembly != null)
/*    */     {
/* 86 */       ApplicationExceptionsMetaData exceptions = assembly.getApplicationExceptions();
/* 87 */       if (exceptions != null)
View Full Code Here

/*    */   }
/*    */
/*    */   public Object invoke(Invocation invocation) throws Throwable
/*    */   {
/* 52 */     EJBContainerInvocation ejb = (EJBContainerInvocation)invocation;
/* 53 */     EJBContainer container = ejb.getAdvisor();
/* 54 */     Pool pool = container.getPool();
/* 55 */     BeanContext ctx = pool.get();
/* 56 */     ejb.setTargetObject(ctx.getInstance());
/* 57 */     ejb.setBeanContext(ctx);
/* 58 */     container.pushContext(ctx);
/*    */
/* 60 */     boolean discard = false;
/*    */     try
/*    */     {
/* 64 */       localObject1 = ejb.invokeNext();
/*    */     }
/*    */     catch (Exception ex)
/*    */     {
/*    */       Object localObject1;
/* 68 */       discard = ((ex instanceof EJBException)) || ((((ex instanceof RuntimeException)) || ((ex instanceof RemoteException))) && (!StatefulInstanceInterceptor.isApplicationException(ex.getClass(), container)));
/*    */
/* 70 */       throw ex;
/*    */     }
/*    */     finally
/*    */     {
/* 74 */       container.popContext();
/* 75 */       ejb.setTargetObject(null);
/* 76 */       ejb.setBeanContext(null);
/* 77 */       if (discard) pool.discard(ctx); else
/* 78 */         pool.release(ctx);
/*    */     }
View Full Code Here

/*  70 */     return new RunAsIdentity(runAs.value(), runAsPrincipal, extraRoles);
/*     */   }
/*     */
/*     */   public Object createPerClass(Advisor advisor)
/*     */   {
/*  76 */     EJBContainer container = (EJBContainer)advisor;
/*  77 */     RunAsIdentity runAsIdentity = getRunAsIdentity(container);
/*     */
/*  83 */     Object domain = null;
/*     */     try
/*     */     {
/*  86 */       InitialContext ctx = container.getInitialContext();
/*  87 */       SecurityDomain securityDomain = (SecurityDomain)advisor.resolveAnnotation(SecurityDomain.class);
/*  88 */       if (securityDomain != null)
/*     */       {
/*  90 */         String domainName = securityDomain.value();
/*  91 */         domain = SecurityDomainManager.getSecurityManager(domainName, ctx);
View Full Code Here

/*     */
/*     */   public Object createPerJoinpoint(Advisor advisor, Joinpoint jp)
/*     */   {
/*  83 */     if ((jp instanceof MethodJoinpoint))
/*     */     {
/*  85 */       EJBContainer container = (EJBContainer)advisor;
/*  86 */       Class beanClass = container.getBeanClass();
/*     */       try
/*     */       {
/*  90 */         Method method = ((MethodJoinpoint)jp).getMethod();
/*  91 */         if (container.isBusinessMethod(method))
/*     */         {
/*  93 */           InterceptorInfo[] infos = container.getInterceptorRepository().getBusinessInterceptors(container, method);
/*  94 */           Method[] beanAroundInvoke = container.getInterceptorRepository().getBeanClassAroundInvokes(container);
/*  95 */           Object infoString = "[]";
/*  96 */           if (infoString != null)
/*  97 */             infoString = Arrays.asList(infos);
/*  98 */           log.debug("Bound interceptors for joinpoint: " + method + " - " + infoString);
/*  99 */           return new EJB3InterceptorsInterceptor(infos, beanAroundInvoke);
View Full Code Here

/*  52 */     super(container, binding.jndiBinding());
/*     */   }
/*     */
/*     */   protected Class<?>[] getInterfaces()
/*     */   {
/*  57 */     EJBContainer statelessContainer = (EJBContainer)getContainer();
/*  58 */     LocalHome localHome = (LocalHome)statelessContainer.resolveAnnotation(LocalHome.class);
/*     */
/*  60 */     boolean bindTogether = false;
/*     */
/*  62 */     if ((localHome != null) && (bindHomeAndBusinessTogether(statelessContainer))) {
/*  63 */       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.