/** * Check the cmdList to see if this command exists, return * true if the verb is there. */ private boolean checkForVerb(List cmdList, String verb) { Iterator ee = cmdList.iterator(); while (ee.hasNext()) { String enum_verb = (String)((CommandInfo)ee.next()).getCommandName(); if (enum_verb.equals(verb)) return true; } return false; }
/** * Put the commands that are in the hash table, into the list. */ private void appendCmdsToList(Map typeHash, List cmdList) { Iterator verb_enum = typeHash.keySet().iterator(); while (verb_enum.hasNext()) { String verb = (String)verb_enum.next(); List cmdList2 = (List)typeHash.get(verb); Iterator cmd_enum = ((List)cmdList2).iterator(); while (cmd_enum.hasNext()) { String cmd = (String)cmd_enum.next(); cmdList.add(new CommandInfo(verb, cmd)); // cmdList.add(0, new CommandInfo(verb, cmd)); } } }
/** * A convenience method that takes a CommandInfo object * and instantiates the corresponding command, usually * a JavaBean component. * <p> * This method calls the CommandInfo's <code>getCommandObject</code> * method with the <code>ClassLoader</code> used to load * the <code>javax.activation.DataHandler</code> class itself. * * @param cmdinfo the CommandInfo corresponding to a command * @return the instantiated command object */ public Object getBean(CommandInfo cmdinfo) { Object bean = null; try { // make the bean ClassLoader cld = null; // First try the "application's" class loader. cld = SecuritySupport.getContextClassLoader(); if (cld == null) cld = this.getClass().getClassLoader(); bean = cmdinfo.getCommandObject(this, cld); } catch (IOException e) { } catch (ClassNotFoundException e) { } return bean; }
private static boolean cmdMapInitialized(MailcapCommandMap mailMap) { // checking fastinfoset handler, since this one is specific to SAAJ CommandInfo[] commands = mailMap.getAllCommands("application/fastinfoset"); if (commands == null || commands.length == 0) { return false; } String saajClassName = "com.sun.xml.messaging.saaj.soap.FastInfosetDataContentHandler"; for (CommandInfo command : commands) { String commandClass = command.getCommandClass(); if (saajClassName.equals(commandClass)) { return true; } } return false; } }
private static boolean cmdMapInitialized(MailcapCommandMap mailMap) { CommandInfo[] commands = mailMap.getAllCommands("text/xml"); if (commands == null || commands.length == 0) { return false; } // SAAJ RI implements it's own DataHandlers which can be used for JAX-WS too; // see com.sun.xml.internal.messaging.saaj.soap.AttachmentPartImpl#initializeJavaActivationHandlers // so if found any of SAAJ or our own handler registered, we are ok; anyway using SAAJ directly here // is not good idea since we don't want standalone JAX-WS to depend on specific SAAJ impl. // This is also reason for duplication of Handler's code by JAX-WS String saajClassName = "com.sun.xml.internal.messaging.saaj.soap.XmlDataContentHandler"; String jaxwsClassName = "com.sun.xml.internal.ws.encoding.XmlDataContentHandler"; for (CommandInfo command : commands) { String commandClass = command.getCommandClass(); if (saajClassName.equals(commandClass) || jaxwsClassName.equals(commandClass)) { return true; } } return false; }
/** * Put the commands that are in the hash table, into the list. */ private void appendPrefCmdsToList(Map cmdHash, List cmdList) { Iterator verb_enum = cmdHash.keySet().iterator(); while (verb_enum.hasNext()) { String verb = (String)verb_enum.next(); if (!checkForVerb(cmdList, verb)) { List cmdList2 = (List)cmdHash.get(verb); // get the list String className = (String)cmdList2.get(0); cmdList.add(new CommandInfo(verb, className)); } } }
/** * Check the cmdList to see if this command exists, return * true if the verb is there. */ private boolean checkForVerb(List cmdList, String verb) { Iterator ee = cmdList.iterator(); while (ee.hasNext()) { String enum_verb = (String)((CommandInfo)ee.next()).getCommandName(); if (enum_verb.equals(verb)) return true; } return false; }
/** * A convenience method that takes a CommandInfo object * and instantiates the corresponding command, usually * a JavaBean component. * <p> * This method calls the CommandInfo's <code>getCommandObject</code> * method with the <code>ClassLoader</code> used to load * the <code>javax.activation.DataHandler</code> class itself. * * @param cmdinfo the CommandInfo corresponding to a command * @return the instantiated command object */ public Object getBean(CommandInfo cmdinfo) { Object bean = null; try { // make the bean ClassLoader cld = null; // First try the "application's" class loader. cld = SecuritySupport.getContextClassLoader(); if (cld == null) cld = this.getClass().getClassLoader(); bean = cmdinfo.getCommandObject(this, cld); } catch (IOException e) { } catch (ClassNotFoundException e) { } return bean; }
public synchronized DataContentHandler createDataContentHandler(String mimeType) { CommandInfo info = getCommand(mimeType, "content-handler"); if (info == null) { return null; } ClassLoader cl = Thread.currentThread().getContextClassLoader(); if (cl == null) { cl = getClass().getClassLoader(); } try { return (DataContentHandler) cl.loadClass(info.getCommandClass()).newInstance(); } catch (ClassNotFoundException e) { return null; } catch (IllegalAccessException e) { return null; } catch (InstantiationException e) { return null; } }
return new CommandInfo(cmdName, cmdClassName); return new CommandInfo(cmdName, cmdClassName);
/** * Check the cmdList to see if this command exists, return * true if the verb is there. */ private boolean checkForVerb(List cmdList, String verb) { Iterator ee = cmdList.iterator(); while (ee.hasNext()) { String enum_verb = (String)((CommandInfo)ee.next()).getCommandName(); if (enum_verb.equals(verb)) return true; } return false; }
public Object getBean(CommandInfo cmdinfo) { try { return cmdinfo.getCommandObject(this, this.getClass().getClassLoader()); } catch (IOException e) { return null; } catch (ClassNotFoundException e) { return null; } }
public synchronized DataContentHandler createDataContentHandler(String mimeType) { CommandInfo info = getCommand(mimeType, "content-handler"); if (info == null) { return null; } ClassLoader cl = Thread.currentThread().getContextClassLoader(); if (cl == null) { cl = getClass().getClassLoader(); } try { return (DataContentHandler) cl.loadClass(info.getCommandClass()).newInstance(); } catch (ClassNotFoundException e) { return null; } catch (IllegalAccessException e) { return null; } catch (InstantiationException e) { return null; } } }
/** * Put the commands that are in the hash table, into the list. */ private void appendCmdsToList(Map typeHash, List cmdList) { Iterator verb_enum = typeHash.keySet().iterator(); while (verb_enum.hasNext()) { String verb = (String)verb_enum.next(); List cmdList2 = (List)typeHash.get(verb); Iterator cmd_enum = ((List)cmdList2).iterator(); while (cmd_enum.hasNext()) { String cmd = (String)cmd_enum.next(); cmdList.add(new CommandInfo(verb, cmd)); // cmdList.add(0, new CommandInfo(verb, cmd)); } } }
/** * Check the cmdList to see if this command exists, return * true if the verb is there. */ private boolean checkForVerb(List cmdList, String verb) { Iterator ee = cmdList.iterator(); while (ee.hasNext()) { String enum_verb = (String)((CommandInfo)ee.next()).getCommandName(); if (enum_verb.equals(verb)) return true; } return false; }
public Object getBean(CommandInfo cmdinfo) { try { return cmdinfo.getCommandObject(this, this.getClass().getClassLoader()); } catch (IOException e) { return null; } catch (ClassNotFoundException e) { return null; } }
private static boolean cmdMapInitialized(MailcapCommandMap mailMap) { CommandInfo[] commands = mailMap.getAllCommands("text/xml"); if (commands == null || commands.length == 0) { return false; } // SAAJ RI implements it's own DataHandlers which can be used for JAX-WS too; // see com.sun.xml.internal.messaging.saaj.soap.AttachmentPartImpl#initializeJavaActivationHandlers // so if found any of SAAJ or our own handler registered, we are ok; anyway using SAAJ directly here // is not good idea since we don't want standalone JAX-WS to depend on specific SAAJ impl. // This is also reason for duplication of Handler's code by JAX-WS String saajClassName = "com.sun.xml.internal.messaging.saaj.soap.XmlDataContentHandler"; String jaxwsClassName = "com.sun.xml.internal.ws.encoding.XmlDataContentHandler"; for (CommandInfo command : commands) { String commandClass = command.getCommandClass(); if (saajClassName.equals(commandClass) || jaxwsClassName.equals(commandClass)) { return true; } } return false; }
/** * Put the commands that are in the hash table, into the list. */ private void appendPrefCmdsToList(Map cmdHash, List cmdList) { Iterator verb_enum = cmdHash.keySet().iterator(); while (verb_enum.hasNext()) { String verb = (String)verb_enum.next(); if (!checkForVerb(cmdList, verb)) { List cmdList2 = (List)cmdHash.get(verb); // get the list String className = (String)cmdList2.get(0); cmdList.add(new CommandInfo(verb, className)); } } }
/** * Check the cmdList to see if this command exists, return * true if the verb is there. */ private boolean checkForVerb(List cmdList, String verb) { Iterator ee = cmdList.iterator(); while (ee.hasNext()) { String enum_verb = (String)((CommandInfo)ee.next()).getCommandName(); if (enum_verb.equals(verb)) return true; } return false; }
public Object getBean(CommandInfo cmdinfo) { try { return cmdinfo.getCommandObject(this, this.getClass().getClassLoader()); } catch (IOException e) { return null; } catch (ClassNotFoundException e) { return null; } }