private void initBean() { String beanClassName = SpringUtils.getBeanClassName(configuration.getModel().getNamespaceURI()); Class beanClass = null; try { beanClass = Class.forName(beanClassName); } catch (ClassCastException ex) { LOG.log(Level.SEVERE, "Could not load bean class " + beanClassName, ex); return; } catch (ClassNotFoundException ex) { LOG.log(Level.SEVERE, "Could not load bean class " + beanClassName, ex); return; } try { bean = beanClass.newInstance(); } catch (Exception e) { LOG.log(Level.SEVERE, "Could not create bean instance " + beanClassName, e); return; } }
public Configuration getChild(String namespaceURI, Object childId) { for (Configurator c : configurator.getClients()) { if (namespaceURI.equals(c.getConfiguration().getModel().getNamespaceURI()) && childId.equals(c.getConfiguration().getId())) { return c.getConfiguration(); } } if (LOG.isLoggable(Level.FINE)) { LOG.fine("Could not find child configuration with id: " + childId); } return null; }
public synchronized void registerClient(Configurator c) { // replace an existing client hook if it has the same namespace and id Object clientId = c.getConfiguration().getId(); String clientNamepace = c.getConfiguration().getModel().getNamespaceURI(); for (Configurator client : clients) { if (clientId.equals(client.getConfiguration().getId()) && clientNamepace.equals(client.getConfiguration().getModel().getNamespaceURI())) { clients.remove(client); break; } } clients.add(c); } public void unregisterClient(Configurator c) {
private void findBean(CeltixXmlBeanFactory beanFactory) { String beanClassName = SpringUtils.getBeanClassName(configuration.getModel().getNamespaceURI()); Class beanClass = null; try {
void registerCustomEditors(Configuration c) { for (ConfigurationItemMetadata definition : c.getModel().getDefinitions()) { QName qn = definition.getType(); String className = BeanGenerator.getClassName(qn, true); Class cl = JAXBUtils.holderClass(className); if (null != cl) { continue; } try { cl = Class.forName(className); } catch (ClassCastException ex) { throw new ConfigurationException(new Message("COULD_NOT_REGISTER_PROPERTY_EDITOR_EXC", LOG, className), ex); } catch (ClassNotFoundException ex) { throw new ConfigurationException(new Message("COULD_NOT_REGISTER_PROPERTY_EDITOR_EXC", LOG, className), ex); } if (cl == String.class) { continue; } if (null == getCustomEditors().get(cl)) { registerCustomEditor(cl, editor); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Registered JaxbPropertyEditor for class: " + className); } } } }