Object manager = Beans.instantiate(pm.getClass().getClassLoader(), managerName); if (manager instanceof PackageManager) { pm = (PackageManager)manager; managerName = pmProps.getProperty("org.pentaho.packageManager.manager"); if (managerName != null && managerName.length() > 0) { Object manager = Beans.instantiate(pm.getClass().getClassLoader(), managerName); if (manager instanceof PackageManager) { pm = (PackageManager)manager;
new_bean = java.beans.Beans.instantiate(loader, className);
new_bean = java.beans.Beans.instantiate(loader, className);
public JdbcBeanInterface getDefault() { if (defaultbean == null) { Class c = getClass(); try { defaultbean = (JdbcBeanInterface) Beans.instantiate(c.getClassLoader(), c.getName()); } catch (IOException ex) { } catch (ClassNotFoundException ex) { } } return defaultbean; }
MyApplet applet=(MyApplet)java.beans.Beans.instantiate( MyApplet.class.getClassLoader(), MyApplet.class.getName()); System.out.println(applet.getCodeBase());//prove that the context is now there // now you can use applet like a normal AWT/Swing component
/** * Creates a new <code>BeanInstance</code> instance given the fully qualified * name of the bean * * @param container a <code>JComponent</code> to add the bean to * @param beanName the fully qualified name of the bean * @param x the x coordinate of the bean * @param y th y coordinate of the bean */ public BeanInstance(JComponent container, String beanName, int x, int y, Integer... tab) { m_x = x; m_y = y; // try and instantiate the named component try { m_bean = Beans.instantiate(null, beanName); } catch (Exception ex) { ex.printStackTrace(); return; } addBean(container, tab); }
/** * Creates a new <code>BeanInstance</code> instance given the fully qualified * name of the bean * * @param container a <code>JComponent</code> to add the bean to * @param beanName the fully qualified name of the bean * @param x the x coordinate of the bean * @param y th y coordinate of the bean */ public BeanInstance(JComponent container, String beanName, int x, int y, Integer... tab) { m_x = x; m_y = y; // try and instantiate the named component try { m_bean = Beans.instantiate(null, beanName); } catch (Exception ex) { ex.printStackTrace(); return; } addBean(container, tab); }
/** * Create a bean of the appropriate type for the given Entry * object, and link it to the object for immediate manipulation. * * @param ent the Entry for which to create and link a bean * @return a new bean of the right type, linked to the given Entry * @exception ClassNotFoundException no bean class of the * appropriate type could be found * @exception ClassCastException the bean class does not implement * the EntryBean interface * @exception IOException the JavaBeans component could not be instantiated */ public static EntryBean createBean(Entry ent) throws ClassNotFoundException, IOException { String beanClass = ent.getClass().getName() + "Bean"; Object obj = null; try { obj = Beans.instantiate(ent.getClass().getClassLoader(), beanClass); } catch (ClassNotFoundException e) { // Ignore any ClassNotFoundException thrown here. } // Allow the instantiate method to throw an IOException. if (obj == null) obj = Beans.instantiate(null, beanClass); EntryBean entBean = (EntryBean)Beans.getInstanceOf(obj, EntryBean.class); entBean.makeLink(ent); return entBean; }
if (managerName != null && managerName.length() > 0) { Object manager = Beans.instantiate(pm.getClass().getClassLoader(), managerName); if (manager instanceof PackageManager) { pm = (PackageManager) manager; if (managerName != null && managerName.length() > 0) { Object manager = Beans.instantiate(pm.getClass().getClassLoader(), managerName); if (manager instanceof PackageManager) { pm = (PackageManager) manager;
.getProperty("org.pentaho.packageManagement.manager"); if (managerName != null && managerName.length() > 0) { Object manager = Beans.instantiate(pm.getClass().getClassLoader(), managerName); if (manager instanceof PackageManager) { .getProperty("org.pentaho.packageManager.manager"); if (managerName != null && managerName.length() > 0) { Object manager = Beans.instantiate(pm.getClass().getClassLoader(), managerName); if (manager instanceof PackageManager) {
if (managerName != null && managerName.length() > 0) { Object manager = Beans.instantiate(pm.getClass().getClassLoader(), managerName); if (manager instanceof PackageManager) { pm = (PackageManager) manager; if (managerName != null && managerName.length() > 0) { Object manager = Beans.instantiate(pm.getClass().getClassLoader(), managerName); if (manager instanceof PackageManager) { pm = (PackageManager) manager;
/** * Instantiate and return a command JavaBean. * The bean is created using Beans.instantiate(loader, commandClass). * If the new bean implements CommandObject then its setCommandContext(String, DataHandler) * method is called. * Otherwise if it implements Externalizable and the supplied DataHandler is not null * then its readExternal(ObjectInputStream) method is called with a stream obtained from * DataHandler.getInputStream(). * * @param dh a DataHandler that provides the data to be passed to the command * @param loader the ClassLoader to be used to instantiate the command * @return a new command instance * @throws IOException if there was a problem initializing the command * @throws ClassNotFoundException if the command class could not be found */ public Object getCommandObject(DataHandler dh, ClassLoader loader) throws IOException, ClassNotFoundException { Object bean = Beans.instantiate(loader, commandClass); if (bean instanceof CommandObject) { ((CommandObject) bean).setCommandContext(commandName, dh); } else if (bean instanceof Externalizable && dh != null) { ((Externalizable) bean).readExternal(new ObjectInputStream(dh.getInputStream())); } return bean; } }
/** * Instantiate and return a command JavaBean. * The bean is created using Beans.instantiate(loader, commandClass). * If the new bean implements CommandObject then its setCommandContext(String, DataHandler) * method is called. * Otherwise if it implements Externalizable and the supplied DataHandler is not null * then its readExternal(ObjectInputStream) method is called with a stream obtained from * DataHandler.getInputStream(). * * @param dh a DataHandler that provides the data to be passed to the command * @param loader the ClassLoader to be used to instantiate the command * @return a new command instance * @throws IOException if there was a problem initializing the command * @throws ClassNotFoundException if the command class could not be found */ public Object getCommandObject(DataHandler dh, ClassLoader loader) throws IOException, ClassNotFoundException { Object bean = Beans.instantiate(loader, commandClass); if (bean instanceof CommandObject) { ((CommandObject) bean).setCommandContext(commandName, dh); } else if (bean instanceof Externalizable && dh != null) { ((Externalizable) bean).readExternal(new ObjectInputStream(dh.getInputStream())); } return bean; } }
/** * Instantiate and return a command JavaBean. * The bean is created using Beans.instantiate(loader, commandClass). * If the new bean implements CommandObject then its setCommandContext(String, DataHandler) * method is called. * Otherwise if it implements Externalizable and the supplied DataHandler is not null * then its readExternal(ObjectInputStream) method is called with a stream obtained from * DataHandler.getInputStream(). * * @param dh a DataHandler that provides the data to be passed to the command * @param loader the ClassLoader to be used to instantiate the command * @return a new command instance * @throws IOException if there was a problem initializing the command * @throws ClassNotFoundException if the command class could not be found */ public Object getCommandObject(DataHandler dh, ClassLoader loader) throws IOException, ClassNotFoundException { Object bean = Beans.instantiate(loader, commandClass); if (bean instanceof CommandObject) { ((CommandObject) bean).setCommandContext(commandName, dh); } else if (bean instanceof Externalizable && dh != null) { ((Externalizable) bean).readExternal(new ObjectInputStream(dh.getInputStream())); } return bean; } }
sigObj = (SigPlus)Beans.instantiate( cl, "com.topaz.sigplus.SigPlus" );
new_bean = java.beans.Beans.instantiate(loader, className);
new_bean = java.beans.Beans.instantiate(loader, className);
@SuppressWarnings("unchecked") public T instantiateBean() throws java.lang.InstantiationException { Log.debug( "INSTANTIATE BEAN [{0}]", getBeanClass() ); try { T result = (T) Beans.instantiate( getBeanClass().getClassLoader(), getBeanClass().getName()); Log.debug( "INSTANTIATE BEAN [{0}]", result ); BeanInfo bi = super.getBeanInfo(); JPAManagedBeanInfo<?> beanInfo = null; if( bi instanceof ManagedBeanInfoProxy ) { beanInfo = (JPAManagedBeanInfo<?>)((ManagedBeanInfoProxy)bi).getDelegate(); } else { beanInfo = (JPAManagedBeanInfo<?>)bi; } if( beanInfo.relationBeanList!=null ) { for( JPAManagedBeanInfo.RelationBeanFactory rbf : beanInfo.relationBeanList) { rbf.createAndSet(result); } } return result; } catch (Exception ex) { // TODO logging throw new InstantiationException(ex.getMessage()); } }
comp = Beans.instantiate(this.getClass().getClassLoader(), clazz); } catch (Exception ex) { throw new WekaException(ex);
comp = Beans.instantiate(this.getClass().getClassLoader(), clazz); } catch (Exception ex) { throw new WekaException(ex);