/** * Create a ModuleReference from a target class name and factory class. * * @param className The class name for the reference * @param factoryClass The factory class * @return A ModularReference */ public static ModularReference create(final String className, final Class<?> factoryClass) { return new ModularReference(className, factoryClass.getName(), Module.forClass(factoryClass).getIdentifier()); }
/** * Create a ModuleReference from a target class name, reference address and factory class. * * @param className The class name for the reference * @param addr The address of the object * @param factoryClass The factory class * @return A ModularReference */ public static ModularReference create(final String className, final RefAddr addr, final Class<?> factoryClass) { return new ModularReference(className, addr, factoryClass.getName(), Module.forClass(factoryClass).getIdentifier()); }
Boolean hasWeldDependencies = processedStaticModules.get(definingModule.getIdentifier()); boolean logWarning = false; // only log for the first class in the module logWarning = processedStaticModules.putIfAbsent(definingModule.getIdentifier(), hasWeldDependencies) == null; WeldLogger.ROOT_LOGGER.loadingProxiesUsingDeploymentClassLoader(definingModule.getIdentifier(), Arrays.toString(REQUIRED_WELD_DEPENDENCIES));
id = BOOTSTRAP_CLASSLOADER_BDA_ID; } else { id = module.getIdentifier() + ADDITIONAL_CLASSES_BDA_SUFFIX; if (module != null && eeModuleDescriptors.containsKey(module.getIdentifier())) { newBda.getServices().add(EEModuleDescriptor.class, eeModuleDescriptors.get(module.getIdentifier()));
public void writeClass(final Marshaller marshaller, final Class<?> clazz) throws IOException { marshaller.write(0); final Module module = Module.forClass(clazz); if (module == null) { marshaller.writeObject(null); } else { final ModuleIdentifier identifier = module.getIdentifier(); marshaller.writeObject(identifier.getName()); marshaller.writeObject(identifier.getSlot()); } marshaller.writeObject(clazz.getName()); } }
/** {@inheritDoc} */ public void annotateClass(final Marshaller marshaller, final Class<?> clazz) throws IOException { final Module module = Module.forClass(clazz); if (module == null) { marshaller.writeObject(null); } else { final ModuleIdentifier identifier = module.getIdentifier(); marshaller.writeObject(identifier.getName()); marshaller.writeObject(identifier.getSlot()); } }
/** {@inheritDoc} */ public void annotateProxyClass(final Marshaller marshaller, final Class<?> proxyClass) throws IOException { final Module module = Module.forClass(proxyClass); if (module == null) { marshaller.writeObject(null); } else { final ModuleIdentifier identifier = module.getIdentifier(); marshaller.writeObject(identifier.getName()); marshaller.writeObject(identifier.getSlot()); } }
public void writeClass(final Marshaller marshaller, final Class<?> clazz) throws IOException { marshaller.write(1); final Module module = Module.forClass(clazz); if (module == null) { marshaller.writeObject(null); } else { final ModuleIdentifier identifier = module.getIdentifier(); marshaller.writeObject(identifier.getName()); marshaller.writeObject(identifier.getSlot()); } final Class<?>[] interfaces = clazz.getInterfaces(); marshaller.writeInt(interfaces.length); for (Class<?> interfaze : interfaces) { marshaller.writeObject(interfaze.getName()); } } }
if (dependency instanceof ModuleDependencySpec) { ModuleDependencySpec moduleDependency = (ModuleDependencySpec) dependency; if (moduleDependency.getIdentifier().equals(that.getModule().getIdentifier())) { return true; if (module != null && module.getIdentifier().equals(that.getModule().getIdentifier())) { return true;
final BeanDeploymentModule bdm = new BeanDeploymentModule(handler.module.getIdentifier().toString(), deploymentUnit, bdaMap.values()); deploymentUnit.putAttachment(WeldAttachments.BEAN_DEPLOYMENT_MODULE, bdm);
putIfValueNotNull(eeModuleDescriptors, module.getIdentifier(), rootBeanDeploymentModule.getModuleDescriptor()); bdmsByIdentifier.put(module.getIdentifier(), rootBeanDeploymentModule); moduleSpecByIdentifier.put(module.getIdentifier(), moduleSpecification); bdmsByIdentifier.put(subDeploymentModule.getIdentifier(), bdm); moduleSpecByIdentifier.put(subDeploymentModule.getIdentifier(), subDeploymentModuleSpec); putIfValueNotNull(eeModuleDescriptors, subDeploymentModule.getIdentifier(), bdm.getModuleDescriptor());
@SuppressWarnings("unchecked") protected void deployServletProcessApplication(ServletProcessApplication processApplication) { ClassLoader contextClassloader = ClassLoaderUtil.getContextClassloader(); String moduleName = ((ModuleClassLoader)contextClassloader).getModule().getIdentifier().toString(); ServiceName serviceName = ServiceNames.forNoViewProcessApplicationStartService(moduleName); ServiceName paModuleService = ServiceNames.forProcessApplicationModuleService(moduleName); if(serviceContainer.getService(serviceName) == null) { ServiceController<ServiceTarget> requiredService = (ServiceController<ServiceTarget>) serviceContainer.getRequiredService(paModuleService); NoViewProcessApplicationStartService service = new NoViewProcessApplicationStartService(processApplication.getReference()); requiredService.getValue() .addService(serviceName, service) .setInitialMode(Mode.ACTIVE) .install(); } }
@SuppressWarnings("unchecked") protected void deployServletProcessApplication(ServletProcessApplication processApplication) { ClassLoader contextClassloader = ClassLoaderUtil.getContextClassloader(); String moduleName = ((ModuleClassLoader)contextClassloader).getModule().getIdentifier().toString(); ServiceName serviceName = ServiceNames.forNoViewProcessApplicationStartService(moduleName); ServiceName paModuleService = ServiceNames.forProcessApplicationModuleService(moduleName); if(serviceContainer.getService(serviceName) == null) { ServiceController<ServiceTarget> requiredService = (ServiceController<ServiceTarget>) serviceContainer.getRequiredService(paModuleService); NoViewProcessApplicationStartService service = new NoViewProcessApplicationStartService(processApplication.getReference()); requiredService.getValue() .addService(serviceName, service) .setInitialMode(Mode.ACTIVE) .install(); } }
@SuppressWarnings("unchecked") protected void deployServletProcessApplication(ServletProcessApplication processApplication) { ClassLoader contextClassloader = ClassLoaderUtil.getContextClassloader(); String moduleName = ((ModuleClassLoader)contextClassloader).getModule().getIdentifier().toString(); ServiceName serviceName = ServiceNames.forNoViewProcessApplicationStartService(moduleName); ServiceName paModuleService = ServiceNames.forProcessApplicationModuleService(moduleName); if(serviceContainer.getService(serviceName) == null) { ServiceController<ServiceTarget> requiredService = (ServiceController<ServiceTarget>) serviceContainer.getRequiredService(paModuleService); NoViewProcessApplicationStartService service = new NoViewProcessApplicationStartService(processApplication.getReference()); requiredService.getValue() .addService(serviceName, service) .setInitialMode(Mode.ACTIVE) .install(); } }
final String moduleName = module.getIdentifier().toString(); final ServiceName paStartServiceName = ServiceNames.forProcessApplicationStartService(moduleName); final ServiceName paStopServiceName = ServiceNames.forProcessApplicationStopService(moduleName);
final String moduleName = module.getIdentifier().toString(); final ServiceName paStartServiceName = ServiceNames.forProcessApplicationStartService(moduleName); final ServiceName paStopServiceName = ServiceNames.forProcessApplicationStopService(moduleName);
final String moduleName = module.getIdentifier().toString(); final ServiceName paStartServiceName = ServiceNames.forProcessApplicationStartService(moduleName); final ServiceName paStopServiceName = ServiceNames.forProcessApplicationStopService(moduleName);
@Override public void removeModule(Module module) { if (moduleSpecs.remove(module.getIdentifier()) != null) { unloadModuleLocal(module); } else throw new IllegalStateException("Unknown module " + module); }
/** * Create a ModuleReference from a target class name and factory class. * * @param className The class name for the reference * @param factoryClass The factory class * @return A ModularReference */ public static ModularReference create(final String className, final Class<?> factoryClass) { return new ModularReference(className, factoryClass.getName(), Module.forClass(factoryClass).getIdentifier()); }
@Override public boolean isClassReplaceable(final String className, final ClassLoader loader) { if (loader instanceof ModuleClassLoader) { if (((ModuleClassLoader) loader).getModule().getIdentifier().toString().startsWith("deployment.")) { return true; } } return false; } }