((CommandObject)new_bean).setCommandContext(verb, dh); } else if (new_bean instanceof Externalizable) { if (dh != null) {
((CommandObject)new_bean).setCommandContext(verb, dh); } else if (new_bean instanceof Externalizable) { if (dh != null) {
/** * 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; } }
((CommandObject)new_bean).setCommandContext(verb, dh); } else if (new_bean instanceof Externalizable) { if (dh != null) {
((CommandObject)new_bean).setCommandContext(verb, dh); } else if (new_bean instanceof Externalizable) { if (dh != null) {
((CommandObject)new_bean).setCommandContext(verb, dh); } else if (new_bean instanceof Externalizable) { if (dh != null) {
((CommandObject)new_bean).setCommandContext(verb, dh); } else if (new_bean instanceof Externalizable) { if (dh != null) {
((CommandObject)new_bean).setCommandContext(verb, dh); } else if (new_bean instanceof Externalizable) { if (dh != null) {
((CommandObject)new_bean).setCommandContext(verb, dh); } else if (new_bean instanceof Externalizable) { if (dh != null) {