Package org.jboss.aop

Examples of org.jboss.aop.Advisor$DeployAnnotationOverrideAction


   }

   public static boolean getRollbackOnly()
   {
      Invocation currentInvocation = CurrentInvocation.getCurrentInvocation();
      Advisor advisor = currentInvocation.getAdvisor();
      // EJB1.1 11.6.1: Must throw IllegalStateException if BMT
      TransactionManagementType type = TxUtil.getTransactionManagementType(advisor);
      if (type != TransactionManagementType.CONTAINER)
         throw new IllegalStateException("Container " + advisor.getName() + ": it is illegal to call getRollbackOnly from BMT: " + type);

      // TODO: we should really ask a TxType object to handle getRollbackOnly()
      if(getTxType(currentInvocation) == TransactionAttributeType.SUPPORTS)
         throw new IllegalStateException("getRollbackOnly() not allowed with TransactionAttributeType.SUPPORTS (EJB 3 13.6.2.9)");
     
View Full Code Here


         throw new IllegalStateException("It's not allowed to get the UserTransaction during construction and injection " + ctx);
      // Is construction happening from within another bean?
      if(ctx.getInstance() != invocation.getTargetObject())
         throw new IllegalStateException("It's not allowed to get the UserTransaction during construction and injection " + ctx);
     
      Advisor advisor = invocation.getAdvisor();
      TransactionManagementType type = TxUtil.getTransactionManagementType(advisor);
      if (type != TransactionManagementType.BEAN) throw new IllegalStateException("Container " + advisor.getName() + ": it is illegal to inject UserTransaction into a CMT bean");

      return new UserTransactionImpl();  
   }
View Full Code Here

      return new UserTransactionImpl();  
   }
  
   public static void setRollbackOnly()
   {
      Advisor advisor = CurrentInvocation.getCurrentInvocation().getAdvisor();
      // EJB1.1 11.6.1: Must throw IllegalStateException if BMT
      TransactionManagementType type = TxUtil.getTransactionManagementType(advisor);
      if (type != TransactionManagementType.CONTAINER) throw new IllegalStateException("Container " + advisor.getName() + ": it is illegal to call setRollbackOnly from BMT: " + type);

      try
      {
         TransactionManager tm = TxUtil.getTransactionManager();
View Full Code Here

      {
         // set the dependency policy
         this.dependencyPolicy = deployment.createDependencyPolicy(this);
      }
     
      Advisor advisor = getAdvisor();
      AdviceStack stack = advisor.getManager().getAdviceStack("InjectionCallbackStack");
      if(stack == null)
         throw new IllegalStateException("EJBTHREE-2020: No InjectionCallbackStack defined for domain " + domain + " of " + this);
      injectionCallbackStack = stack.createInterceptors(advisor, null);

      this.effigy = effigy(classloader, beanMetaData);
View Full Code Here

         // have fully integrated SwitchBoard and jboss-injection in place
         if(injectors == null)
         {
            this.injectors = new ArrayList<Injector>();
         }
         Advisor advisor = getAdvisor();
         InjectionInvocation invocation = new InjectionInvocation(beanContext, injectors, injectionCallbackStack, this.injectionManager);
         invocation.setAdvisor(advisor);
         invocation.setTargetObject(beanContext.getInstance());
         invocation.invokeNext();
      }
View Full Code Here

   {
      // Get the current invocation ID
      final AsyncInvocationId id = CurrentAsyncInvocation.getCurrentAsyncInvocationId(invocation);

      // Get at the current invocations via the container
      final Advisor advisor = invocation.getAdvisor();
      final EJBContainer ejbContainer = EJBContainer.getEJBContainer(advisor);
      if (ejbContainer instanceof ServiceContainer || ejbContainer instanceof MessagingContainer)
      {
         return invocation.invokeNext();
      }
View Full Code Here

         {
            advisorClass = manager.getAdvisor(info.getClazz()).getClass();
         }
         catch(ClassCastException e)
         {
            Advisor advisor = manager.findAdvisor(info.getClazz());
            if (advisor != null && !( advisor instanceof ClassAdvisor))
            {
               //The advisor is a ClassContainer or something like that, so ignore this joinpoint
               return;
            }
View Full Code Here

      {
         logger.trace("Received dynamic invocation for method with hash: " + methodHash);
      }

      // Get the Method via MethodInfo from the Advisor
      Advisor advisor = this.getAdvisor();
      MethodInfo methodInfo = advisor.getMethodInfo(methodHash);

      // create a container invocation
      AOPBasedContainerInvocation containerInvocation = new AOPBasedContainerInvocation(methodInfo,
            methodInvocation.getArguments());
      try
View Full Code Here

   }

   public void initialize(EJBContainer container) throws Exception
   {
      this.container = (StatefulContainer) container;
      Advisor advisor = container.getAdvisor();
      cacheMap = new CacheMap();
      PersistenceManager pmConfig = (PersistenceManager) advisor.resolveAnnotation(PersistenceManager.class);
      EJBContainer ejbContainer = (EJBContainer)container;
      String pmConfigValue = pmConfig.value();
      PersistenceManagerFactoryRegistry pmFactoryRegistry = ejbContainer.getDeployment()
            .getPersistenceManagerFactoryRegistry();
      PersistenceManagerFactory pmFactory = pmFactoryRegistry.getPersistenceManagerFactory(pmConfigValue);
      this.pm = pmFactory.createPersistenceManager();
      pm.initialize(container);
      CacheConfig config = (CacheConfig) advisor.resolveAnnotation(CacheConfig.class);
      maxSize = config.maxSize();
      sessionTimeout = config.idleTimeoutSeconds();
      removalTimeout = config.removalTimeoutSeconds();
      log = Logger.getLogger(getClass().getName() + "." + container.getEjbName());
      log.debug("Initializing SimpleStatefulCache with maxSize: " +maxSize + " timeout: " +sessionTimeout +
View Full Code Here

         // Get the method hash
         long methodHash = si.getMethodHash();
         log.debug("Received dynamic invocation for method with hash: " + methodHash);

         // Get the Method via MethodInfo from the Advisor
         Advisor advisor = this.getAdvisor();
         MethodInfo info = advisor.getMethodInfo(methodHash);
         Method unadvisedMethod = info.getMethod();
         SerializableMethod unadvisedMethodSerializable = new SerializableMethod(unadvisedMethod);

         // Get the invoked method from invocation metadata
         Object objInvokedMethod = si.getMetaData(SessionSpecRemotingMetadata.TAG_SESSION_INVOCATION,
View Full Code Here

TOP

Related Classes of org.jboss.aop.Advisor$DeployAnnotationOverrideAction

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.