/** * * This is a convenience method that invokes newInstance(Class) with a Class * object representing the given type. * * @see #getClass(String, ClassLoader) * @see #newInstance(Class) * */ public static Object newInstance(String className) { return newInstance(getClass(className)); }
/** * * This is a convenience method that invokes newInstance(Class) with a Class * object loaded by the given ClassLoader * * @see #getClass(String, ClassLoader) * @see #newInstance(Class) * */ public static Object newInstance(String className, ClassLoader classLoader) { return newInstance(getClass(className, classLoader)); }
public Serializer create() { return (Serializer)ReflectUtils.newInstance(getSerializerClass()); }
values = (Collection)ReflectUtils.newInstance(_collectionClass); super.put(key, values); ++_keySize;
protected ResourceIdFactory createResourceIdFactory(Element xml, Environment env) { QName qname = DescriptorConstants.JAVA_ID_FACTORY_QNAME; String className = XmlUtils.getElementText(xml, qname); if (className == null) return null; Class theClass = null; ClassLoader loader = env.getClassLoader(); theClass = ReflectUtils.getClass(className, loader); if (!ResourceIdFactory.class.isAssignableFrom(theClass)) { Object[] filler = { className, ResourceIdFactory.class.getName() }; throw new RuntimeException(_MESSAGES.get("NotResourceIdFactory", filler)); } return (ResourceIdFactory)ReflectUtils.newInstance(theClass); }
public Persistence newInstance() { Persistence persistence = (Persistence)ReflectUtils.newInstance(getPersistenceClass()); persistence.setPersistenceLocation(getPersistenceLocation()); return persistence; }
public Capability newInstance() { Class theClass = getImplementationClass(); Capability capability = (Capability)ReflectUtils.newInstance(theClass); capability.setCapabilityURI(getURI()); capability.setMessageHandlers(getMessageHandlers()); capability.setInitializationParameters(getInitializationParameters()); PersistenceDefinition persistenceDef = getPersistenceDefinition(); if (persistenceDef != null) { Persistence persistence = persistenceDef.newInstance(); capability.setPersistence(persistence); } return capability; }
public ResourceRouter newInstance() { Class theClass = getRouterClass(); ResourceRouter router = (ResourceRouter)ReflectUtils.newInstance(theClass); Environment env = getEnvironment(); router.setEnvironment(env); LoggingConfig logging = getLoggingConfig(); Logger log = logging.newInstance(); router.setLog(log); router.setResourceDefinitions(getResourceDefinitions()); PersistenceDefinition persistenceDef = getPersistenceDefinition(); if (persistenceDef != null) { RouterPersistence persistence = (RouterPersistence)persistenceDef.newInstance(); router.setPersistence(persistence); } return router; }
Resource resource = (Resource)ReflectUtils.newInstance(resourceClass);