Package org.jboss.metadata.spi.scope

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


   {
      if (annotations == null || annotations.isEmpty())
         return;

      Signature signature = new MethodSignature(methodInfo);
      ScopeKey scope = new ScopeKey(CommonLevels.JOINPOINT_OVERRIDE, methodInfo.getName());
      updateAnnotations(repository, classloader, component, context, signature, scope, annotations, add);
   }
View Full Code Here


   {
      if (annotations == null || annotations.isEmpty())
         return;

      Signature signature = new FieldSignature(fieldInfo);
      ScopeKey scope = new ScopeKey(CommonLevels.JOINPOINT_OVERRIDE, fieldInfo.getName());
      updateAnnotations(repository, classloader, component, context, signature, scope, annotations, add);
   }
View Full Code Here

{
   public static final InstallExistingScopeAction INSTANCE = new InstallExistingScopeAction();

   protected void installAction(ControllerContext context) throws Throwable
   {
      ScopeKey scopeKey = getScopeKey(context);
      if (scopeKey != null)
      {
         Controller controller = context.getController();
         if (controller instanceof KernelController == false)
            throw new IllegalArgumentException("Can only handle kernel controller: " + controller);
View Full Code Here

   }

   public MetaData getMetaData(ControllerContext context)
   {
      MutableMetaDataRepository repository = getMetaDataRepository();
      ScopeKey scope = context.getScopeInfo().getScope();
      MetaData metaData = repository.getMetaData(scope);
      if (metaData == null)
      {
         initMetaDataRetrieval(context);
         metaData = repository.getMetaData(scope);
View Full Code Here

   public void start()
   {
      KernelMetaDataRepository kmdr = underlyingKernel.getMetaDataRepository();
      MutableMetaDataRepository mmdr = kmdr.getMetaDataRepository();
      ScopeKey scopeKey = new ScopeKey(scopes);
      MetaDataRetrieval retrieval = mmdr.getMetaDataRetrieval(scopeKey);
      // Not found create it
      if (retrieval == null)
      {
         retrieval = new MemoryMetaDataLoader(scopeKey);
         mmdr.addMetaDataRetrieval(retrieval);
      }
      MutableMetaData mmd = (MutableMetaData)retrieval;
      // deploy against this kernel
      Kernel kernel = underlyingKernel;
      // Get the parent scope - if exists
      ScopeKey parent = scopeKey.getParent();
      if (parent != null)
      {
         MetaDataRetrieval pretrieval = mmdr.getMetaDataRetrieval(parent);
         MetaDataItem<Kernel> item = pretrieval.retrieveMetaData(Kernel.class);
         if (item != null)
View Full Code Here

   }

   private ScopeKey createScopeKey(String name, String qualifier)
   {
      int level = ScopeLevel.getScopeLevel(name);
      return new ScopeKey(new ScopeLevel(level, name), qualifier);
   }
View Full Code Here

{
   public static final InstallScopeAction INSTANCE = new InstallScopeAction();

   protected void installAction(ControllerContext context) throws Throwable
   {
      ScopeKey scopeKey = getScopeKey(context);
      if (scopeKey != null)
      {
         Controller controller = context.getController();
         if (controller instanceof AbstractKernelController == false)
            throw new IllegalArgumentException("Can only handle AbstractKernelController: " + controller);
View Full Code Here

      }
   }

   protected void uninstallAction(ControllerContext context)
   {
      ScopeKey scopeKey = getScopeKey(context);
      if (scopeKey != null)
      {
         Controller controller = context.getController();
         if (controller instanceof KernelController == false)
            throw new IllegalArgumentException("Can only handle kernel controller: " + controller);
View Full Code Here

   @SuppressWarnings("unchecked")
   protected ScopeKey getInstallScopeKey(
         KernelControllerContext context,
         KernelMetaDataRepository repository) throws Throwable
   {
      ScopeKey scopeKey = context.getScopeInfo().getInstallScope();
      if (scopeKey != null)
         return scopeKey;

      MetaData retrieval = repository.getMetaData(context);
      if (retrieval != null)
      {
         Annotation[] annotations = retrieval.getAnnotations();
         if (annotations != null && annotations.length > 0)
         {
            Collection<Scope> scopes = new HashSet<Scope>();
            for (Annotation annotation : annotations)
            {
               if (annotation.annotationType().isAnnotationPresent(ScopeFactoryLookup.class))
               {
                  ScopeFactoryLookup sfl = annotation.annotationType().getAnnotation(ScopeFactoryLookup.class);
                  ScopeFactory scf = getScopeFactory(sfl.value());
                  Scope scope = scf.create(annotation);
                  scopes.add(scope);
               }
            }
            if (scopes.size() > 0)
            {
               return new ScopeKey(scopes);
            }
         }
      }
      return null;
   }
View Full Code Here

   protected void applyScoping(KernelControllerContext context) throws Throwable
   {
      KernelController controller = (KernelController)context.getController();
      KernelMetaDataRepository repository = controller.getKernel().getMetaDataRepository();
      ScopeKey scopeKey = getInstallScopeKey(context, repository);
      if (scopeKey != null)
      {
         scopeKey.freeze();
         context.getScopeInfo().setInstallScope(scopeKey);

         if (controller instanceof AbstractKernelController == false)
            throw new IllegalArgumentException("Can only handle AbstractKernelController: " + controller);
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.