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; }
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; } }
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; } } }
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; }
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; } }
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; }
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) ProviderLocator.loadClass(info.getCommandClass(), this.getClass(), cl).newInstance(); } catch (ClassNotFoundException e) { return null; } catch (IllegalAccessException e) { return null; } catch (InstantiationException e) { return null; } }
if (bundle != null) { try { return (DataContentHandler) bundle.loadClass(info.getCommandClass()).newInstance(); } catch (ClassNotFoundException e) { return null; return (DataContentHandler) cl.loadClass(info.getCommandClass()).newInstance(); } 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) ProviderLocator.loadClass(info.getCommandClass(), this.getClass(), cl).newInstance(); } catch (ClassNotFoundException e) { return null; } catch (IllegalAccessException e) { return null; } catch (InstantiationException e) { return null; } }