import javax.xml.registry.*; public class JAXRSearchClient extends RegistryClient { static String JAXRFactory = new String("JAXRConnectionFactory"); // // The two onException and onResponse methods are defined by the RegistryClient // interface to support asynch. messaging. // void onException() { }; void onResponse() { }; Connection getConnection(){ Context ctx = new InitialContext(); ConnectionFactory factory = (ConnectionFactory) ctx.lookup(JAXRFACTORY); Properties props = new Properties(); props.put("javax.xml.registry.factoryClass","com.sun.xml.registry.ConnectionFactory"); // other connection properties. . return factory.createConnection(props,this); } void Search() { Collection sqals = new ArrayList(); // The search qualifiers sqals.add(FindQualifier.CASE_INSENSITIVE_MATCH) Collection namePatterns = new ArrayList(); namePatterns.add("%Lumber%"); Connection cn = getConnection(); // // we could use the .setCredentials, setLocale etc on // the connection at this point if required // RegistryService rs = cn.getRegistryService(); // implements the RegistryService // and RegistryClient interfaces BusinessQueryManager bqm = rs.getBusinessQueryManager(); // find all the organizations that match our search // there are better then 12 findOrganizationXYZ methods on BusinessQueryManagers! BulkResponse orgs = bqm.findOrganizationsbyName(namePatterns, // what to search for search, // lexical qualifiers null); // sort qualifiers // manipulate the organizations as a collection Collection results =orgs.getCollection(); } }