/** * 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()); }
/** {@inheritDoc} */ public synchronized BeanDeploymentArchive loadBeanDeploymentArchive(final Class<?> beanClass) { final BeanDeploymentArchive bda = this.getBeanDeploymentArchive(beanClass); if (bda != null) { return bda; } Module module = Module.forClass(beanClass); if (module == null) { // Bean class loaded by the bootstrap class loader if (bootstrapClassLoaderBeanDeploymentArchive == null) { bootstrapClassLoaderBeanDeploymentArchive = createAndRegisterAdditionalBeanDeploymentArchive(module, beanClass); } else { bootstrapClassLoaderBeanDeploymentArchive.addBeanClass(beanClass); } return bootstrapClassLoaderBeanDeploymentArchive; } /* * No, there is no BDA for the class yet. Let's create one. */ return createAndRegisterAdditionalBeanDeploymentArchive(module, beanClass); }
/** {@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(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()); } }
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()); } } }
/** {@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()); } }
Class<?> clazz = Reflections.loadClass(iterator.next(), module.getClassLoader()); if (clazz != null) { Module classModule = Module.forClass(clazz); return classModule != null && classModule.equals(that.getModule());
/** * Get the caller's module. The caller's module is the module containing the method that calls this * method. Note that this method crawls the stack so other ways of obtaining the * module are more efficient. * * @return the current module */ public static Module getCallerModule() { return forClass(CallerContext.getCallingClass()); }
/** * Get the caller's module. The caller's module is the module containing the method that calls this * method. Note that this method crawls the stack so other ways of obtaining the * module are more efficient. * * @return the current module */ public static Module getCallerModule() { return forClass(JDKSpecific.getCallingUserClass()); }
/** * 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()); }
/** * 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()); }
/** * 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()); }
@Override public SSOManager<A, D, S, L, Batch> get() { SSOManagerFactory<A, D, S, Batch> factory = this.factory.get(); Module module = Module.forClass(this.getClass()); this.context = new SimpleMarshallingContextFactory().createMarshallingContext(new SimpleMarshallingConfigurationRepository(MarshallingVersion.class, MarshallingVersion.CURRENT, module), null); SSOManager<A, D, S, L, Batch> manager = factory.createSSOManager(this); manager.start(); return manager; }
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 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()); } }
/** {@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()); } }
private static void calculateModule(final ExtLogRecord logRecord, final Class<?> clazz) { final Module module = Module.forClass(clazz); if (module != null) { logRecord.setSourceModuleName(module.getName()); final Version version = module.getVersion(); if (version != null) { logRecord.setSourceModuleVersion(version.toString()); } else { logRecord.setSourceModuleVersion(null); } } } }