Examples of KernelMetaDataRepository


Examples of org.jboss.kernel.spi.metadata.KernelMetaDataRepository

         catch (Throwable e)
         {
            log.debug("Error while cleaning the annotations: " + e);
            return;
         }
         KernelMetaDataRepository repository = controller.getKernel().getMetaDataRepository();
         MetaData md = repository.getMetaData(context);
         // add custom dependencies (e.g. AOP layer).
         List<DependencyBuilderListItem> dependencies = dependencyBuilder.getDependencies(info, md);
         if (log.isTraceEnabled())
            log.trace("Unwind extra dependencies for " + context.getName() + " " + dependencies);
         if (dependencies != null && dependencies.isEmpty() == false)
View Full Code Here

Examples of org.jboss.kernel.spi.metadata.KernelMetaDataRepository

   {
   }
  
   public void initKernel(Kernel kernel) throws Throwable
   {
      KernelMetaDataRepository metaDataRepository = createKernelMetaDataRepository(kernel);
      if (trace)
         log.trace("Using MetaDataRepository: " + metaDataRepository);
      kernel.setMetaDataRepository(metaDataRepository);

      org.jboss.kernel.spi.registry.KernelRegistry registry = createKernelRegistry(kernel);
View Full Code Here

Examples of org.jboss.kernel.spi.metadata.KernelMetaDataRepository

      if (visitor == null)
         throw new IllegalArgumentException("Null meta data visitor.");

      KernelControllerContext context = visitor.getControllerContext();
      Kernel kernel = context.getKernel();
      KernelMetaDataRepository repository = kernel.getMetaDataRepository();
      MetaData retrieval = repository.getMetaData(context);
      BeanInfo info = context.getBeanInfo();

      handleAnnotations(info, retrieval, visitor, isApplyPhase);
   }
View Full Code Here

Examples of org.jboss.kernel.spi.metadata.KernelMetaDataRepository

         AbstractKernelControllerContext theContext = (AbstractKernelControllerContext) context;
         access = theContext.getAccessControlContext();
      }

      KernelController controller = (KernelController) context.getController();
      KernelMetaDataRepository repository = controller.getKernel().getMetaDataRepository();
      MetaData md = repository.getMetaData(context);
      if (md != null)
         MetaDataStack.push(md);
      else
         staticLog.warn("NO METADATA! for " + context.getName() + " with scope " + context.getScopeInfo().getScope());
      try
View Full Code Here

Examples of org.jboss.kernel.spi.metadata.KernelMetaDataRepository

   @SuppressWarnings("deprecation")
   protected void installActionInternal(KernelControllerContext context) throws Throwable
   {
      KernelController controller = (KernelController) context.getController();
      Kernel kernel = controller.getKernel();
      KernelMetaDataRepository repository = kernel.getMetaDataRepository();
      KernelConfigurator configurator = kernel.getConfigurator();

      BeanMetaData metaData = context.getBeanMetaData();
      BeanInfo info = context.getBeanInfo();

      MetaData repositoryMetaData = repository.getMetaData(context);
      Joinpoint joinPoint = configurator.getConstructorJoinPoint(info, metaData.getConstructor(), metaData, repositoryMetaData);

      BeanValidatorBridge bridge = getBeanValidatorBridge(context);
      if (bridge != null)
         bridge.validateConstructorValues(context, joinPoint);
      Object object = dispatchJoinPoint(context, joinPoint);
      if (object == null)
         throw new IllegalStateException("Instantiate joinpoint returned a null object: " + joinPoint);
      if (bridge != null)
         bridge.validateInstance(context, object);

      context.setTarget(object);

      try
      {
         if (info == null)
         {
            info = configurator.getBeanInfo(object.getClass(), metaData.getAccessMode());
            context.setBeanInfo(info);

            // update class scope with class info
            repository = kernel.getMetaDataRepository();
            // remove old context
            repository.removeMetaData(context);
            // create new scope key
            ScopeInfo scopeInfo = context.getScopeInfo();
            ScopeKey scopeKey = new ScopeKey(scopeInfo.getScope().getScopes());
            scopeKey.addScope(CommonLevels.CLASS, info.getClassInfo().getType());
            scopeInfo.setScope(scopeKey);
            // re-register
            repository.addMetaData(context);

            // handle custom annotations
            applyAnnotations(context);
         }
View Full Code Here

Examples of org.jboss.kernel.spi.metadata.KernelMetaDataRepository

      if (metaData.getBean() != null)
      {
         BeanInfo info = configurator.getBeanInfo(metaData);
         context.setBeanInfo(info);

         KernelMetaDataRepository repository = controller.getKernel().getMetaDataRepository();
         ClassLoader oldCL = SecurityActions.setContextClassLoader(context);
         try
         {
            repository.addMetaData(context);
         }
         finally
         {
            SecurityActions.resetContextClassLoader(oldCL);
         }
View Full Code Here

Examples of org.jboss.kernel.spi.metadata.KernelMetaDataRepository

   }

   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);

         MutableMetaDataRepository mmdr = repository.getMetaDataRepository();
         AbstractController abstractController = ScopeHierarchyBuilder.buildControllerHierarchy((AbstractKernelController)controller, mmdr, scopeKey);
         if (abstractController instanceof ScopedKernelController == false)
            throw new IllegalArgumentException("Should be ScopedKernelController instance: " + abstractController);

         ScopedKernelController scopedController = (ScopedKernelController)abstractController;
View Full Code Here

Examples of org.jboss.kernel.spi.metadata.KernelMetaDataRepository

   {
      ScopeKey scopeKey = context.getScopeInfo().getInstallScope();
      if (scopeKey != null)
      {
         KernelController controller = (KernelController)context.getController();
         KernelMetaDataRepository repository = controller.getKernel().getMetaDataRepository();
         // find scoped controller
         MutableMetaDataRepository mmdr = repository.getMetaDataRepository();
         ScopeHierarchyBuilder.cleanControllerHierarchy(mmdr, scopeKey, context);
      }
   }
View Full Code Here

Examples of org.jboss.kernel.spi.metadata.KernelMetaDataRepository

   private void removeMetaData(KernelControllerContext context)
   {
      try
      {
         KernelController controller = (KernelController)context.getController();
         KernelMetaDataRepository repository = controller.getKernel().getMetaDataRepository();
         repository.removeMetaData(context);
      }
      catch (Throwable ignored)
      {
         log.warn("Unexpected error removing metadata: ", ignored);
      }
View Full Code Here

Examples of org.jboss.kernel.spi.metadata.KernelMetaDataRepository

      check("KernelController", registry, controller, KernelConstants.KERNEL_CONTROLLER_NAME, KernelConstants.KERNEL_CONTROLLER_CLASS);

      KernelEventManager eventManager = kernel.getEventManager();
      check("KernelEventManager", registry, eventManager, KernelConstants.KERNEL_EVENT_MANAGER_NAME, KernelConstants.KERNEL_EVENT_MANAGER_CLASS);

      KernelMetaDataRepository metaDataRepository = kernel.getMetaDataRepository();
      check("KernelMetaDataRepository", registry, metaDataRepository, KernelConstants.KERNEL_METADATA_REPOSITORY_NAME, KernelConstants.KERNEL_METADATA_REPOSITORY_CLASS);
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.