|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
javax.xml.registry Interface Connection
- All Known Subinterfaces:
- FederatedConnection
public interface Connection
Implemented by:
FederatedConnection
此类表示 JAXR 客户端与 JAXR 提供者之间的连接。
See also | javax.xml.registry.ConnectionFactory |
This class represents a connection between a JAXR client and a JAXR provider.
- Author:
- Farrukh S. Najmi
- See Also:
ConnectionFactory
Method Summary | |
---|---|
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. |
Method Detail |
---|
public RegistryService
getRegistryService() throws JAXRException
获取与 Connection 关联的 RegistryService 接口。如果 Connection 属性(例如凭据)是在客户端调用 getRegistryService 之后设置的,那么新设置的 Connection 属性对于此调用以前返回的 RegistryService 是可见的。
- 功能级别:0
return | 与此对象关联的 RegistryService |
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误 |
associates | <{RegistryService}> |
See also | javax.xml.registry.RegistryService |
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 JAXR provider encounters an internal error- See Also:
RegistryService
public void
close() throws JAXRException
当不再需要某个 Connection 时关闭它。由于提供者通常会代表 Connection 在 JVM 之外分配大量资源,因此客户端应该在不需要这些资源时关闭它们。
- 功能级别:0
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误 |
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
- Throws:
JAXRException
- If the JAXR provider encounters an internal error
public boolean
isClosed() throws JAXRException
指示此 Connection 是否已关闭。
- 功能级别:0
return |
如果 Connection 已关闭,则返回 true ;否则返回 false |
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误 |
isClosed
boolean isClosed() throws JAXRException
- Indicated whether this Connection has been closed or not.
- Capability Level: 0
- Returns:
true
if Connection is closed;false
otherwise- Throws:
JAXRException
- If the JAXR provider encounters an internal error
public boolean
isSynchronous() throws JAXRException
指示客户端使用同步通信还是非同步通信与 JAXR 提供者进行通信。JAXR 提供者必须支持这两种通信模式。JAXR 客户端可以选择它想使用的模式。
- 功能级别:0
return |
如果 Connection 是同步的(默认值),则返回 true ;否则返回 false |
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误 |
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
- Returns:
true
if Connection is synchronous (default);false
otherwise- Throws:
JAXRException
- If the JAXR provider encounters an internal error
public void
setSynchronous(boolean sync) throws JAXRException
设置客户端是否使用同步通信。JAXR 客户端可以动态更改其通信样式优先级。
- 功能级别:0
sync |
如果需要对 Connection 进行同步,则返回 true ;否则返回 false |
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误 |
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
- Parameters:
sync
-true
if Connection is desired to be synchronous;false
otherwise- Throws:
JAXRException
- If the JAXR provider encounters an internal error
public void
setCredentials(java.util.Set<E> credentials) throws JAXRException
设置与此客户端关联的 Credential。该凭据用于验证客户端和 JAXR 提供者。JAXR 客户端可以通过更改与其关联的凭据动态更改其身份。
设置与此客户端关联的 Credential。该凭据用于验证客户端和 JAXR 提供者。JAXR 客户端可以通过更改与其关联的凭据动态更改其身份。
- 功能级别:0
credentials | 为调用者提供与身份有关的信息的 java.lang.Object 所组成的 Collection。 |
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误 |
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
- Parameters:
credentials
- a Collection oj java.lang.Objects which provide identity related information for the caller.- Throws:
JAXRException
- If the JAXR provider encounters an internal error
public java.util.Set<E>
getCredentials() throws JAXRException
获取与此客户端关联的凭据。
- 功能级别:0
return | java.lang.Object 实例所组成的 Set。Collection 可以为空,但不能为 null。 |
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误 |
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 JAXR provider encounters an internal error
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Submit a bug or feature
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!