Examples of ModuleIdentifier


Examples of org.jboss.modules.ModuleIdentifier

        // Install the resource as module if it has not happend already
        Runtime runtime = RuntimeLocator.getRequiredRuntime();
        Module module = runtime.getModule(resource.getIdentity());
        if (module == null) {
            ModuleLoader moduleLoader = injectedServiceModuleLoader.getValue();
            ModuleIdentifier modid = ModuleIdentifier.create(ServiceModuleLoader.MODULE_PREFIX + runtimeName);
            ClassLoader classLoader = moduleLoader.loadModule(modid).getClassLoader();
            module = runtime.installModule(classLoader, resource, null);
        }

        Resource modres = module != null ? module.adapt(Resource.class) : resource;
View Full Code Here

Examples of org.jboss.modules.ModuleIdentifier

    private final InjectedValue<Module> injectedModule = new InjectedValue<Module>();

    @Override
    public void visit(ConfigVisitor visitor) {
        if (moduleName != null) {
            ModuleIdentifier identifier = ModuleIdentifier.fromString(moduleName);
            if (moduleName.startsWith(ServiceModuleLoader.MODULE_PREFIX)) {
                ServiceName serviceName = ServiceModuleLoader.moduleServiceName(identifier);
                visitor.addDependency(serviceName, getInjectedModule());
            } else {
                Module dm = visitor.loadModule(identifier);
View Full Code Here

Examples of org.jboss.modules.ModuleIdentifier

   public final Module loadAddonModule(Addon addon) throws ModuleLoadException
   {
      try
      {
         this.currentAddon.set(addon);
         ModuleIdentifier moduleId = moduleCache.getModuleId(addon);
         Module result = loadModule(moduleId);
         return result;
      }
      catch (ModuleLoadException e)
      {
View Full Code Here

Examples of org.jboss.modules.ModuleIdentifier

   }

   private void addAddonDependency(Set<AddonView> views, AddonId found, Builder builder, AddonDependencyEntry dependency)
   {
      AddonId addonId = stateManager.resolveAddonId(views, dependency.getName());
      ModuleIdentifier moduleId = null;
      if (addonId != null)
      {
         Addon addon = lifecycleManager.getAddon(views, addonId);
         moduleId = findCompatibleInstalledModule(addonId);
         if (moduleId != null)
View Full Code Here

Examples of org.jboss.modules.ModuleIdentifier

                  + "]");
   }

   private ModuleIdentifier findCompatibleInstalledModule(AddonId addonId)
   {
      ModuleIdentifier result = null;

      Addon addon = currentAddon.get();
      Version runtimeAPIVersion = AddonRepositoryImpl.getRuntimeAPIVersion();

      for (AddonRepository repository : stateManager.getViewsOf(addon).iterator().next().getRepositories())
View Full Code Here

Examples of org.jboss.modules.ModuleIdentifier

      return "AddonModuleLoader";
   }

   public void releaseAddonModule(Addon addon)
   {
      ModuleIdentifier id = moduleCache.getModuleId(addon);
      moduleJarFileCache.closeJarFileReferences(id);
      Module loadedModule = findLoadedModuleLocal(id);
      if (loadedModule != null)
         unloadModuleLocal(loadedModule);
      moduleCache.clear(addon);
View Full Code Here

Examples of org.jboss.modules.ModuleIdentifier

    /**
     * Add a {@link ModuleSpec} for and OSGi module as a service that can later be looked up by the {@link ServiceModuleLoader}
     */
    @Override
    public void addModule(final ModuleSpec moduleSpec) {
        ModuleIdentifier identifier = moduleSpec.getModuleIdentifier();
        ROOT_LOGGER.debugf("Add module spec to loader: %s", identifier);

        ServiceName moduleSpecName = ServiceModuleLoader.moduleSpecServiceName(identifier);
        serviceTarget.addService(moduleSpecName, new ValueService<ModuleSpec>(new ImmediateValue<ModuleSpec>(moduleSpec))).install();

View Full Code Here

Examples of org.jboss.modules.ModuleIdentifier

        int revision = moduleId.getRevision();
        if (revision > 0)
            slot += "-rev" + revision;

        String name = ServiceModuleLoader.MODULE_PREFIX + moduleId.getName();
        ModuleIdentifier identifier = ModuleIdentifier.create(name, slot);
        resModule.addAttachment(ModuleIdentifier.class, identifier);

        return identifier;
    }
View Full Code Here

Examples of org.jboss.modules.ModuleIdentifier

            throw new StartException(MESSAGES.failedToCreateAutoInstallList(), ex);
        }
    }

    ServiceName installModule(BundleManagerService bundleManager, OSGiModule moduleMetaData) throws Exception {
        ModuleIdentifier identifier = moduleMetaData.getIdentifier();
        Integer startLevel = moduleMetaData.getStartLevel();

        // Attempt to install bundle from the bundles hirarchy
        File modulesFile = getRepositoryEntry(bundlesDir, identifier);
        if (modulesFile != null) {
View Full Code Here

Examples of org.jboss.modules.ModuleIdentifier

        return entryFile;
    }

    private OSGiMetaData getModuleMetadata(Module module) throws IOException {
        final File modulesDir = injectedEnvironment.getValue().getModulesDir();
        final ModuleIdentifier identifier = module.getIdentifier();

        String identifierPath = identifier.getName().replace('.', '/') + "/" + identifier.getSlot();
        File entryFile = new File(modulesDir + "/" + identifierPath + "/jbosgi-xservice.properties");
        if (entryFile.exists() == false) {
            ROOT_LOGGER.debugf("Cannot obtain OSGi metadata file: %s", entryFile);
            return null;
        }
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.