Package org.jboss.metadata.spi.scope

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


     
      ScopeKey getScope()
      {
         if (scope == null)
         {
            ScopeKey key = parent.getScope().clone();
            key.removeScopeLevel(CommonLevels.INSTANCE);
            key.addScope(CommonLevels.INSTANCE, bmd.getName());
         }
         return scope;
      }
View Full Code Here


     
      ScopeKey getMutableScope()
      {
         if (mutableScope == null)
         {
            mutableScope = new ScopeKey();
            mutableScope.addScope(CommonLevels.INSTANCE, bmd.getName());
         }
         return mutableScope;
      }
View Full Code Here

            return;
         }
        
         try
         {
            ScopeKey scope = getScope();
            repository.removeMetaDataRetrieval(scope);
         }
         catch (Throwable ignored)
         {
         }

         try
         {
            ScopeKey scope = getMutableScope();
            repository.removeMetaDataRetrieval(scope);
         }
         catch (Throwable ignored)
         {
         }
View Full Code Here

    */
   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

      }
      else
      {
         return ScopeKey.DEFAULT_SCOPE;
      }
      return new ScopeKey(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

      super(name);
   }

   public void testBasicScopeKeyConstructor() throws Exception
   {
      ScopeKey key = new ScopeKey();
      Scope[] expected = new Scope[0];
      assertScopeKey(expected, key);
      assertNull(key.getMaxScopeLevel());
   }
View Full Code Here

      assertFalse(parent.isParent(test));
   }

   public void testIsParentNotChild() throws Exception
   {
      ScopeKey parent = new ScopeKey();
      parent.addScope(testScope1);
      parent.addScope(testScope2);
     
      ScopeKey test = new ScopeKey();
      test.addScope(testScope1);
      assertFalse(parent.isParent(test));
   }
View Full Code Here

      assertFalse(parent.isParent(test));
   }

   public void testIsParentComplicated() throws Exception
   {
      ScopeKey parent = new ScopeKey();
      parent.addScope(testScope1);
      parent.addScope(testScope2);
      parent.addScope(testScope3);
      parent.addScope(testScope4);
     
      ScopeKey test = new ScopeKey();
      test.addScope(testScope1);
      test.addScope(testScope2);
      test.addScope(testScope3);
      test.addScope(testScope4);
      test.addScope(testScope5);
      assertTrue(parent.isParent(test));
   }
View Full Code Here

      assertTrue(parent.isParent(test));
   }
  
   public void testEqualsEmpty() throws Exception
   {
      ScopeKey key1 = new ScopeKey();
      ScopeKey key2 = new ScopeKey();
      assertEquals(key1, key2);
   }
View Full Code Here

TOP

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

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.