Connection (Java EE 5 SDK)

Java

Java EE 5 SDK

深圳电信培训中心.徐海蛟老师.


javax.xml.registry Interface Connection

所有已知子接口:
FederatedConnection

public interface Connection

This class represents a connection between a JAXR client and a JAXR provider.

作者:
Farrukh S. Najmi
另请参见:
ConnectionFactory

方法摘要
 void close()
          Closes a Connection when it is no longer needed.
 Set getCredentials()
          Gets the credentials associated with this client.
 RegistryService getRegistryService()
          Gets the RegistryService interface associated with the Connection.
 boolean isClosed()
          Indicated whether this Connection has been closed or not.
 boolean isSynchronous()
          Indicates whether a client uses synchronous communication with JAXR provider or not.
 void setCredentials(Set credentials)
          Sets the Credentials associated with this client.
 void setSynchronous(boolean sync)
          Sets whether the client uses synchronous communication or not.
 

方法详细信息

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

返回:
the RegistryService associated with this object
抛出异常:
JAXRException - If the JAXR provider encounters an internal error
另请参见:
RegistryService

close

void close()
           throws JAXRException
Closes 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

抛出异常:
JAXRException - If the JAXR provider encounters an internal error

isClosed

boolean isClosed()
                 throws JAXRException
Indicated whether this Connection has been closed or not.

Capability Level: 0

返回:
true if Connection is closed; false otherwise
抛出异常:
JAXRException - If the JAXR provider encounters an internal error

isSynchronous

boolean isSynchronous()
                      throws JAXRException
Indicates whether a client uses synchronous communication with JAXR provider or not. A JAXR provider must support both modes of communication. A JAXR client can choose which mode it wants to use.

Capability Level: 0

返回:
true if Connection is synchronous (default); false otherwise
抛出异常:
JAXRException - If the JAXR provider encounters an internal error

setSynchronous

void setSynchronous(boolean sync)
                    throws JAXRException
Sets whether the client uses synchronous communication or not. A JAXR client may dynamically change its communication style preference.

Capability Level: 0

参数:
sync - true if Connection is desired to be synchronous; false otherwise
抛出异常:
JAXRException - If the JAXR 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 JAXR provider. A JAXR client may dynamically change its identity by changing the credentials associated with it.

Capability Level: 0

参数:
credentials - a Collection oj java.lang.Objects which provide identity related information for the caller.
抛出异常:
JAXRException - If the JAXR provider encounters an internal error

getCredentials

Set getCredentials()
                   throws JAXRException
Gets the credentials associated with this client.

Capability Level: 0

返回:
Set of java.lang.Object instances. The Collection may be empty but not null.
抛出异常:
JAXRException - If the JAXR provider encounters an internal error

Java EE 5 SDK

深圳电信培训中心.徐海蛟老师.


提交错误或意见

版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。深圳电信培训中心.徐海蛟老师教学参考.