|
JavaTM Platform Standard Ed. 6 |
|||||||||
��һ���� ��һ���� | ��� ��� ������ | |||||||||
ժҪ�� Ƕ�� | �ֶ� | ���췽�� | ���� | ��ϸ��Ϣ�� �ֶ� | ���췽�� | ���� |
public interface DirStateFactory
�˽ӿڱ�ʾһ���������ù���������ö����״̬�����ڰ���Ӧ���ԡ�
JNDI �������ͨ��������̬���ض���ʵ�֡�
DirStateFactory ��չ�� StateFactory���������� Attributes ʵ���ṩ�� getStateToBind() �������ɸ÷������ء�DirStateFactory ʵ�ֽ��� DirContext �����ṩ��ʹ�á���������ʹ�� DirContext.bind() ����ʱ��������ָ��һ����ö������һ������Լ��ϡ�Ҫ�Ķ�������Ա����ݸ������� getStateToBind() ����������ù���������Щ��������ԣ������᷵���ɶ����Ҫ��������ɵ���Ӧ�ԡ�����ù���û�д����ö�������뷵�� null��
���磬�����߿��Խ�һ����ӡ��������һЩ���ӡ����ص�������һ��
���� ctx �� LDAP �����ṩ��ʹ�� DirStateFactory��ֱ��ͨ�� DirectoryManager.getStateToBind()���������ṩ printer �� printerAttrs������ LDAP Ŀ¼�Ĺ������Խ� printer ת����һ�����Լ������������� printerAttrs �ϲ���һ��Ȼ������ṩ��ʹ�õõ������Դ���һ�� LDAP �����Ŀ¼��ctx.rebind("inky", printer, printerAttrs);
��Ϊ DirStateFactory ��չ�� StateFactory�������������� getStateToBind() ����������һ�����������Բ����ϲ�ͬ����һ��������DirectoryManager.getStateToBind() ��ֻʹ�ý������Բ�������ʽ���� NamingManager.getStateToBind() ��ֻʹ�ò��������Բ�������ʽ��
����ʹ�ò�ͬ�IJ�����ε��� DirStateFactory �κ�һ����ʽ�� getStateToBind() ��������ʵ�����̰߳�ȫ�ġ�
DirectoryManager.getStateToBind(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable, javax.naming.directory.Attributes)
,
DirObjectFactory
Ƕ����ժҪ | |
---|---|
static class |
DirStateFactory.Result
���ڷ��� DirStateFactory.getStateToBind() �Ľ���Ķ���/���Զԡ� |
����ժҪ | |
---|---|
DirStateFactory.Result |
getStateToBind(Object obj,
Name name,
Context nameCtx,
Hashtable<?,?> environment,
Attributes inAttrs)
�ڸ���Ҫ����Ķ�������Ե�����¼������ڰĶ����״̬�� |
�ӽӿ� javax.naming.spi.StateFactory �̳еķ��� |
---|
getStateToBind |
������ϸ��Ϣ |
---|
DirStateFactory.Result getStateToBind(Object obj, Name name, Context nameCtx, Hashtable<?,?> environment, Attributes inAttrs) throws NamingException
DirectoryManager.getStateToBind() ������״̬�����м��ء����ijһ����ʵ�� DirStateFactory���� DirectoryManager �����ô˷����������������� StateFactory.getStateToBind()������������������ֱ��ijһ���������� null ��Ӧ��
��ijһ�����׳��쳣ʱ�����쳣�����ݸ� DirectoryManager.getStateToBind() �ĵ����ߡ�ֹͣ�������ܲ����� null Ӧ�����������������ֻ���ڿ���ȷ������Ψһ��Ҫ�Ĺ������Ҳ�Ӧ���ٳ�����������ʱ���׳��쳣������˶�����ʹ�����ṩ�IJ���������������Ӧ�÷��� null��
������ѡ���ʹ�� name
�� nameCtx
������ָ��Ҫ�����Ķ�������ơ��й���ϸ��Ϣ������� ObjectFactory.getObjectInstance()
��“���ƺ������IJ���”�����������ijһ����ʹ�� nameCtx
������Ӧ�ý���ʹ���벢������ͬ������Ϊ����֤������ʵ�����̰߳�ȫ�ġ�
name��inAttrs �� environment ����������������С���ʵ�ֲ�������Щ���������ǵ����ã����������ܱ������Щ����ĸ��������á��˷������صĶ������������С���ʵ�������������ġ������߰���һ��ͬ������������е��� Attributes �����߰�����ԭʼ inAttrs ���������á�
obj
- ��������״̬�Ķ�����Ϊ null����name
- �˶�������� nameCtx
�����ƣ����û��ָ�����ƣ���ò���Ϊ null��nameCtx
- һ�������ģ�name
����������ڸ�������ָ���ģ���� name
�����Ĭ�ϳ�ʼ�����ģ���ò���Ϊ null��environment
- ���ڴ��������״̬ʱʹ�õĻ���������Ϊ null����inAttrs
- ����������һ������ԣ�����Ϊ null�����ù��������� inAttrs��
NamingException
- ����˹�������ͼ��ö����״̬ʱ�����쳣�����Ҳ��ٳ�������������DirectoryManager.getStateToBind(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable, javax.naming.directory.Attributes)
|
JavaTM Platform Standard Ed. 6 |
|||||||||
��һ���� ��һ���� | ��� ��� ������ | |||||||||
ժҪ�� Ƕ�� | �ֶ� | ���췽�� | ���� | ��ϸ��Ϣ�� �ֶ� | ���췽�� | ���� |
��Ȩ���� 2007 Sun Microsystems, Inc. ��������Ȩ���� ����������֤��������������ĵ����·ַ�������