Package org.jboss.metadata.spi.scope

Examples of org.jboss.metadata.spi.scope.Scope


*/
public class ClassLoaderDomainScopeFactory implements ScopeFactory<ClassLoaderDomainScope>
{
   public Scope create(ClassLoaderDomainScope annotation)
   {
      return new Scope(new ScopeLevel(CommonLevels.APPLICATION.getLevel() + 10, "ClassLoaderDomainScope"), annotation.value());
   }
View Full Code Here


*/
public class InstanceScopeFactory implements ScopeFactory<InstanceScope>
{
   public Scope create(InstanceScope annotation)
   {
      return new Scope(CommonLevels.INSTANCE, annotation.value());
   }
View Full Code Here

*/
public class DeploymentScopeFactory implements ScopeFactory<DeploymentScope>
{
   public Scope create(DeploymentScope annotation)
   {
      return new Scope(CommonLevels.DEPLOYMENT, annotation.value());
   }
View Full Code Here

*/
public class ApplicationScopeFactory implements ScopeFactory<ApplicationScope>
{
   public Scope create(ApplicationScope annotation)
   {
      return new Scope(CommonLevels.APPLICATION, annotation.value());
   }
View Full Code Here

    * @return the scope key
    */
   private static final ScopeKey getThreadScopeKey()
   {
      String name = AccessController.doPrivileged(GET_THREAD_NAME);
      Scope scope = new Scope(CommonLevels.THREAD, name);
      return new ScopeKey(scope);
   }
View Full Code Here

   /** The annotated element */
   private AnnotatedElement annotated;
  
   private static final ScopeKey getScopeKey(AnnotatedElement annotated)
   {
      Scope scope;
      if (annotated instanceof Class)
      {
         Class<?> clazz = Class.class.cast(annotated);
         scope = new Scope(CommonLevels.CLASS, clazz);
      }
      else if (annotated instanceof Member)
      {
         Member member = (Member) annotated;
         scope = new Scope(CommonLevels.JOINPOINT, member);
      }
      else
      {
         return ScopeKey.DEFAULT_SCOPE;
      }
View Full Code Here

   }
  
   public void testAutoClassRetrieval() throws Exception
   {
      MutableMetaDataRepository repository = setupEmpty();
      ScopeKey key = new ScopeKey(new Scope(CommonLevels.CLASS, TestClass1.class));
      MetaDataRetrieval retrieval = repository.getMetaDataRetrieval(key);
      assertNotNull(retrieval);
      MetaData metaData = new MetaDataRetrievalToMetaDataBridge(retrieval);
      assertNotNull(metaData.getAnnotation(TestAnnotation1.class));
   }
View Full Code Here

         assertEquals(scopes[index++], scope);
   }

   protected void assertAddScope(ScopeKey key, Scope add, Scope expected) throws Exception
   {
      Scope previous = key.addScope(add);
      assertEquals(expected, previous);
   }
View Full Code Here

      assertEquals(expected, previous);
   }

   protected void assertRemoveScope(ScopeKey key, Scope remove, Scope expected) throws Exception
   {
      Scope previous = key.removeScope(remove);
      assertEquals(expected, previous);
   }
View Full Code Here

      assertEquals(expected, previous);
   }

   protected void assertAddScope(ScopeKey key, ScopeLevel level, String qualifier, Scope expected) throws Exception
   {
      Scope previous = key.addScope(level, qualifier);
      assertEquals(expected, previous);
   }
View Full Code Here

TOP

Related Classes of org.jboss.metadata.spi.scope.Scope

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.