Service Registry 3 2005Q4 Developer's Guide

Creating a Connection

To create a connection, a client first creates a set of properties that specify the URL or URLs of the registry or registries to be accessed. The following code provides the URLs of the query service and publishing service for the Registry if the Registry is deployed on the local system. (The strings should have no line breaks.)

Properties props = new Properties();
props.setProperty("javax.xml.registry.queryManagerURL",
    "http://localhost:6060/soar/registry/soap");
props.setProperty("javax.xml.registry.lifeCycleManagerURL",
    "http://localhost:6060/soar/registry/soap");

The client then obtains the connection factory as described in Creating or Looking Up a Connection Factory, sets its properties, and creates the connection. The following code fragment performs these tasks:

ConnectionFactory factory =
     JAXRUtility.getConnectionFactory();
factory.setProperties(props);
Connection connection = factory.createConnection();

The makeConnection method in the sample programs shows the steps used to create a JAXR connection.

Creating a Connection lists and describes the two properties that you can set on a connection. These properties are defined in the JAXR specification.

Table 2–1 Standard JAXR Connection Properties

Property Name and Description 

Data Type 

Default Value 

javax.xml.registry.queryManagerURL

Specifies the URL of the query manager service within the target registry provider. 

String 

None 

javax.xml.registry.lifeCycleManagerURL

Specifies the URL of the life-cycle manager service within the target registry provider (for registry updates). 

String 

Same as the specified queryManagerURL value