Package org.jboss.aop

Examples of org.jboss.aop.Domain$DomainClassifiedBindingCollection


      return manager;
   }
  
   private static AspectManager createNewDomain(AspectManager parent, String name)
   {
      Domain domain = new Domain(parent, name, true);
      domain.setInheritsBindings(true);
      domain.setInheritsDeclarations(true);
      return domain;
   }
View Full Code Here


      super(name);
   }

   public void testDomainWithParentInheritance()
   {
      Domain parentFirst = getDomainAndCheck("Level2ParentFirst", true, true, true);
      List<AnnotationIntroduction> overridesFirst = parentFirst.getAnnotationOverrides();
      assertEquals(2, overridesFirst.size());
     
      assertNotNull(parentFirst.getClassMetaDataLoaders());
      assertEquals(1, parentFirst.getClassMetaDataLoaders().size());

      Domain parentLast = getDomainAndCheck("Level2ParentLast", true, true, false);
      List<AnnotationIntroduction> overridesLast = parentLast.getAnnotationOverrides();
      assertEquals(2, overridesLast.size());

      assertNotNull(parentLast.getClassMetaDataLoaders());
      assertEquals(1, parentLast.getClassMetaDataLoaders().size());
     
      assertEquals(overridesFirst.get(0).getOriginalAnnotationExpr(), overridesLast.get(1).getOriginalAnnotationExpr());
      assertEquals(overridesFirst.get(1).getOriginalAnnotationExpr(), overridesLast.get(0).getOriginalAnnotationExpr());
   }
View Full Code Here

      assertEquals(overridesFirst.get(1).getOriginalAnnotationExpr(), overridesLast.get(0).getOriginalAnnotationExpr());
   }
  
   public void testDomainWithNoInheritanceFromParent()
   {
      Domain level2 = getDomainAndCheck("Level2Nada", false, false, false);
      List<AnnotationIntroduction> overrides = level2.getAnnotationOverrides();
      assertEquals(0, overrides.size());

      Map<String, ClassMetaDataLoader> loaders = level2.getClassMetaDataLoaders();
      assertEquals(0, loaders.size());
}
View Full Code Here

      assertEquals(0, loaders.size());
}
  
   private Domain getDomainAndCheck(String name, boolean inheritBindings, boolean inheritDefinitions, boolean isParentFirst)
   {
      Domain level1 = (Domain)getDomain("Level1");
      checkLevel1Domain(null, level1);

      Domain level2 = (Domain)getDomain(name);
      checkDomain(level1, level2, name, inheritBindings, inheritDefinitions, isParentFirst);
      return level2;
   }
View Full Code Here

   private Map<Object, Domain> scopedClassLoaderDomains = new WeakHashMap<Object, Domain>();

   public Domain initializeDomain(VFSDeploymentUnit unit)
   {
      ClassLoader loader = unit.getClassLoader();
      Domain domain = getDomain(loader, AspectManager.getTopLevelAspectManager());
     
      AspectManager.instance().registerClassLoader(loader); //Ends up in classpool factory create method

      return domain;
   }
View Full Code Here

   public synchronized Domain getDomain(ClassLoader classLoader, AspectManager parent)
   {
      ClassLoader scopedClassLoader = ifScopedDeploymentGetScopedParentUclForCL(classLoader);
      if (scopedClassLoader != null)
      {
         Domain scopedManager = null;
         synchronized (AOPClassPoolRepository.getInstance().getRegisteredCLs())
         {
            Object loaderRepository = getLoaderRepository(classLoader);
            scopedManager = scopedClassLoaderDomains.get(loaderRepository);
           
            // FIXME: JBAOP-107 REMOVE THIS HACK
            if (scopedManager != null && scopedManager.isValid() == false)
            {
               scopedClassLoaderDomains.remove(loaderRepository);
               scopedManager = null;
            }
           
            if (scopedManager == null)
            {
               scopedManager = getScopedClassLoaderDomain(scopedClassLoader, parent);
               log.debug("Created domain " + scopedManager + " for scoped deployment on: " +
                        classLoader + "; identifying scoped ucl: " + scopedClassLoader);
               scopedManager.setInheritsBindings(true);
               scopedManager.setInheritsDeclarations(true);
              
               scopedClassLoaderDomains.put(loaderRepository, scopedManager);
            }
            return scopedManager;
         }
View Full Code Here

      //Scoped AOP deployments are only available when deployed as part of a scoped sar, ear etc.
      //It can contain an aop.xml file, or it can be part of a .aop file
      //Linking a standalone -aop.xml file onto a scoped deployment is not possible at the moment
      AOPClassLoaderScopingPolicy policy = AspectManager.getClassLoaderScopingPolicy();

      Domain domain = null;
      if (policy != null)
      {
         if (policy instanceof DomainInitializer == false)
         {
            throw new RuntimeException(policy + " must implement DomainInitializer");
View Full Code Here

   }
  
   public Domain getDomain(ClassLoader classLoader, AspectManager parent)
   {
      //Check the stored domains
      Domain domain = registry.getRegisteredDomain(classLoader);
      if (domain != null)
      {
         return domain;
      }
     
View Full Code Here

      //Scoped AOP deployments are only available when deployed as part of a scoped sar, ear etc.
      //It can contain an aop.xml file, or it can be part of a .aop file
      //Linking a standalone -aop.xml file onto a scoped deployment is not possible at the moment
      AOPClassLoaderScopingPolicy policy = AspectManager.getClassLoaderScopingPolicy();

      Domain domain = null;
      if (policy != null)
      {
         if (policy instanceof DomainInitializer == false)
         {
            throw new RuntimeException(policy + " must implement DomainInitializer");
View Full Code Here

  
   private AspectManager getCorrectManager(final VFSDeploymentUnit unit)
   {
      //Scoped AOP deployments are only available when deployed as part of a scoped sar, ear etc.
      //It can contain an aop.xml file, or it can be part of a .aop file
      Domain domain = AOPClassLoaderInitializer.initializeForUnit(unit);
      if (domain != null)
      {
         return domain;
      }
     
View Full Code Here

TOP

Related Classes of org.jboss.aop.Domain$DomainClassifiedBindingCollection

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.