rfc2713.txt
来自「RFC 的详细文档!」· 文本 代码 · 共 1,180 行 · 第 1/3 页
TXT
1,180 行
RFC 2713 Schema for Java Objects October 1999
RMI can be supported using different protocols: the Java Remote
Method Protocol (JRMP) and the Internet Inter-ORB Protocol (IIOP).
The JRMP is a specialized protocol designed for RMI; the IIOP is the
standard protocol for communication between CORBA objects [CORBA].
RMI over IIOP allows Java remote objects to communicate with CORBA
objects which might be written in a non-Java programming language
[RMI-IIOP].
2.5.1 Representation in the Directory
Remote objects that use the IIOP are represented in the directory as
CORBA object references [CORBA-LDAP]. Remote objects that use the
JRMP are represented in the directory in one of two ways: as a
marshalled object, or as a JNDI reference.
A marshalled object records the codebases of the remote object's stub
and any serializable or remote objects that it references, and
replaces remote objects with their stubs. To store a Remote object
as a marshalled object (java.rmi.MarshalledObject), you first create
a java.rmi.MarshalledObject instance for it.
java.rmi.Remote robj = ...;
java.rmi.MarshalledObject mobj =
new java.rmi.MarshalledObject(robj);
You can then store the MarshalledObject instance as a
javaMarshalledObject. The javaClassName attribute should contain the
fully qualified name of the distinguished class of the remote object.
The javaClassNames attribute should contain the names of the classes
and interfaces of the remote object. To read the remote object back
from the directory, first deserialize the contents of the
javaSerializedData to get a MarshalledObject (mobj), then retrieve it
from the MarshalledObject as follows:
java.rmi.Remote robj = (java.rmi.Remote)mobj.get();
This returns the remote stub, which you can then use to invoke remote
methods.
MarshalledObject is available only on the Java 2 Platform, Standard
Edition, v1.2 and higher releases. Therefore, a remote object stored
as a MarshalledObject can only be read by clients using the the Java
2 Platform, Standard Edition, v1.2 or higher releases.
Ryan, et al. Informational [Page 8]
RFC 2713 Schema for Java Objects October 1999
To store a remote object as a JNDI reference, you first create a
javax.naming.Reference object instance for it using the remote
object's string name as it has been, or will be, recorded with the
RMI registry, with the additional restriction that the "rmi:" prefix
must be present. Here's an example:
javax.naming.Reference ref = new javax.naming.Reference(
obj.getClass().getName(),
new javax.naming.StringRefAddr("URL",
"rmi://rserver/AppRemoteObjectX"));
You then store the javax.naming.Reference instance as a
javaNamingReference. The advantage of using a JNDI reference is that
this can be done without a reference to the remote object. In fact,
the remote object does not have to exist at the time that this
recording in the directory is made. The remote object needs to exist
and be bound with the RMI registry when the object is looked up from
the directory.
2.6 Serialized Objects Vs. Marshalled Objects Vs. References
The object classes defined in this document store different aspects
of the Java objects.
A javaSerializedObject or a serializable object stored as a
javaMarshalledObject represents the object itself, while a
javaNamingReference or a remote object stored as a
javaMarshalledObject represents a "pointer" to the object.
When storing a serializable object in the directory, you have a
choice of storing it as a javaSerializedObject or a
javaMarshalledObject. The javaSerializedObject object class provides
the basic way in which to store serializable objects. When you create
an LDAP entry using the javaSerializableObject object class, you must
explicitly set the javaCodebase attribute if you want readers of that
entry to know where to load the class definitions of the object. When
you create an LDAP entry using the javaMarshalledObject object class,
you use the MarshalledObject class. The MarshalledObject class uses
the RMI infrastructure available on the Java platform to automate how
codebase information is gathered and recorded, thus freeing you from
having to set the javaCodebase attribute. On the other hand, the
javaCodebase attribute is human-readable and can be updated easily by
using text-based tools without having to change other parts of the
entry. This allows you, for instance, to move the class definitions
to another location and then update the javaCodebase attribute to
reflect the move without having to update the serialized object
itself.
Ryan, et al. Informational [Page 9]
RFC 2713 Schema for Java Objects October 1999
A javaNamingReference provides a way of recording address information
about an object which itself is not directly stored in the directory.
A remote object stored as a javaMarshalledObject also records address
information (the object's "stub") of an object which itself is not
directory stored in the directory. In other words, you can think of
these as compact representations of the information required to
access the object.
A javaNamingReference typically consists of a small number of human-
readable strings. Standard text-based tools for directory
administration may therefore be used to add, read, or modify
reference entries -- if so desired -- quite easily. Serialized and
marshalled objects are not intended to be read or manipulated
directly by humans.
3 Attribute Type Definitions
The following attribute types are defined in this document:
javaClassName
javaClassNames
javaCodebase
javaSerializedData
javaFactory
javaReferenceAddress
javaDoc
3.1 javaClassName
This attribute stores the fully qualified name of the Java object's
"distinguished" class or interface (for example, "java.lang.String").
It is a single-valued attribute. This attribute's syntax is '
Directory String' and its case is significant.
( 1.3.6.1.4.1.42.2.27.4.1.6
NAME 'javaClassName'
DESC 'Fully qualified name of distinguished Java class or
interface'
EQUALITY caseExactMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
SINGLE-VALUE
)
Ryan, et al. Informational [Page 10]
RFC 2713 Schema for Java Objects October 1999
3.2 javaCodebase
This attribute stores the Java class definition's locations. It
specifies the locations from which to load the class definition for
the class specified by the javaClassName attribute. Each value of
the attribute contains an ordered list of URLs, separated by spaces.
For example, a value of "url1 url2 url3" means that the three
(possibly interdependent) URLs (url1, url2, and url3) form the
codebase for loading in the Java class definition.
If the javaCodebase attribute contains more than one value, each
value is an independent codebase. That is, there is no relationship
between the URLs in one value and those in another; each value can be
viewed as an alternate source for loading the Java class definition.
See [Java] for information regarding class loading.
This attribute's syntax is 'IA5 String' and its case is significant.
( 1.3.6.1.4.1.42.2.27.4.1.7
NAME 'javaCodebase'
DESC 'URL(s) specifying the location of class definition'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
)
3.3 javaClassNames
This attribute stores the Java object's fully qualified class or
interface names (for example, "java.lang.String"). It is a
multivalued attribute. When more than one value is present, each is
the name of a class or interface, or ancestor class or interface, of
this object.
This attribute's syntax is 'Directory String' and its case is
significant.
( 1.3.6.1.4.1.42.2.27.4.1.13
NAME 'javaClassNames'
DESC 'Fully qualified Java class or interface name'
EQUALITY caseExactMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
)
Ryan, et al. Informational [Page 11]
RFC 2713 Schema for Java Objects October 1999
3.4 javaSerializedData
This attribute stores the serialized form of a Java object. The
serialized form is described in [Serial].
This attribute's syntax is 'Octet String'.
( 1.3.6.1.4.1.42.2.27.4.1.8
NAME 'javaSerializedData
DESC 'Serialized form of a Java object'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.40
SINGLE-VALUE
)
3.5 javaFactory
This attribute stores the fully qualified class name of the object
factory (for example, "com.wiz.jndi.WizObjectFactory") that can be
used to create an instance of the object identified by the
javaClassName attribute.
This attribute's syntax is 'Directory String' and its case is
significant.
( 1.3.6.1.4.1.42.2.27.4.1.10
NAME 'javaFactory'
DESC 'Fully qualified Java class name of a JNDI object factory'
EQUALITY caseExactMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
SINGLE-VALUE
)
3.6 javaReferenceAddress
This attribute represents the sequence of addresses of a JNDI
reference. Each of its values represents one address, a Java object
of type javax.naming.RefAddr. Its value is a concatenation of the
address type and address contents, preceded by a sequence number (the
order of addresses in a JNDI reference is significant). For example:
#0#TypeA#ValA
#1#TypeB#ValB
#2#TypeC##rO0ABXNyABpq...
In more detail, the value is encoded as follows:
Ryan, et al. Informational [Page 12]
RFC 2713 Schema for Java Objects October 1999
The delimiter is the first character of the value. For readability
the character '#' is recommended when it is not otherwise used
anywhere in the value, but any character may be used subject to
restrictions given below.
The first delimiter is followed by the sequence number. The sequence
number of an address is its position in the JNDI reference, with the
first address being numbered 0. It is represented by its shortest
string form, in decimal notation.
The sequence number is followed by a delimiter, then by the address
type, and then by another delimiter. If the address is of Java class
javax.naming.StringRefAddr, then this delimiter is followed by the
value of the address contents (which is a string). Otherwise, this
delimiter is followed immediately by another delimiter, and then by
the Base64 encoding of the serialized form of the entire address.
The delimiter may be any character other than a digit or a character
contained in the address type. In addition, if the address contents
is a string, the delimiter may not be the first character of that
string.
This attribute's syntax is 'Directory String' and its case is
significant. It can contain multiple values.
( 1.3.6.1.4.1.42.2.27.4.1.11
NAME 'javaReferenceAddress'
DESC 'Addresses associated with a JNDI Reference'
EQUALITY caseExactMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
)
3.7 javaDoc
This attribute stores a pointer to the Java documentation for the
class. It's value is a URL. For example, the following URL points to
the specification of the java.lang.String class:
http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html
This attribute's syntax is 'IA5 String' and its case is significant.
( 1.3.6.1.4.1.42.2.27.4.1.12
NAME 'javaDoc'
DESC 'The Java documentation for the class'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
)
Ryan, et al. Informational [Page 13]
RFC 2713 Schema for Java Objects October 1999
4 Object Class Definitions
The following object classes are defined in this document:
javaContainer
javaObject
javaSerializedObject
javaMarshalledObject
javaNamingReference
4.1 javaContainer
This structural object class represents a container for a Java
object.
( 1.3.6.1.4.1.42.2.27.4.2.1
NAME 'javaContainer'
DESC 'Container for a Java object'
SUP top
STRUCTURAL
MUST ( cn )
)
4.2 javaObject
This abstract object class represents a Java object. A javaObject
cannot exist in the directory; only auxiliary or structural
subclasses of it can exist in the directory.
( 1.3.6.1.4.1.42.2.27.4.2.4
NAME 'javaObject'
DESC 'Java object representation'
SUP top
ABSTRACT
MUST ( javaClassName )
MAY ( javaClassNames $
javaCodebase $
javaDoc $
description )
)
Ryan, et al. Informational [Page 14]
RFC 2713 Schema for Java Objects October 1999
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?