void checkIfValid() throws JAXRException { if (this.mc == null) { throw new JAXRException(ResourceBundle.getBundle("com/sun/connector/jaxr/LocalStrings").getString("Connection_is_invalid")); } }
private static Object newInstance(String className, ClassLoader classLoader) throws JAXRException { try { Class spiClass; if (classLoader == null) { spiClass = Class.forName(className); } else { spiClass = classLoader.loadClass(className); } return spiClass.newInstance(); } catch (ClassNotFoundException x) { throw new JAXRException( "Provider " + className + " not found", x); } catch (Exception x) { throw new JAXRException( "Provider " + className + " could not be instantiated: " + x, x); } }
private static Object newInstance(String className, ClassLoader classLoader) throws JAXRException { try { Class spiClass; if (classLoader == null) { spiClass = Class.forName(className); } else { spiClass = classLoader.loadClass(className); } return spiClass.newInstance(); } catch (ClassNotFoundException x) { throw new JAXRException( "Provider " + className + " not found", x); } catch (Exception x) { throw new JAXRException( "Provider " + className + " could not be instantiated: " + x, x); } }
public static ConnectionFactory newInstance() throws JAXRException { String className = System.getProperty("javax.xml.registry.ConnectionFactoryClass", "org.apache.ws.scout.registry.ConnectionFactoryImpl"); ClassLoader cl = Thread.currentThread().getContextClassLoader(); if (cl == null) { cl = ConnectionFactory.class.getClassLoader(); } try { Class factoryClass = cl.loadClass(className); return (ConnectionFactory) factoryClass.newInstance(); } catch (ClassNotFoundException e) { throw new JAXRException("Unable to load JAXR ConnectionFactoryClass: " + className, e); } catch (InstantiationException e) { throw new JAXRException("Unable to instantiate JAXR ConnectionFactoryClass: " + className, e); } catch (IllegalAccessException e) { throw new JAXRException("Unable to instantiate JAXR ConnectionFactoryClass: " + className, e); } } }
public static ConnectionFactory newInstance() throws JAXRException { String className = System.getProperty("javax.xml.registry.ConnectionFactoryClass", "org.apache.ws.scout.registry.ConnectionFactoryImpl"); ClassLoader cl = Thread.currentThread().getContextClassLoader(); if (cl == null) { cl = ConnectionFactory.class.getClassLoader(); } try { Class factoryClass = ProviderLocator.loadClass(className, ConnectionFactory.class, cl); return (ConnectionFactory) factoryClass.newInstance(); } catch (ClassNotFoundException e) { throw new JAXRException("Unable to load JAXR ConnectionFactoryClass: " + className, e); } catch (InstantiationException e) { throw new JAXRException("Unable to instantiate JAXR ConnectionFactoryClass: " + className, e); } catch (IllegalAccessException e) { throw new JAXRException("Unable to instantiate JAXR ConnectionFactoryClass: " + className, e); } } }
public static ConnectionFactory newInstance() throws JAXRException { String className = System.getProperty("javax.xml.registry.ConnectionFactoryClass", "org.apache.ws.scout.registry.ConnectionFactoryImpl"); ClassLoader cl = Thread.currentThread().getContextClassLoader(); if (cl == null) { cl = ConnectionFactory.class.getClassLoader(); } try { Class factoryClass = ProviderLocator.loadClass(className, ConnectionFactory.class, cl); return (ConnectionFactory) factoryClass.newInstance(); } catch (ClassNotFoundException e) { throw new JAXRException("Unable to load JAXR ConnectionFactoryClass: " + className, e); } catch (InstantiationException e) { throw new JAXRException("Unable to instantiate JAXR ConnectionFactoryClass: " + className, e); } catch (IllegalAccessException e) { throw new JAXRException("Unable to instantiate JAXR ConnectionFactoryClass: " + className, e); } } }
public static ConnectionFactory newInstance() throws JAXRException { String factoryName = null; ConnectionFactory factory = null; try { String defaultName = null; factoryName = System.getProperty(SYS_PROP_NAME, defaultName); ClassLoader loader = Thread.currentThread().getContextClassLoader(); Class factoryClass = loader.loadClass(factoryName); factory = (ConnectionFactory) factoryClass.newInstance(); } catch(Throwable e) { throw new JAXRException("Failed to create instance of: "+factoryName, e); } return factory; }
public static ConnectionFactory newInstance() throws JAXRException { String factoryName = null; ConnectionFactory factory = null; try { String defaultName = null; factoryName = System.getProperty(SYS_PROP_NAME, defaultName); ClassLoader loader = Thread.currentThread().getContextClassLoader(); Class factoryClass = loader.loadClass(factoryName); factory = (ConnectionFactory) factoryClass.newInstance(); } catch(Throwable e) { throw new JAXRException("Failed to create instance of: "+factoryName, e); } return factory; }
/** * Creates a default <code>ConnectionFactory</code> object. * * @return a new instance of a <code>ConnectionFactory</code> * @throws JAXRException If the JAXR provider encounters an internal error * */ public static ConnectionFactory newInstance() throws JAXRException { try { return (ConnectionFactory) find(CONNECTION_FACTORY_CLASS, DEFAULT_CONNECTION_FACTORY); } catch (Exception ex) { throw new JAXRException("Unable to create "+ "ConnectionFactory: " +ex.getMessage()); } }
/** * Creates a default <code>ConnectionFactory</code> object. * * @return a new instance of a <code>ConnectionFactory</code> * @throws JAXRException If the JAXR provider encounters an internal error * */ public static ConnectionFactory newInstance() throws JAXRException { try { return (ConnectionFactory) find(CONNECTION_FACTORY_CLASS, DEFAULT_CONNECTION_FACTORY); } catch (Exception ex) { throw new JAXRException("Unable to create "+ "ConnectionFactory: " +ex.getMessage()); } }
Connection getConnection(Properties paramProperties) throws JAXRException { try { JaxrConnectionRequestInfo localJaxrConnectionRequestInfo = new JaxrConnectionRequestInfo(paramProperties); return (Connection)this.cm.allocateConnection(this.mcf, localJaxrConnectionRequestInfo); } catch (ResourceException localResourceException) { throw new JAXRException(localResourceException.getMessage()); } }
public void confirmAssociation(Association assoc) throws JAXRException, InvalidRequestException { //Store it in the UDDI registry HashSet<Association> col = new HashSet<Association>(); col.add(assoc); BulkResponse br = this.saveAssociations(col, true); if(br.getExceptions()!= null) throw new JAXRException("Confiming the Association Failed"); }
public void confirmAssociation(Association assoc) throws JAXRException, InvalidRequestException { //Store it in the UDDI registry HashSet<Association> col = new HashSet<Association>(); col.add(assoc); BulkResponse br = this.saveAssociations(col, true); if(br.getExceptions()!= null) throw new JAXRException("Confiming the Association Failed"); }
public String makeRegistrySpecificRequest(String s) throws JAXRException { String inquiry = "INQUIRY"; String publish = "PUBLISH"; String type = ""; //TODO: Need a better way to do this String snippet = s.substring(0,20); if( snippet.indexOf("save") > -1) type = publish; else type = inquiry; try { return registry.execute(s,type); } catch (TransportException e) { throw new JAXRException(e.getLocalizedMessage()); } }
Connection getJaxrConnection() throws JAXRException { checkIfValid(); try { return this.mc.getJaxrConnection(); } catch (ResourceException localResourceException) { throw new JAXRException(ResourceBundle.getBundle("com/sun/connector/jaxr/LocalStrings").getString("Unable_to_obtain_JAXR_Connection_") + localResourceException.getMessage()); } }
public void unConfirmAssociation(Association assoc) throws JAXRException, InvalidRequestException { //TODO //Delete it from the UDDI registry Collection<Key> col = new ArrayList<Key>(); col.add(assoc.getKey()); BulkResponse br = this.deleteAssociations(col); if(br.getExceptions()!= null) throw new JAXRException("UnConfiming the Association Failed"); }
public void unConfirmAssociation(Association assoc) throws JAXRException, InvalidRequestException { //TODO //Delete it from the UDDI registry Collection<Key> col = new ArrayList<Key>(); col.add(assoc.getKey()); BulkResponse br = this.deleteAssociations(col); if(br.getExceptions()!= null) throw new JAXRException("UnConfiming the Association Failed"); }
public Connection getConnection() throws JAXRException { try { JaxrConnectionRequestInfo localJaxrConnectionRequestInfo = null; if (this.properties != null) { localJaxrConnectionRequestInfo = new JaxrConnectionRequestInfo(this.properties); } log.fine("JAXRConnectionFactory getConnection - ConnectionManager calling allocateConnection"); return (Connection)this.cm.allocateConnection(this.mcf, localJaxrConnectionRequestInfo); } catch (ResourceException localResourceException) { throw new JAXRException(localResourceException.getMessage()); } }
public static PublisherAssertion getPubAssertionFromJAXRAssociationKey( String key) throws JAXRException { PublisherAssertion pa = objectFactory.createPublisherAssertion(); try { StringTokenizer token = new StringTokenizer(key, "|"); if (token.hasMoreTokens()) { pa.setFromKey(getToken(token.nextToken())); pa.setToKey(getToken(token.nextToken())); KeyedReference kr = objectFactory.createKeyedReference(); // Sometimes the Key is UUID:something String str = getToken(token.nextToken()); if ("UUID".equalsIgnoreCase(str)) { str += ":" + getToken(token.nextToken()); } kr.setTModelKey(str); kr.setKeyName(getToken(token.nextToken())); kr.setKeyValue(getToken(token.nextToken())); pa.setKeyedReference(kr); } } catch (Exception ud) { throw new JAXRException("Apache JAXR Impl:", ud); } return pa; }
public static PublisherAssertion getPubAssertionFromJAXRAssociationKey( String key) throws JAXRException { PublisherAssertion pa = objectFactory.createPublisherAssertion(); try { StringTokenizer token = new StringTokenizer(key, "|"); if (token.hasMoreTokens()) { pa.setFromKey(getToken(token.nextToken())); pa.setToKey(getToken(token.nextToken())); KeyedReference kr = objectFactory.createKeyedReference(); // Sometimes the Key is UUID:something String str = getToken(token.nextToken()); if ("UUID".equalsIgnoreCase(str)) str += ":" + getToken(token.nextToken()); kr.setTModelKey(str); kr.setKeyName(getToken(token.nextToken())); kr.setKeyValue(getToken(token.nextToken())); pa.setKeyedReference(kr); } } catch (Exception ud) { throw new JAXRException("Apache JAXR Impl:", ud); } return pa; }