If all else fails, store as MarshalledObject.
The form of getStateToBind() that does not accept an
Attributes parameter always return null because this
factory needs to return Attributes.
The caller should always use the form of getStateToBind()
that accepts an Attributes parameter. This is the case if
the service provider uses DirectoryManager.
This factory only works on JDK1.2 systems because it needs MarshalledObject
and CORBA classes, which are in JDK1.2.
- Author:
- Rosanna Lee
Nested classes/interfaces inherited from interface javax.naming.spi.DirStateFactory |
javax.naming.spi.DirStateFactory.Result |
Method Summary |
java.lang.Object |
getStateToBind(java.lang.Object orig,
javax.naming.Name name,
javax.naming.Context ctx,
java.util.Hashtable env)
Always return null. |
javax.naming.spi.DirStateFactory.Result |
getStateToBind(java.lang.Object orig,
javax.naming.Name name,
javax.naming.Context ctx,
java.util.Hashtable env,
javax.naming.directory.Attributes inAttrs)
Returns an object and attributes for storing into LDAP that represents
the Remote object. |
private static javax.naming.spi.DirStateFactory.Result |
jrmpObject(java.lang.Object obj,
javax.naming.directory.Attributes inAttrs)
Returns a pair consisting of a MarshalledObject and attributes to
be bound with the stub. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CLASSNAME_ATTRID
private static final java.lang.String CLASSNAME_ATTRID
- See Also:
- Constant Field Values
CLASSNAMES_ATTRID
private static final java.lang.String CLASSNAMES_ATTRID
- See Also:
- Constant Field Values
STRUCTURAL_OCID
private static final java.lang.String STRUCTURAL_OCID
- See Also:
- Constant Field Values
MARSHALLED_OCID
private static final java.lang.String MARSHALLED_OCID
- See Also:
- Constant Field Values
RemoteToAttrs
public RemoteToAttrs()
getStateToBind
public javax.naming.spi.DirStateFactory.Result getStateToBind(java.lang.Object orig,
javax.naming.Name name,
javax.naming.Context ctx,
java.util.Hashtable env,
javax.naming.directory.Attributes inAttrs)
throws javax.naming.NamingException
- Returns an object and attributes for storing into LDAP that represents
the Remote object. If the input is not a Remote object, or if
the Remote object cannot be transformed, return null.
- Specified by:
getStateToBind
in interface javax.naming.spi.DirStateFactory
- Parameters:
orig
- The object to store; if not Remote; return null.name
- Ignoredctx
- Ignoredenv
- A possibly null environment. Used to get the ORB to use
when getting the CORBA object for the Remote object using RMI-IIOP.inAttrs
- The possibly null attributes included with the bind.
- Returns:
- {obj, attrs} where obj is either null or the RemoteStub of the
Remote object. It is the stub if orig is already a stub, or if
orig has a JRMP stub. attrs is a union of
inAttrs and and some other attributes depending on how
orig has been transformed.
If orig is transformed into a CORBA object, then it will
have CORBA-related attributes (see CorbaToAttrs).
- Throws:
javax.naming.ConfigurationException
- If problem calling RemoteObject.toStub()
or if problem transforming Remote object to CORBA object.
javax.naming.NamingException
- If some other problem occurred transforming
the object.
getStateToBind
public java.lang.Object getStateToBind(java.lang.Object orig,
javax.naming.Name name,
javax.naming.Context ctx,
java.util.Hashtable env)
throws javax.naming.NamingException
- Always return null.
- Specified by:
getStateToBind
in interface javax.naming.spi.StateFactory
- Parameters:
orig
- Ignoredname
- Ignoredctx
- Ignoredenv
- Ignored
- Throws:
javax.naming.NamingException
- Not thrown
jrmpObject
private static javax.naming.spi.DirStateFactory.Result jrmpObject(java.lang.Object obj,
javax.naming.directory.Attributes inAttrs)
throws javax.naming.NamingException
- Returns a pair consisting of a MarshalledObject and attributes to
be bound with the stub.
- Parameters:
obj
- The non-null object to store.inAttrs
- The possible null attributes to store with object.
- Returns:
- A non-null Result consisting of the MarshalledObject and attributes.
- Throws:
javax.naming.NamingException