Package javax.xml.registry
Interface Connection
-
- All Known Subinterfaces:
FederatedConnection
public interface ConnectionThis class represents a connection between a Jakarta XML Registries client and a Jakarta XML Registries provider.- Author:
- Farrukh S. Najmi
- See Also:
ConnectionFactory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Closes a Connection when it is no longer needed.SetgetCredentials()Gets the credentials associated with this client.RegistryServicegetRegistryService()Gets the RegistryService interface associated with the Connection.booleanisClosed()Indicated whether this Connection has been closed or not.booleanisSynchronous()Indicates whether a client uses synchronous communication with Jakarta XML Registries provider or not.voidsetCredentials(Set credentials)Sets the Credentials associated with this client.voidsetSynchronous(boolean sync)Sets whether the client uses synchronous communication or not.
-
-
-
Method Detail
-
getRegistryService
RegistryService getRegistryService() throws JAXRException
Gets the RegistryService interface associated with the Connection. If a Connection property (e.g. credentials) is set after the client calls getRegistryService then the newly set Connection property is visible to the RegistryService previously returned by this call.- Capability Level: 0
- Returns:
- the RegistryService associated with this object
- Throws:
JAXRException- If the Jakarta XML Registries provider encounters an internal error- See Also:
RegistryService
-
close
void close() throws JAXRExceptionCloses a Connection when it is no longer needed. Since a provider typically allocates significant resources outside the JVM on behalf of a Connection, clients should close them when they are not needed.- Capability Level: 0
- Throws:
JAXRException- If the Jakarta XML Registries provider encounters an internal error
-
isClosed
boolean isClosed() throws JAXRExceptionIndicated whether this Connection has been closed or not.- Capability Level: 0
- Returns:
trueif Connection is closed;falseotherwise- Throws:
JAXRException- If the Jakarta XML Registries provider encounters an internal error
-
isSynchronous
boolean isSynchronous() throws JAXRExceptionIndicates whether a client uses synchronous communication with Jakarta XML Registries provider or not. A Jakarta XML Registries provider must support both modes of communication. A Jakarta XML Registries client can choose which mode it wants to use.- Capability Level: 0
- Returns:
trueif Connection is synchronous (default);falseotherwise- Throws:
JAXRException- If the Jakarta XML Registries provider encounters an internal error
-
setSynchronous
void setSynchronous(boolean sync) throws JAXRExceptionSets whether the client uses synchronous communication or not. A Jakarta XML Registries client may dynamically change its communication style preference.- Capability Level: 0
- Parameters:
sync-trueif Connection is desired to be synchronous;falseotherwise- Throws:
JAXRException- If the Jakarta XML Registries provider encounters an internal error
-
setCredentials
void setCredentials(Set credentials) throws JAXRException
Sets the Credentials associated with this client. The credentials is used to authenticate the client with the Jakarta XML Registries provider. A Jakarta XML Registries client may dynamically change its identity by changing the credentials associated with it.- Capability Level: 0
- Parameters:
credentials- a Collection oj java.lang.Objects which provide identity related information for the caller.- Throws:
JAXRException- If the Jakarta XML Registries provider encounters an internal error
-
getCredentials
Set getCredentials() throws JAXRException
Gets the credentials associated with this client.- Capability Level: 0
- Returns:
- Set of java.lang.Object instances. The Collection may be empty but not null.
- Throws:
JAXRException- If the Jakarta XML Registries provider encounters an internal error
-
-